
Route table are part of the area to troubleshoot when a connection have problem. Route table can the the most frequent problem to look at after assigning an IP address. Other times, it is mainly for adding additional routes when wireless & wired connection are both in use. This post will attempt to list out a few ways to display route table and also how to assign default route aka default gateway in Linux & FreeBSD.
Read More »

In Linux & FreeBSD, often we need to cd to a directory then ls to find out the files in that directory. Then only to find out we need to go back to the previous directory and do something else, and we will need to type “cd /very/long/directory/name/and/it/is/just/so/not/cool/to/do/“.
Read More »

By default, grep does not highlight the keyword or the search term. Making grep highlighting the search term can make the visibility of the keyword more obvious if it hide in between the words.
Read More »

In bash script, it is common to name files with date part of it.
e.g.
system-20080808.zip, mysql-20070707.tar.gz, somelog-20090101.tar.bz2 and etc …
Reason to name it in such a ways is easier to clean up the backup later, using bash script. If you have not notice, when listing of the files and sort it by name, it is automatically sorted by nameĀ then date, which makes it scripting friendly. Here is some examples of how to print date suitable for file name assignment :
Read More »

Previously, we have talk about how to assigh dynamic IP to an interface on Freebsd. This post is about how to assign fixed or static IP to an interface on Freebsd. Below are the steps :
Read More »

After accidentally cat a tar or zip file or left out some pipe and echo the whole file of random string, on to the screen; it can mess up the font of the screen and result in missing of characters or blinking characters or ever the cursor is missing from the screen. No worries, just a 5 character will make your screen back to original display :
Read More »

This is the third post talking about compressed files. This time, we will look into how to search within the compressed file, without decompressing it.
Read More »

One fine day, when restarting PostgreSQL :
/usr/local/etc/rc.d/postgresql restart
it complained that
pg_ctl: invalid data in PID file "/postgres/directory/postmaster.pid"
postmaster.pid was the process ID file for PostgreSQL, which indicate PostgreSQL process. If the file exists, it would mean that PostgreSQL is alive and running. If it doesn’t, it would (of cause) mean PostgreSQL have been terminated, either on purpose or abnormally.
Read More »

This post is similar to the previous one talking about how to view a log file compressed in gnuzip format. Below is the command to view compressed file in bzip2 format instead :
Read More »

The previous tip was about change the banner after login. This tip, however, was to change the banner of the login prompt aka pre-login message.
Read More »