Nice hint and tips for using wget
on Friday, February 20th, 2009 at 12:28 amI think most of us have used the wget command once or twice.
What i will do now is explain a few tips and tricks on using this useful command.
1. Download many files at the same time
2. Download and resume
3. Limit your download to a specific speed
4. Split your download for faster results
5. Log your download
6. Download in the background and keep using the terminal
Common use of wget:
1. Download many files at the same time
There is more then one way to do this, my favourite one is to create a .txt file using the vi command and write in it the URLs of the files you want to download
write in it
http://example.com/bleh.tar
http://example.com/tfeh.tar
http://example.com/blah.tar
http://example.com/stuff.tar
Then run wget using the -i argument
2. Download and resume
You can force wget to resume any broken download like this
3. Limit your download to a specific speed
You can use this when downloading a big file and you don’t want the connection to choke
4. Split your download for faster results
Just like free download manager or download accelerator on windows ![]()
To do this we will have to use awget instead of wget
Note that i could not find aget in the repos. However you can download a .deb package from http://www.enderunix.org/aget/
5. Log your download
Log all your downloads into a file
6. Download in the background and keep using the terminal
Note that doing the above will automatically create a log file for the download process
To specify your own log file location do the following
Hope this helps ![]()
// Jo
Changing the welcome message in SSH
on Thursday, December 18th, 2008 at 1:57 pmIf your a linux user or maybe a simple linux server administrator with some servers at hand, the chances are that you use SSH to login there and manage them.
When a user logs in to SSH usually he sees a welcome message.
If you have an ubuntu machine like me then you will see the following message
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
In order to change this message just type in the terminal

Update:
Note: On restart your changes to /etc/motd will be reverted, the reason is that /etc/motd is a symbolic link to /var/run/motd which is rebuilt by /etc/init.d/bootmisc.sh from a template, /etc/motd.tail, at each reboot. (thank you Adam Trickett).
lrwxrwxrwx 1 root root 13 2008-11-27 14:18 motd -> /var/run/motd
jo@jo-desktop:/etc$
This means that to make your changes permanent you can either:
1. change
then reboot
2. point the /etc/motd symlink to a different file such as /etc/motd.static and make your changes there. (Also thank you Adam Trickett).
Joe
Preventing hotlinking to your website using .htaccess
on Tuesday, November 25th, 2008 at 3:32 pmWhat is hotlinking?
Also known as “bandwidth stealing” by the angry site owner, it refers to linking directly to non-html objects not on one own’s server, such as images, .js files etc. The victim’s server in this case is robbed of bandwidth (and in turn money) as the violator enjoys showing content without having to pay for its deliverance. The most common practice of hot linking pertains to another site’s images.
So how to prevent someone from hotlinking to your website?
How to give them maybe a “nasty” surprise when their hotlinks become so pervasive as to have a significant effect on your bandwidth usage ?
An easy solution is to write this piece of code into your .htaccess file.
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ http://www.mydomain.com/somelink.ext [R,L]
Of course dont forget to replace
1. “mydomain.com” by your domain name
2. gif|jpg by your desired of file extension you wish to block from referrers (ex: gif|jpg|css|js)
3. http://www.mydomain.com/somelink.ext by the page you wish to redirect to when someone is trying to access (2)
Hope it helps
// Jo
Problems with sound and video on ubuntu ?
on Saturday, May 31st, 2008 at 1:05 pmHowdy,
I am writing this post because so many people are asking me about it.
I will not invent anything new here, i will just make a general tutorial that will fix 80% of your audio/video problems.
Please understand that i do not guarantee 100% success result, because it all depends on the hardware you have.
Before digging in complicated stuff, lets first try to install the Medibuntu packages.
Some of these packages include the libdvdcss package from VideoLAN and the external binary codecs package (commonly known as w32codecs) used by MPlayer and xine.
Step 1:
Add Medibuntu to your system’s list of APT repositories.
For ubuntu 7.10
For ubuntu 8.04
Now add the GPG Key:
Step 2:
Install the libdvdcss2 package.
This package is used to play encrypted DVDs, more information about it here
Step 3:
Installing Non-Native Media Formats.
These media formats includes but are not limited to: wmv, mp3, .mov, .rm etc…
For i386 (use this if you are not sure)
For amd64
For ppc
This is it, restart your PC now and try to play some music. If you still cannot hear the beat continue reading this post.
mmm… I see you are still having problems ? Lets try to do more complicated stuff.
What we will do now is recompile the alsa drivers
When you compile stuff from source apt don’t know about them, so it wont keep track of it.
Step 1:
Lets download them first.
We need to get: alsa-driver, alsa-lib and alsa-utils.
You can download the latest releases from here:
- alsa-driver: ftp://ftp.alsa-project.org/pub/driver/
- alsa-lib: ftp://ftp.alsa-project.org/pub/lib/
- alsa-utils: ftp://ftp.alsa-project.org/pub/utils/
Step 2:
Untar these packages.
You can untar them using GNOME or by typing this line of code in terminal
Note: dont forget to replace xxx by your version number.
Step 3:
To configure/install alsa utilities we need the following package.
Step 4:
Installing alsa
In the alsa drivers folder type:
In the alsa Lib folder type:
In the alsa utilites folder type:
Restart your PC and cross your fingers
Hope I helped you in a way.
// Jo