July 2015 Archives

AnyDesk 是個類似 Teamviewer 的程式,
自家有一份 Benchmark Test, 表現出色
不管他有沒有老王賣瓜, 自賣自誇
實際使用起來的確比 Teamviewer 順暢
和 Teamviewer 一樣有免費及付費版, 但是不會像 Teamviewer 偵測到商業使用就限制使用時間, 甚至封鎖

wget save real file name

user-pic
Vote 0 Votes

wget 遇到有轉址時, save 的檔名可能會不正確
例如:
# wget http://hk1.php.net/get/php-5.6.11.tar.bz2/from/this/mirror
--2015-07-22 14:32:35-- http://hk1.php.net/get/php-5.6.11.tar.bz2/from/this/mirror
Resolving hk1.php.net... 202.67.138.74
Connecting to hk1.php.net|202.67.138.74|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://hk1.php.net/distributions/php-5.6.11.tar.bz2 [following]
--2015-07-22 14:32:35-- http://hk1.php.net/distributions/php-5.6.11.tar.bz2
Connecting to hk1.php.net|202.67.138.74|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14081292 (13M) [application/octet-stream]
Saving to: `mirror'

加 --content-disposition 就會讓 save 的檔名是正確的
# wget --content-disposition http://hk1.php.net/get/php-5.6.11.tar.bz2/from/this/mirror
--2015-07-22 14:56:25-- http://hk1.php.net/get/php-5.6.11.tar.bz2/from/this/mirror
Resolving hk1.php.net... 202.67.138.74
Connecting to hk1.php.net|202.67.138.74|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://hk1.php.net/distributions/php-5.6.11.tar.bz2 [following]
--2015-07-22 14:56:25-- http://hk1.php.net/distributions/php-5.6.11.tar.bz2
Connecting to hk1.php.net|202.67.138.74|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14081292 (13M) [application/octet-stream]
--2015-07-22 14:56:25-- http://hk1.php.net/distributions/php-5.6.11.tar.bz2
Reusing existing connection to hk1.php.net:80.
HTTP request sent, awaiting response... 200 OK
Length: 14081292 (13M) [application/octet-stream]
Saving to: `php-5.6.11.tar.bz2'

--content-disposition
If this is set to on, experimental (not fully-functional) support for "Content-Disposition" headers is enabled.
This can currently result in extra round-trips to the server for a "HEAD" request,
and is known to suffer from a few bugs, which is why it is not currently enabled by default.
This option is useful for some file-downloading CGI programs that use "Content-Disposition"
headers to describe what the name of a downloaded file should be.

The "-append" option appends vertically, while the plus form "+append" appends horizontally.

convert 1.jpg 2.jpg -append 1-2.jpg
convert 1.jpg 2.jpg +append 1+2.jpg

2x2 image
convert \( 1.jpg 2.jpg +append \) \( 3.jpg 4.jpg +append \) -append 1234.jpg

ASN to IP Query

user-pic
Vote 0 Votes

# whois -h whois.radb.net '!gAS15169'
輸出的結果是 BGP announce 的網段, 可以再用 netmask summary

# netmask `whois -h whois.radb.net '!gAS15169' | grep '^[0-9]'`
1.0.0.0/24
1.1.1.0/24
1.2.3.0/24
8.8.4.0/24
8.8.8.0/24
8.15.202.0/24
8.34.208.0/20
8.35.192.0/20
23.236.48.0/20
23.251.128.0/19
64.15.112.0/20
64.233.160.0/19
66.102.0.0/20
66.249.64.0/19
70.32.128.0/19
72.14.192.0/18
74.125.0.0/16
104.132.0.0/16
104.133.0.0/17
104.134.128.0/17
104.154.0.0/15
104.196.0.0/14
107.167.160.0/19
107.178.192.0/18
108.59.80.0/20
108.170.192.0/18
108.177.0.0/17
113.197.106.0/24
130.211.0.0/16
142.250.0.0/15
146.148.0.0/17
162.216.148.0/22
162.222.176.0/21
172.102.8.0/21
172.110.32.0/21
172.217.0.0/16
172.253.0.0/16
173.194.0.0/16
173.255.112.0/20
192.104.160.0/23
192.158.28.0/22
192.178.0.0/15
193.142.125.0/24
194.110.194.0/24
199.192.112.0/22
199.223.232.0/21
207.223.160.0/20
208.65.152.0/22
208.117.224.0/19
209.85.128.0/17
216.58.192.0/19
216.239.32.0/19
216.252.220.0/22

ref. Merit RADb Tutorial: Query Options

IP to ASN Query

user-pic
Vote 0 Votes
# whois -h whois.cymru.com 168.95.1.1
[Querying whois.cymru.com]
[whois.cymru.com]
AS      | IP               | AS Name
3462    | 168.95.1.1       | HINET Data Communication Business Group,TW
# whois -h whois.cymru.com 8.8.8.8
[Querying whois.cymru.com]
[whois.cymru.com]
AS      | IP               | AS Name
15169   | 8.8.8.8          | GOOGLE - Google Inc.,US

        

發現用 Apache 2.4 + PHP (any version), 用 exec 執行 ping 一個 ping 不到的 IP, 會卡住

exec("ping -c1 -w1 192.168.1.100"); // 192.168.1.100 does not exist

但是去 ping 一個 ping 得到的 IP 則正常
目前找不到解決方法, 只能用 Workaround 使用 Apache 2.2

若不習慣使用 Windows 的工作排程器, 可用 nnCron LITE
裝好後在安裝目錄有一個 cron.tab 檔, 格式跟一般的 crontab 一樣
#CRONTAB FILE
# Classic crontab format:
# Minutes Hours Days Months WeekDays Command

例如: 每分鐘都跳出記事本
* * * * * notepad.exe

About this Archive

This page is an archive of entries from July 2015 listed from newest to oldest.

June 2015 is the previous archive.

August 2015 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives