Archive for the ‘Open Source’ Category

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.

sed with multiple criteria

Thursday, April 3rd, 2008

sed -e 1d -e 50d -e ‘/junks/d’

would remove first and 50th line & any line(s) with the word “junks”.

update 20080821 :

sed -e ‘/^$/d’

would remove every empty line

ssh client hang after a few minutes of inactivity

Wednesday, April 2nd, 2008

specify the parameter “ServerAliveInterval 60″ in /etc/ssh_config or /etc/ssh/ssh_config.

for more info, man ssh_config

Exim – anti-spam per domain setting

Tuesday, April 1st, 2008

acl_check_rcpt:
blah …
blah …
blah …
deny message = rejected as $sender_host_address is blacklisted in $dnslist_domain\n$dnslist_text
domains = domain-one.com : domain-two.com : domain-three.com
dnslists = sbl-xbl.spamhaus.org

blah …
blah …
blah …

reference link : http://www.exim-new-users.co.uk/content/view/65/39/