Here’s a useful one-liner for running a generic socket server. I came up with this socat-based alternative to writing my own for testing client output. It listens on port 4096, accepts TCP/IP connections, and prints input received to stdout.

socat TCP-L:4096,fork -

Socat is quite powerful, be sure to read more about what it can do.

2011-July-08: My coworker has a great post showing how socat can pipe data from a serial port to a socket!

 

At least once a week, I find myself wishing I could sort two files and compare them in one shot, from the commandline, without creating intermediate files. Today I’m glad to say I found my answer.

Here are two examples:

diff -y <(sort file1) <(sort file2)
comm -3 <(sort file1) <(sort file2)

See this wikipedia entry for a comparison of the diff and comm commands.

© 2011 And now here's something… Suffusion theme by Sayontan Sinha