News for hackers. Stuff that matters.
Re:Useful things you can make SSH do by p3ll0n on Wednesday July 21, 2010 @03:09PM (#1536189)
Two more that come to my mind ...

1. Comparing local and remote files

$ ssh [email protected] "cat /tmp/remotefile" | diff - /tmp/localfile

2. Outputting your microphone to a remote computer's speaker

dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp

Re:Useful things you can make SSH do by koenigdavidmj on Wednesday July 21, 2010 @03:21PM (#1536227)

    diff <(ssh user@host cat remote-filename) local-filename
is a bit more intuitive too. You can put anything that writes to stdout in the <(), too. (Useful for decrypting or decompressing on the fly.)
Re:Useful things you can make SSH do by mjschultz on Wednesday July 21, 2010 @03:27PM (#1536251)
Along the same lines as number 1. You can transfer a directory with

  $ ssh user@host "tar cvzf - /path" | tar xvzf - /path
Re:Useful things you can make SSH do by dedward on Wednesday July 21, 2010 @06:07PM (#1536704)
This is especially useful when dealing with directories with too many files in them - say around a million files. Regular globbing won't work, and most regular tools won't work - but tar works great.

Also - another trick is to give it -c blowfish to use a lighter/faster cipher for the transfer to save on CPU time.

Re:Useful things you can make SSH do by mhd on Wednesday July 21, 2010 @04:15PM (#1536406)
Ssh already compresses, so you can drop the z. And generally cpio does a better job preserving the file system structure (hard links, time stamps). And it tends to be a bit more cross-platform, if you don't have GNU tar on both ends.
Re:Useful things you can make SSH do by ralph on Saturday July 24, 2010 @01:57PM (#1544084)
ssh(1) only compresses if configured too, see the -C option.
Re:Useful things you can make SSH do by daten on Wednesday July 21, 2010 @06:14PM (#1536734)
You can also just transfer it with:

$ scp -r user@host:/path /path

Re:Useful things you can make SSH do by mjschultz on Wednesday July 21, 2010 @06:22PM (#1536755)
I usually do use scp, but it becomes problematic when there are symlinks hanging around. scp just follows them and ends up copying the same file many times.

This is especially bad if you have a directory structure that references a higher-level directory.

Re:Useful things you can make SSH do by pornel on Wednesday July 21, 2010 @07:10PM (#1536841)
Use rsync then. It can copy symlinks and even recreate hardlinks.
Re:Useful things you can make SSH do by jerf on Thursday July 22, 2010 @11:42AM (#1538447)
In my experience, using rsync to do just a raw copy is not faster than the ssh+tar approach. rsync wants to poke around and optimize, and that's incredibly awesome, except when there is absolutely no chance of optimizing at all, in which case it's just dead weight. I don't know of anything that can beat ssh+tar (possibly with the encryption tuned cheaper, as mentioned above); it especially blows raw scp out of the water for lots of small files.
Re:Useful things you can make SSH do by biafra on Sunday August 22, 2010 @05:38PM (#1625329)
scp is a lot slower than the tar-pipe with many small files.
Re:Useful things you can make SSH do by dododo on Wednesday July 21, 2010 @03:13PM (#1536203)
hah! the dsp trick actually works surprisingly well IF you combine it with lame (iirc).
Re:Useful things you can make SSH do by p3ll0n on Wednesday July 21, 2010 @03:22PM (#1536232)
yeah the quality is going to be terrible and your going to hear a lot hissing but it will work!
Re:Useful things you can make SSH do by pavel_lishin on Thursday July 22, 2010 @01:32AM (#1537439)
Back in college we did something similar, but much less technologically advanced, to a roommate's linux box that he hooked up to speakers.

We found a lot of fun sounds to blast at him while he slept. :)

Re:Useful things you can make SSH do by jackolas on Wednesday July 21, 2010 @06:39PM (#1536789)
might want to try esd instead. When I was looking to try networking sound for a thin client thats the closest I got.
Re:Useful things you can make SSH do by gcr on Thursday July 22, 2010 @01:50PM (#1538946)
Pulseaudio is perfect for this nowadays. A bit more modern than esd, I'd say.