Friday, August 10, 2012

Using Proxy with Chrome on Mac OSX

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --proxy-server=149.169.227.131:3128 As far as I know it only supports http proxy, no socks proxy yet.

Tuesday, June 14, 2011

How to create user on Mac OSX using command line

nireport / /users name uid | grep "5[0123456789][0123456789]"
sudo niutil -create / /users/ftpuser
sudo niutil -createprop / /users/ftpuser uid 555
sudo niutil -createprop / /users/ftpuser realname "FTP User"
sudo niutil -createprop / /users/ftpuser home "/Users/ftpuser"
sudo niutil -createprop / /users/ftpuser shell "/dev/null"
sudo niutil -createprop / /users/ftpuser gid 20
sudo niutil -createprop / /users/ftpuser passwd "*"
sudo passwd ftpuser

Saturday, June 26, 2010

How to set svn username in Linux/OSX

export SVN_SSH="ssh -l {loginname}"

where {loginname} is desired username.

Regex for alpha in Open Office Writer

If you want to find all alpha characters in Writer, the regular expression below will work
[:alpha:]*

Thursday, May 14, 2009

Using Zip Command Under Linux

It's a simple command, but I keep forgetting the correct syntax every now and then. So I just log it here.

zip -9 {archive_name}.zip {path_to_your_folder}/*

This will zip all the files under a specific folder. -9 refers to best compression. Reduce it to lower value -1 to -8 for faster compression and decompression.

Tuesday, April 08, 2008

Find Out Your Web Server's Public IP(Linux)

Sometimes, your server might be behind those nifty grifty firewall and it only has local address. If you want to find out your server's public IP, use this command to find out:

curl -s www.whatismyip.com/automation/n09230945.asp|sed

Basically I used www.whatismyip.com service and used curl to get the content of the page.

Thursday, November 29, 2007

How To Detect Mobile Devices on Your Site

This is not an easy task if you don't know what kind of headers were sent from various mobile browsers and how to detect them. But this php script on Andy Moore's sites shows you how you can detect them effectively. You can easily modify the script to work on any other language you prefer.