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-Nov-24: Exciting news! mintty is now the default cygwin shell.

…mintty has become part of the default installation, setup will
create desktop and start menu shortcuts called “Cygwin Terminal”, which
point to mintty, starting your default shell as noted in /etc/passwd.

Let’s face it, cygwin is neat but the console (or, terminal emulator, if you prefer) it launches is lame. I’m not referring to bash, but rather the normal — and thus lame — Windows command box. Things just don’t feel right… some keys don’t work as expected and forget about making the window wider. Fortunately, there is a better way!

Rather, I should say there are better ways: puttycygConsole2, and my personal favorite, mintty.

puttycyg is a patched version of putty with support for cygwin. mintty is … well, yeah, it’s based on putty, too.

If you use cygwin, you owe it to yourself to try one or all of them immediately. And by that I mean stop reading and start downloading. Now.

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