Archive for the ‘www.systems.takizo.com’ Category

Reverse DNS Lookup with Dig

Posted on January 22nd, 2011 by "takizo" from "takizo, not takezo » freebsd"

Reverse DNS, in simple explanation it means that resolve your IP address into hostname. Nowaday it became a must have requirement for mail server’s IP address. It is also one of the method to determine your mail server IP is glue to the hostname.

Here is how to find out the reverse DNS IP address is pointed to which DNS

(Read more...)

Detect DDoS Source & Destination IP Address with OURMON

Posted on June 26th, 2008 by "takizo" from "takizo, not takezo » freebsd"

We have OURMON running on one of network segment for quite some time, it is very helpful and resourceful when DDoS attack happened, especially to help our customer to find out which destination is targeted on the attack and from which sources. Below is the graph that we previously captured while running OURMON version 2.70.

OURMON Version 2.81

On the

(Read more...)

split – but no destination parameter to specify

Posted on April 22nd, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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)

cron & time zone

Posted on April 18th, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

after changing time zone (tzsetup), restart cron (/etc/rc.d/cron restart) to let it know the changes or else the cron jobs will use the previous time zone.

convert epoch using date command

Posted on April 13th, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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’

Forget / forgot / cannot remember root password

Posted on April 8th, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

On a FreeBSD server

1. reboot server
2. choose to boot into single user mode
3. mount -o rw <root partition> e.g. mount -o rw /
4. passwd <root account> e.g. passwd root
5. mount -o ro <root partition> e.g. mount -o ro /
6. reboot server again

Voila !!!

How to dig SRV record after creating it in DNS

Posted on April 6th, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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

Posted on April 4th, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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

Posted on April 3rd, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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

Posted on April 2nd, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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

Posted on April 1st, 2008 by "psyber.monkey" from "takizo, not takezo » freebsd"

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/