Posts Tagged ‘command line’
Still moving stuff around… rsync
Saturday, April 2nd, 2011Hmm… I get the feeling that I spend a lot of time moving stuff around…
In a previous post I talked about creating a load of image thumbnails by running a custom script. Each time you added a new image to the directory, it would be necessary to run the script again.
Suppose that the images and thumbnails are being kept on a remote server – transferring the images from your local machine to the remote machine using scp might be one way you could do it, but if what you really want to do is have your remote folder in sync with your local folder, then it rsync is probably the tool you’re after.
1 | rsync -rv local_image_folder/ you@your_remote_server:~/path/to/remote/image_folder |
now you only have to worry about keeping your local folder in order, and your remote one will be happypants.
Moving stuff around…
Sunday, March 27th, 2011So a long while ago, I bought a Chumby. Interesting little device, for a while at least – its primary function right now is that of an alarm-clock/mp3 player.
When I’m going to sleep, I usually need something to listen to. The Chumby has a usb socket in the back which allows you to stick a thumb-drive in there and play mp3s off it. As much as I love the portability of thumbdrives, sometimes you just want to be lazy efficient and sit on the couch transferring the relevant mp3s from your laptop to the chumby.
1 | scp some_audio_file.mp3 root@DuncChumby:/mnt/usb |
Moving stuff between laptops
Saturday, March 5th, 2011I bought a new macbook pro recently and almost immediately installed Ubuntu 10.10 on it. Was then left with the issue of moving over my fairly small, but partially substantive mp3 collection… turned out to be fairly simple!
on the source machine, in the appropriate directory:
1 | python -m SimpleHTTPServer |
and then on the destination machine:
1 | wget -r veronica:8000 |
Adventures on the command line
Saturday, December 4th, 2010It seems as if every other day or so, I discover an easy way to do something that once would’ve been very annoying.
Needed to copy all the music off my phone into my music directory. The directory structure on my phone was Album_name/music_file – I didn’t really want that.
This command finds all the mp3s in/below the current folder and copies them to ~/Music.
1 | find . -name *.mp3 -exec cp {} ~/Music/ ';' |
Seeing as this was all done over USB on a bit of an old phone, it was (is – it’s still going.) hugely slow.
This allows me to see how many mp3s are in the Music directory – so I can more-or-less keep track of progress.
1 | watch "ls -la ~/Music | grep mp3 | wc -l" |
fun times.