Apr 18 2007

“lsof” command

Just found out about this command today.

“lsof” displays information about open files by processes on *nix systems (including network “files” - TCP/UDP). I don’t know how I managed to miss such a useful command over the years.

As an example, listing network ports (which I would previously have done with netstat):

# lsof +c0 -n | grep IP 

java             1022    martinm   28u     IPv6
          467902                 TCP 192.168.2.104:51769->192.168.10.1:xmpp-client (ESTABLISHED)
java             2961    martinm    6u     IPv6
          322274                 TCP *:8083 (LISTEN)
evolution        6408    martinm   59u     IPv6
          472527                 TCP [fffe:111:11:2:111:72ff:fe10:2bd]:51943->[fffe:111:11:1::11]:imaps (ESTABLISHED)
mysql           18407    martinm    3u     IPv4
          489375                 TCP 192.168.2.104:49021->192.168.2.146:mysql (ESTABLISHED)
firefox-bin     24396    martinm   52u     IPv4
          490170                 TCP 192.168.2.104:52906->192.168.0.1:webcache (ESTABLISHED)

I added linebreaks to make it more readable
As usual, further information is available with man lsof.
Now I’ll just need to find out a way of setting the command to be the Java Start Class to identify which java program has the port open.

Update: the number after the command is the PID so a ps -fpXXXX will show the comamnd line.


Apr 12 2007

Braille converter

Recently I had been thinking about various output media (including Braille and Text to Speech) for computer systems.  Today I noticed this story on the BBC about RoboBraille. They’re currently testing an email service that converts text to contracted Braille or MP3 and emails the result back to you.  Seems like a good idea.  (You still need a Braille output device to “read” the resulting Braille.)


Feb 16 2007

Software Development Process

I link this Lisp comic strip


Dec 4 2006

Tip for a forgetful software developer

Lately, when writing JUnit tests I’ve been doing things like:

...
String result = some.method();
assertTrue("Expected " + expected + " but was " + result, result.equals(expected));
...

However, a similar result can be achieved with the semantically more accurate

...
assertEquals(expected, result);
...

This is even easier to type :-)

I did know this, honest!


Dec 1 2006

Software Deployment info

These are some links for me to read, that may be of general use to anyone development Java software using Maven

Java/JAR

Adding Classes to the JAR File’s Classpath

Maven:

[#MPDIST-22] Use <dist.bundle> property of dependencies to include dependencies - jira.codehaus.org


Jul 31 2006

Videos of the talks from RailsConf 2006.

Paul Watson informs that videos of the talks from RailsConf 2006 are available at http://blog.scribestudio.com/pages/rails/