7 ms·
Two more that come to my mind ... 1. Comparing local and remote files $ ssh user@123.4.5.6 "cat /tmp/remotefile" | diff - /tmp/localfile 2. Outputting your m
by p3ll0n 16y ago
Two more that come to my mind ...
1. Comparing local and remote files
$ ssh user@123.4.5.6 "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
- dododo 16y agohah! the dsp trick actually works surprisingly well IF you combine it with lame (iirc).
- p3ll0n 16y agoyeah the quality is going to be terrible and your going to hear a lot hissing but it will work!
- jackolas 16y agomight want to try esd instead. When I was looking to try networking sound for a thin client thats the closest I got.
- gcr 16y agoPulseaudio is perfect for this nowadays. A bit more modern than esd, I'd say.
- pavel_lishin 16y agoBack 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. :)
- deleted 16y ago[deleted]
- koenigdavidmj 16y agodiff <(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.)
- mjschultz 16y agoAlong the same lines as number 1. You can transfer a directory with $ ssh user@host "tar cvzf - /path" | tar xvzf - /path
- mhd 16y agoSsh 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.
- ralph 16y agossh(1) only compresses if configured too, see the -C option.
- dedward 16y agoThis 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.
- daten 16y agoYou can also just transfer it with: $ scp -r user@host:/path /path
- mjschultz 16y agoI 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.
- pornel 16y agoUse rsync then. It can copy symlinks and even recreate hardlinks.