Live data from Hacker News

Cool stuff you can do with netcat

en.wikipedia.org

41–44 of 44 posts

Re: Cool stuff you can do with netcat

#41
If you add the live_console gem to a rails app, you can use netcat to run IRB against the live application. You can change the app's state from a console, like flushing a cache or even making a patch, without having to restart the app.

Re: Cool stuff you can do with netcat

#42
post #36

Earlier quoted context omitted.

1. Schlepping files between computers. computer A: nc -l $ARBITRARY_PORT | tar vzxf - computer B: tar vzcf - files_or_directories | nc computer_a $ARBITRARY_PORT 2. Testing socket servers: cat canned_request | nc server 80 There are probably other things, but I don't think, "Oh, this is a good use for netcat", I just do it. It's almost as handy as awk.

> Schlepping files between computers. What about using rsync instead ?

nc is simple and I know its syntax. rsync is more powerful, but I need to look up its options half the time.

Re: Cool stuff you can do with netcat

#43
post #36

Earlier quoted context omitted.

> Schlepping files between computers. What about using rsync instead ?

nc is simple and I know its syntax. rsync is more powerful, but I need to look up its options half the time.

"rsync source host:destination" just works, no need for options :)

Re: Cool stuff you can do with netcat

#44

Earlier quoted context omitted.

At $EMPLOYER, I have a script that takes a description of the network topology, converts it to a sequence of Host stanzas and writes them to ~/.ssh/config. The source file is simple enough that the sysad team can keep it up-to-date when they change the network configuration, and most people just have to run the 'update' script occasionally to have Super SSH Powers. It's quite popular.

Don't suppose you'd be willing to post this uber-script somewhere?

Unfortunately it's not really self-contained enough to post; the most complicated thing in it is basically a copy/paste of the "Dijkstra's Algorithm" sample-code on Wikipedia, though.
Post reply on HN