跳到主要內容

發表文章

flash tomato firmware on ASUS RT-N12-C1

Tomato by Shibby For RT-N12-C1 we have to download from: K26RT-N – MIPSR2 – special builds for E4200, RT-N10U, RT-N12B1/C1, RT-N15U, RT-N53, RT-N66U, WNR3500Lv2 and newer Linksys E-series routers Step: 1. Reset AP to factory default 2. Setup staic IP for you desktop or laptop 3. Unplug power 4. Press the reset button in the back of AP the plug power 5. Wait until the pwoer led falsh slowly 6. Open browser and connect http://192.168.1.1 7. You should see a firmware upload page, select the tomato firmware and upload it 8. After upload success wait 5 minutes 9. Connect http://192.168.1.1, if you see the tomato webpage, you have done the job!

the wrong way to create image from sanpshot

If you create a EC2 image from the the sanshot which is a wrong way, you will end up with below error message: EXT3-fs: sda1: couldn't mount because of unsupported optional features (240). EXT2-fs: sda1: couldn't mount because of unsupported optional features (244). Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)     The wrong way is: 1. Create sanpshot from the running instance volume 2. Click the created snapshot and create image from the snapshot 3. Launch instance with the created image   The correct way is: 1. Create image from the running instance 2. Launch instance with the created image   That's it!  

enable ssl for squid3 on Ubuntu 12.04

# download source and dependencies cd /usr/src apt-get source squid3 apt-get build-dep squid3 apt-get install libsasl2-dev #  Enable SSL cd squid3-3.1.19 vim debian/rules + --enable-ssl \ # re-configure with enable-ssl ./configure # build package debuild -us -uc -b # Install package under /usr/src dpkg -i squid3-dbg_3.1.19-1ubuntu3.12.04.1_amd64.deb squid-cgi_3.1.19-1ubuntu3.12.04.1_amd64.deb squidclient_3.1.19-1ubuntu3.12.04.1_amd64.deb squid-common_3.1.19-1ubuntu3.12.04.1_all.deb By doing this, you can repackge a new deb package with enable-ssl feature, you can verify by: squid3-v | grep ssl

chrome java plugin on windows 7 64 bit

Chrome and Firefox on windows 7 64 bit OS both are only support 32 bit application. Therefore, if you want to install java plugin in Firefox and Chrome, you need to install java jre 32 bit version instead of 64 bit. Another thing is if after jave jre installation, in java testing page, you still keep asking to install jave plugin, it might caused by some chrome plugins blocks the jave plugin installation. you can use "about:plugins" to disable some plugin or in extension page remove some extenstions.

Communicate with RESTful APIs in Python

It's really cool to use requests to communicate with RESTful API in python! Requests is an elegant and simple HTTP library for Python, built for human beings.   It also support Basic/Digest authentication methods, you can simply pass parameters with it. If you are still using  other low level library such as urllib/urllib2/pycurl, etc... to communicate with RESTful API, you should give it a try! A lightning talk in EuroPython 2012: Communicate with RESTful APIs in Python Ref: Communicating with RESTful APIs in PythonWritten by Balthazar

Mutiple listening squid w/wo authentication

squid 要設定 ncsa_auth 認證其實不難, 有趣的是我們也可以利用 myport 來產生一個 acl squid 的 acl 跟 iptalbes 的 rule 很像, first match first apply. 所以我們可以設定從某些 port 來的 request 不需要密碼驗證, 其他的則必須要密碼驗證。另外也可以加入允許連連線的來源網址,只要注意規則的順序就好囉! # vi /etc/squid/squid.conf  http_port = 3128  # listensing port B http_port = 9999  # listensing port B   # Enable ncsa_auth  (htpasswd -c /etc/squid/passwd username ) auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours auth_param basic casesensitive off   # Add filter for ncsa auth acl lab_lan src 172.18.0.0/22 172.18.4.0/22 # multiple CIDR network acl ncsa_users proxy_auth REQUIRED acl no_auth myport 9999 http_access allow no_auth lab_lan http_access allow ncsa_users lab_lan # Deny others ...   http_access deny all