What is listening on your system -- Linux Tip #3

written by edavis on March 13th, 2006 @ 05:19 PM

Netstat is used to find out about network connections on a unix box. If you pass in -lintp you will get a listing of what processes are in a listening state on your machine and what interfaces they are listening on.

# netstat -luntp 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN     9050/dovecot
tcp        0      0 0.0.0.0:2500            0.0.0.0:*               LISTEN     15065/ruby1.8
tcp        0      0 0.0.0.0:37              0.0.0.0:*               LISTEN     943/inetd
tcp        0      0 0.0.0.0:9               0.0.0.0:*               LISTEN     943/inetd
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     9702/mysqld
tcp        0      0 0.0.0.0:13              0.0.0.0:*               LISTEN     943/inetd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     15046/lighttpd
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN     1689/perl
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     9330/master
udp        0      0 0.0.0.0:9               0.0.0.0:*                          943/inetd
udp        0      0 0.0.0.0:10000           0.0.0.0:*                          1689/perl

Hm looks like I need to turn inetd off, as I don’t use it. See how useful this command can be.

Eric Davis

Postfix and AMaVisD-new -- Hacking Journal [2006/03/13]

written by edavis on March 13th, 2006 @ 05:17 PM

I wore my sysadmin fire hat today, taking a new email server live at work. I was able to replace a Postfix/procmail/POP3 server with a Postfix/AMaVisD proxy. It turned out pretty well, as I was able to fully migrate to it with 0 downtime by using a backup MX record. The proxy was setup pretty much along the lines on this Anti-Spam Wiki except for I used the Debian version of the instructions.

AMaVisD turned out to be a great program once it was installed. I was able to setup Spamassassin and ClamAV right off the bat, which gave me more time to work on customizing my rulesets for our company. All in all, a pretty good day.

Eric Davis

Linux - The Developer's Best Friend -- Hacking Journal [2006/03/09]

written by edavis on March 9th, 2006 @ 03:06 PM

Been awhile since I have been able to sit down and write much. I now have my Ubuntu Linux desktop up and running, so I am now looking to start to hack on some actual desktop apps soon. While web applications are fun, I spend most of my time working on them at work so I need some kind of escape while at home. I am going to be looking into the Ruby Gnome project and see if I can write some basic Gnome/GTK applications.

Also now that I am off the Mac Mini, I am giving Emacs another look. I gave up on it earlier because the META key would not map correctly which caused a lot of mistakes. So I now now enough of vi(m) so if I had to edit something with it, I would be able to manage.

Eric Davis

Need to find a process? -- Linux Tip #2

written by edavis on March 9th, 2006 @ 02:46 PM

If you are ever wanting to quickly find a process on your system

ps aux | grep 'process-name'

will output some information for you about all the processes named ‘process-name’

Example:

eric@raptor:~$ ps aux | grep 'gaim'
eric     16112  0.1  2.4  50484 38652 ?        S    Mar04  10:04 gaim

where 16112 is the Process ID, 0.1 is the CPU%, 2.4 is the MEM%, etc.

See also man 1 ps

Eric Davis

Want an email reminder? -- Linux Tip #1

written by edavis on March 7th, 2006 @ 03:18 PM

If you want to be reminded of something you have to do at a certain time, use the at command

at 11am
at> mail me -s "Time to leave" -m "Meeting in the office"

This will send ‘me’ and email at 11am to remind me about the meeting.

at 7am
at> xmessage "You have a meeting on `date +%m/%d/%Y`"

This will pop up a simple X-Window box with the message “You have a meeting on 03/07/2006” (if it is the 6th of March of course). The man page for at gives you some more options to setup this simple utility.

Eric Davis