July 2012 Archives

Get Linux uptime seconds

user-pic
Vote 0 Votes

cat /proc/uptime
35115009.84 28744638.57

第一個數字是開機秒數
第二個數字是 Idle 秒數

若 crontab 裡要設條開機後一個小時才執行某動作, 可以這樣設定
[ `cut -d. -f1 /proc/uptime` -gt 3600 ] && some-script

ref. /proc/uptime

ASUS O!Play Mini Plus

user-pic
Vote 0 Votes

ASUS O!Play Mini Plus 使用 Realtek 1185 晶片,
一些特點如下:
支援 Gigabit LAN, 其實看 BDISO 也用不到那麼快速度, 主要是爽度的差別.
支援 802.11n WiFi, 對於客廳沒網路線的人很方便.
選單操控比上一代晶片(1073/1283)快一些.
開機到 Ready 25 秒, 比前一代晶片快了至少十秒.
耗電量待機時 4W, 撥放時 4-5W, 非常省電.
播放影片的解碼能力比上一代晶片好, 拿出之前無法播的影片都能正常播放.

注意事項: 電視系統記得改成 1080P 60Hz, 才有高清效果, 預設值是 NTSC

目前的缺點:
1. 網芳檔案的排序毫無規則可循, 找檔案很辛苦, 這篇開箱文 也有提到
2. 已設好捷徑在 My_shortcuts, 但每次到「檔案管理/網路」還是要按綠鍵重新掃描, 使用上很不便, 已建立的捷徑應該直接秀出, 直點進入

已將問題反應給 ASUS, 希望下一版的 Firmware 能解決

ref. ASUS O!Play Mini Plus review

DNS Abuse Attack ?

user-pic
Vote 0 Votes

最近觀察到一種 DNS 的攻擊行為, 似乎是 Botnet 的攻擊模式

其共同模式為:
1. TXT query
2. response result > 2K (也就是需要 2 個以上的封包才能傳完), 例如 host -t txt gd21.net
3. 許多不同的 IP query 同一個 domain 的 TXT
4. query 頻率很高
5. 攻擊非持續進行, 從幾分鐘到幾小時都有

這樣的行為會造成 DNS 忙著回應這些 abuse query, 量大的話很恐怖,
輕則流量大增, 重則癱瘓 DNS 的網路, 影響服務.
造成正常的用戶查詢困難或甚至查不到 Domain,
算是一種 DDoS 攻擊.

PHP Web Server

user-pic
Vote 0 Votes

PHP 5.4.0 開始, PHP CLI 內建 Web Server

php -S 0.0.0.0:80
會以目前的目錄為 Document root

If Linux, 把這個 phpwebserver Script 放在 /etc/init.d
chkconfig phpwebserver on

修改一下 Script 前面的參數符合需求
PHP=/usr/local/bin/php
LOG=/var/log/phpwebserver.log
PORT=80
DOCUMENT_ROOT=/var/www/html

service phpwebserver start 即可啟動
index 檔搜尋的順序為 index.php index.html

拿來測試或小型網站使用應該很足夠

ref. PHP: Built-in web server

2012-7-31 之後建立的 Dropbox 帳號, 將沒有 Public 目錄功能,
Dropbox 是少數能建立 Direct Link 的雲端同步軟體, 現在它也要關掉這個功能了, 所幸所有的舊用戶都能繼續保有此功能.
Direct Link 跟 Share Link 有何不同?
用實例看最快, 以下是同一個檔案的 Direct Link 與 Share Link
Direct Link https://dl.dropbox.com/u/7586031/puremsn14.0.8117cht2012.exe
Share Link https://www.dropbox.com/s/91y6t1xif39xuk9/puremsn14.0.8117cht2012.exe

用 Share Link 的網址後面加 ?dl=1, 還是可以取得 dl.dropbox.com 開頭的 Direct Link
# curl -I "https://www.dropbox.com/s/91y6t1xif39xuk9/puremsn14.0.8117cht2012.exe?dl=1"
HTTP/1.1 302 FOUND
Server: nginx/1.0.14
Date: Mon, 16 Jul 2012 16:11:27 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
set-cookie: gvc=MzM3NzU2OTM2OTAwMDcyOTk0MDI0MjE2ODc0NTQyMzUwNjQ5MDg4; expires=Sat, 15-Jul-2017 16:11:27 GMT; Path=/; httponly
location: https://dl.dropbox.com/s/91y6t1xif39xuk9/puremsn14.0.8117cht2012.exe
pragma: no-cache
cache-control: no-cache
x-frame-options: SAMEORIGIN

location: 這行就是了

結果就是把 www 換成 dl 就行了

ref. Dropbox Kills Public Folders for new accounts

Intel 的網卡若在抓封包時要看到 802.1q VLAN or QoS tagged frames(如下圖), 必需調整 Registry

依這篇文章加完 Key 後, 將網卡停用啟用即可
Network Connectivity My sniffer is not seeing VLAN, 802.1q, or QoS tagged frames
若不知網卡的 Driver 是那一種, 就兩個 Key 都加 (MonitorModeEnabled and MonitorMode)

About this Archive

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

June 2012 is the previous archive.

August 2012 is the next archive.

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

Monthly Archives