Below is a script I wrote so that I can download ISO’s using wget at the university. Just using wget from my machine fails because the proxy has issues with files over a certain size (I think? anyone confirm this too?). I would usually just download them using the browser… but wget is far more reliable… plus you can pause and resume downloads, and it actually *works*!
Ok, the script wgetremote:
#!/bin/bash # Download file on remote host # and then copy file to machine and delete file from remote host # means you can download larger files more easily (e.g. ISO's) # Requirements: ssh, scp, basename, sed if [ $# != 3 ] then # No Arguments Passed echo -e "error: incorrect arguments given\nusage: wgetremote [user@remotehost] [URL] [destination]" else # Main location=$1 url=$2 dest=`echo $3 | sed 's/\/$//'` # remove last / fn=`basename $2` # Download,copy and rm ssh $location "wget $2" scp $location:$fn $dest ssh $location "rm $fn" echo "Saved file: $dest/$fn" fi
Also too, if you have a scripts dir in home then add it to the path in Ubuntu by adding this to .bashrc (yes I know it shouldn’t really go here… but adding this to .profile wasn’t working in Ubuntu for some odd reason):
# add scripts dir if exists
if [ -d "$HOME/scripts" ] ; then
PATH="$HOME/scripts:$PATH"
fi
Also, anyone know a nice way to access ext2/3 partitions in Windows? I can access Windows files in Ubuntu (since i’m using wubi there just in /host) but I’d like to access my Linux files in Windows. Or maybe i’ll just write a folder sync script and run it at logout. If anyone knows feel free to leave me a comment! Alex.