Wednesday, February 23, 2011

Increase download speed with Aria2 utility

Traditional file downloads are done via an FTP client, a Web browser, or a file-sharing program such as BitTorrent. These means of downloading files will probably never change, but the tools to do the downloading, and how they download, will.

One program that changes how files are downloaded is Aria2. Aria2 is a lightweight multiprotocol and multisource download utility that offers some very compelling reasons for its use over traditional “single thread” downloading such as with an FTP or HTTP client.

Being a multiprotocol client, Aria2 can download via HTTP, via FTP, and via BitTorrent. What makes Aria2 unique is that it can download the same file at the same time utilizing different protocols. It can also open multiple connections to the same, or different, URLs to download the file even faster. By default, Aria2 uses five connections to download a file.

To download a file, use: $ aria2c http://somehost.com/file.zip

If the same file is available from two different places, you can maximize your bandwidth and download it from both, even using different protocols:

$aria2c http://somehost.com/file.zip ftp://otherhost.com/pub/file.zip

To compare speeds, I used curl to download a bzip2 compressed ISO image that weighs in at 200MB:

$ time curl -OL ftp://ftp.ibiblio.org:21//pub/linux/distributions/annvix/releases/ISO/annvix-netinstall-x86_64-3.0-RELEASEr2.iso.tar.bz2



What if you are at work when the new release of your favourite Linux distribution becomes available? Instead of using BitTorrent at work which may go against company usage policies, if you are able to SSH to your home system, you can launch Aria2 under screen and begin the download from there. If you want to download a number of files at once, you can have Aria2 download them sequentially or in parallel; to download files in parallel use:

$ aria2c -Z http://somehost.com/file.zip linuxdistro.torrent

Aria2 allows you to specify the maximum upload rate when downloading torrents. This can be done with the “-u” option, such as “-u40K” would only allow an upload speed of 40KB/s. In fact, Aria2 is a full-featured BitTorrent client with a lot of features such as support for seeding files, downloading files with encryption, and DHT (Distributed Hash Table) support. While some might balk at the use of a command-line client to download files, perhaps cringing at the remembrance of old-school FTP clients, Aria2 is easy to use and easy to script.

Tuesday, February 22, 2011

Enable remote logging in Debian/Centos systems

Situation :- we want to log the authentication logs of a CENTOS machine to a remote debian/ubuntu system


1) on the debian/ubuntu system configure syslogd to listen to internet socket udp:514

i) edit the file /etc/default/syslogd so that it contains the line SYSLOGD="-r"



ex:-

celsius@gmladmin:~$ cat /etc/default/syslogd

# Top configuration file for syslogd
# Full documentation of possible arguments are found in the manpage syslogd(8).
# For remote UDP logging use SYSLOGD="-r"

SYSLOGD="-r"

celsius@gmladmin:~$


ii) restart syklogd daemon:- sudo /etc/init.d/sysklogd restart


iii) give the command netstat -nulp on the terminal

your o/p should contain something similar to the following:-
udp 0 0 0.0.0.0:514 0.0.0.0:*

since, celsius@gmladmin:~$ cat /etc/services | grep -i 514 gives
syslog 514/udp




2) CENTOS SIDE:-

i) edit the /etc/syslog.conf file to have something similar to the following entry

auth,authpriv.* @192.168.0.17

ii) restart syslog service (i.e service syslog restart)

iii) edit the file /etc/sysconfig/syslog file to have the following entry
SYSLOGD_OPTIONS = "-m 0 -r"


iv) restart syslog service (i.e service syslog restart)

v) give the command netstat -nulp on the terminal

your o/p should contain something similar to the following:-
udp 0 0 0.0.0.0:514 0.0.0.0:*



3) now if the centos machine is called "alpha" and debian/ubuntu system is called "gmladmin"

The command celsius@gmladmin:~$ cat /var/log/auth.log | grep -i alpha will give the output as follows:-






NB:- tested on ubuntu 10.04 & centos 5.5
See:- http://aarklonlinuxinfo.blogspot.com/2009/01/syslogd-and-syslogconf.html

Thursday, February 10, 2011

How to install X11 Mouse Themes?

1.Download themes fromes gnome-look.org , Unzip the file and move the folder to ~/.icons/
2. open the gconf editor (type alt+ f2 then type gconf-editor , press enter)
3. change the key
/desktop/gnome/peripherals/mouse/cursor_theme
to the appropriate one
4. log off


NB:- tested in ubuntu 10.04

Wednesday, February 9, 2011

Setting up FTP server

1) sudo apt-get install vsftpd


2) Edit vsftpd configuration file

sudo gedit /etc/vsftpd.conf


anonymous enable = no

#file upload capability
write_enable = YES

#configuring FTP greeting banner
ftpd_banner = "welcome to my ftp server"

#allowing local user to login
local_enable = YES

3) Restart FTP daemon:-
sudo service vsftpd restart


4) check if your ftp server is working:-

ftp localhost



NB:-

1) if you enable user authentication each user will be able to FTP into their home directory in addition to anonymous access

2) you can't download if you dont have write privileges in the directory in which you start FTP

3) Tested in ubuntu 10.04