2013年10月31日 星期四

How to use tcpdump to sniffer http header

 

1.tcpdump -s 1024 -l -A dst www.cnn.com
2.

Type the following command at shell prompt:

# tcpdump -n -i eth0 -s 0 -w output.txt src or dst port 80

 

Where,

  • -n : Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
  • -i eth0 : Specify interface to capture data.
  • -s 0 : Snarf snaplen[snapshot length] bytes of data from each packet rather than the default of 68. Setting to 0 means use the required length to catch whole packets.
  • -w output.txt : Save data to output.txt file
  • src or dst port 80 : Capture port 80.

@Result

11:04:31.674686 IP 10.1.246.215.61709 > 157.166.248.11.http: Flags [.], ack 1478957458, win 65535, length 0

.....C...(....E..(k.@.@.9/

.P/.2.X'..P...TU..

11:04:31.674907 IP 10.1.246.215.61709 > 157.166.248.11.http: Flags [P.], seq 0:369, ack 1, win 65535, length 369

.....C...(....E.....@.@...

.P/.2.X'..P...u\..GET / HTTP/1.1

Host: www.cnn.com

Connection: keep-alive

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36

Accept-Encoding: gzip,deflate,sdch

Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4

 

 

11:04:31.675385 IP 10.1.246.215.61710 > 157.166.248.11.http: Flags [.], ack 3228182788, win 65535, length 0

.....C...(....E..(2P@.@.q.

..........P..[?.j).P.......

11:04:32.087077 IP 10.1.246.215.61709 > 157.166.248.11.http: Flags [.], ack 426, win 65535, length 0

2013年10月30日 星期三

使用手邊的macbook pro直接連接Apple TV 進行文字輸入

需要的軟體:iKeyboard

由於Apple TV新的OS 已經支援藍芽鍵盤,所以就想說應該一樣可以透過ikeyboard這個軟體,去模擬連接Apple TV做設定,剛測試了一下,真的可行,這樣就不用為了Apple TV 多準備一個無線藍芽鍵盤了

Apple TV 6.0.2 無法收看預告片問題

 

由於在apple TV 新的OS 中,已經將DNS傳輸強制走https,所以需要相對應的憑證設定檔,所以為了要繼續使用,你需要有方法去安裝描述檔,

方法一:

   第一個方法是需要透過Apple configurator直接連接apple TV去安裝設定,或者也可以透過謝列的方法,比較簡單

方法二:

@Apple TV

     *設定--->一般--->在"將資料傳送給Apple"這格 遙控器按下Play/Pause鍵,就會出現新增描述檔設定

     *輸入" http://class9.ml/fix”

     *重新回到設定 網路 把DNS改回210.129.145.150 (6.0.2版本請更換成 182.16.230.98 )

 

如果沒有需要破解的話,可以嘗試把DNS改成seednet DNS

139.175.55.244

據說可以解決收看影片lag的問題

為什麼有的國家會是小國家立國,有的卻是大國家?

腦海中偶然浮現出的一個想法,為什麼有得時代或區域會小國家林立,有的卻是只存在大國家呢?初步的想法是

如果一個國家一開始成立是就是富裕國家,或者說很容易生存討生活,那麼這個國家應該成為小國家的機率比較大,

反之如果國家一開始窮困,那麼這區域的小國家會因為要求更好的生活,所以會攻打其他國家,所以最後可能就會

統一成為一個大國家,反之容易討生活的區域,除非出現那種大野心的霸主,不然應該都很容易安逸於現在的生活

而不會繼續併購成為一個大土地的國家

How to find a big files in linux

Reference:  http://www.cyberciti.biz/faq/find-large-files-linux/

上面的部落格有寫完整的使用介紹,這邊單純最為自己使用記錄

 

find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $9 “:” $8 ": " $5 }'

2013年10月26日 星期六

[Mac] Aperture 試用版

由於Apple這次10.9的更新,對於軟體認證,只有有安裝過測試版本的都可以免費升級,下列網路上找到之前可以使用的

Aperture試用版連結與資訊

http://pan.baidu.com/share/link?shareid=1230152010&uk=3204541662

Serial number:E-321-JAQ-387-KKC-187-GZN-111-NPT-1LB-5S7X

2013年10月25日 星期五

[Mac] 休眠檔案刪除問題

Mac的休眠模式有三種模式

* Suspend to RAM: 直接把休眠檔案寫入記憶體中,速度快,但是需要消耗電力,hibernatemode =0

* Suspend to Disk :直接把休眠檔案寫入硬碟,速度慢還不需要靠任何電力,hibernatemode=5

* Supend to RAM+DISK: 結合上述兩者的優缺點,hibernatemode=3

 

查詢指令如下:

$sudo pmset -g|grep hibernatemode

 

設定指令如下:

$sudo pmset -a hibernatemode 0
$sudo rm -rf /private/var/vm/sleepimage

為了避免系統在自己產生sleepimage,可以自己設定一個同樣的檔案名稱,然後更改檔案權限讓他變成不能變更
$ sudo pmset -a hibernatemode 0 
$ sudo rm -rf /private/var/vm/sleepimage 
$ sudo touch /private/var/vm/sleepimage 
$ chflags uchg /private/var/vm/sleepimage

##如果要看現在系統的休眠設定狀況,可以用下列指令,看是否有人停止休眠模式
$ pmset -g assertions

2013年10月22日 星期二

[Camlistore]: reference for backing up your data to camlistore

http://thomassileo.com/blog/2013/08/20/backing-up-your-tweets-to-camlistore-with-python-and-camlipy/

[Mac] Mac下看漫畫的神兵利器

1.Jcomicdownloader: 一個跨平台的java 小程式,可以幫你解析大部分漫畫網站的網址,並下載裡面的圖片,片,https://sites.google.com/site/jcomicdownloader/

 

2.http://www.geocities.jp/coo_ona/viewer_en.html  一個免費的圖片瀏覽器,專門用來看漫畫的,基本上之直接讀取圖片檔或壓縮檔,在設定裡面也可以指定當讀取到最後一頁時,是要在當前folder或直接改換到下一個目錄(或壓縮檔),基本上要注意如果你裡面兩個都有的話,他會兩個都開啟,所以你可能會誤以為設定沒有用

 

3.目前我是追蹤下列三部漫畫,每個星期從新執行一次,如果未下載過的新漫畫,會用比較顯眼的標示出

1).王者天下:http://comic.sfacg.com/HTML/WZTX/

2).近擊的巨人:http://comic.sfacg.com/HTML/JJDJR

3)黒子的籃球:http://comic.sfacg.com/HTML/HZDLQ

[Raspberry pi] camera

http://dreamcolor.net/2013/05/raspicam-documentation/

http://yehnan.blogspot.tw/2013/05/raspberry-pi.html

2013年10月18日 星期五

Windows 8.1 開放更新

這幾天看到新聞一直再寫windows 8.1已經開放更新,不過我按了好幾次更新後都沒發現新的更新,後來才發現原來要從

windows 市集,點進去就可以看到更新選項了

[How to] Found invalid password for user : 'root@localhost'; Igonring user

Today I encounter a Mysql accessing problem.  When I tried to access mysql database with local root server, it claims

the password is invalid, so it will igonor user.   After googling, I found it was caused by using 'plaintext password' for 

this user.  To resolve this problem, we can update with correct one.


1. Access Mysql, please use anyone method you can to access the mysql database;

  1)use the other valid mysql account 

  2)stop mysql and start it with skip grant table

   #/etc/init.d/mysql stop

   #mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

2.update user password;

 [mysql]>use mysql;

[mysql]> select  * from user;

[mysql]> update user set PASSWORD=PASSWORD('your password') where USER='root' and Host='xxxx';

[mysql]>FLUSH PRIVILEGES;

** get your hash password from mysql

----[mysql]> select password('your password')

** safe update mode

----[mysql]> SET SQL_SAFE_UPDATES=0;

How to do Debugging on Postfix

Fail to start mysql

2013年10月15日 星期二

MarsEdit with asciidoc post

<p>== ascii doc test</p> <p>test</p> <p> </p> <p>== subject</p> <p>sadfsate   </p> <p>* a</p> <p>* b</p> <p>*c</p>

How to Set Up an Easy to Use Online monitoring system

To meet my expectation, the monitoring system needs have the below components 

1.Alarms and reporting

2.Flexiable customized monitoring probes.

3.actioniable notification

* can define escalation flow to auto recovery system when incidents occurs

 

In reply to how to set up ad easy to use online monitoring system.

The import thing is to start with the basics.

1.Start with the Basics:

2.Become a regular part of your daily work.

2013年10月14日 星期一

2374(佳能)

2015/04/28 隔了快兩年,又遇到新台幣升值的問題了,在數位相機整體產業這麼差的狀態下,應該不用再對業績期待的吧,只是不知道對於佳能到底哪一種幣值對他影響比較大


近期台幣升值,對於佳能這種外銷公司應該不會是好消息,這家公司其實嚴格說起來算是牛皮公司,股價跟公司營收正相關不是那麼大,公司雖然說看起來還是有炒作股價的跡象,但勉強算正派,講出來的業績預設基本上不會相差太遠,目前屬於盤跌整理,整個數位相機產業屬於很慘的狀態,但佳能這家公司整個經營狀況算是好的,所以我覺得似乎是值的我投資的一家公司

How to restore a deleted onenote page

復原不小心誤刪的onenote