Archive for the ‘Apple’ Category

Quick Screen Lock on Apple Mac OSX

Thursday, June 25th, 2009

mac-osx-leopard-available Locking your screen is critical when you are using your laptop in public or in the office, if you don’t lock your screen, within a second the data in your laptop might be owned by somebody who walk pass by your desk.

Does Apple Mac OSX support screen lock by keyboard shortcut key? I would say no, but you can do it with simple hacks.

Quick Screen Lock with Expose

One of my favorite screen lock method is through Expose. Before showing you how to lock the screen with Expose, you have to work on something at System Preferences.

(more…)

split – but no destination parameter to specify

Tuesday, April 22nd, 2008

first :

cd /destination/directory

second :

split /source/directory/big-huge-file prefix-to-apply-onto-splited-files

Voila !!!

(use the parameter -b to specify the size of splited files in BYTES, NOT kb, mb or gb)

convert epoch using date command

Sunday, April 13th, 2008

date -d ‘<Unix epoch> <epoch date> sec’

e.g. date -d ‘1970-01-01 988822888 sec’ would dated “Wed May 2 17:31:28 MYT 2001″

20080430 :

get a particular date in epoch, e.g. date -d ‘Apr 30 2008 00:00:00′ ‘+%s’

How to dig SRV record after creating it in DNS

Sunday, April 6th, 2008

dig <record type> <host.name>

e.g dig SRV _someservice._port.hostname.domainame.com.my OR dig SRV _https._ICMP.host.takizo.com

ls & rm with regular expression

Friday, April 4th, 2008

e.g. rm -rf backup-20070[8-9]-*

would delete :

  • backup-200708-morning
  • backup-200708-evening
  • backup-200709-night
  • backup-200709-latenight

but not :

  • backup-200706-morning
  • backup-200707-afternoon
  • backup-200711-midnight

e.g. ls backup-20070[1-9] would list all backup starting from January to September but leave October, November & December out, of year 2007.