Wednesday, September 30, 2009
Upcoming Ubuntu Karmic has 32 bit PAE kernel
What it means to Ubuntu users is (I am excited) it will support more than 4 GB of RAM in 32 bit
Default generic kernel supports only upto 4 GB in theory, but in reality can allow only upto 3.2 GB RAM
The below link is where I saw about the pae kernel, you can also see by clicking below (this does not mean much, unless for owners of 4 GB RAM system or above and wants a 32 bit system)
http://packages.ubuntu.com/karmic/linux-image-2.6.31-11-generic-pae
Monday, September 28, 2009
Clearing cache memory in linux using sysctl
sudo sync && sudo sysctl -w vm.drop_caches=3 && sudo sysctl -w vm.drop_caches=0
The above line is a combination of three commands
1. sync --> to ensure any pending cache is flushed onto disk
2. sysctl -w vm.drop_caches = 3 --> to clear all caches (pagecache and inode/dentry caches)
3. sysctl -w vm.drop_caches = 0 --> reset the drop_caches to no clearing
The above command clears all caches from RAM. Beware, this clearing cache works in Ubuntu fine, but in other distributions maynot work fine
Screenshot showing free RAM before clearing cache |
Screenshot showing free RAM after clearing cache |
Ensuring data is written to pen drives in linux
Data is not written to usb pen drive immediately as it resides in main memory. If we remove the pen drive the data may not be there or only some part of data may be there which is called corrupted data.
If we try to unmount by right clicking the icon, we might get a dialog or a notification that data is being written and another prompt after the data is being written to indicate it is safe to remove the pen drive.
But it will be ugly to unmount and mount just to ensure data is written. Instead we can do it using commandline as follows.
sync
After typing this command in terminal, we need to wait for the command to complete. This will ensure any buffer in memory is actually flushed or synced to external devices like pendrives.
Saturday, September 26, 2009
Google Chrome the fastest 64 bit browser in Ubuntu Jaunty
Friday, September 25, 2009
Using Windows key in Ubuntu
Wednesday, September 23, 2009
Using fast concurrent command line download manager in Ubuntu
aria2 is a very powerful command line download manager. I use aria2 to download linux iso's. Here is an example how I used aria2 in Ubuntu to download Ubuntu Netbook Remix. |
Step 1: Installing aria2 in Ubuntu Jaunty |
This is very simple. |
sudo apt-get install aria2
|
Step 2: Identify mirrorlist URL for the download |
We need to identify mirrors all across the world, hosting our favorite download. For example, Ubuntu Netbook Remix is hosted in different servers all across the world. The mirrors URL gives us easy access of all such servers hosting Ubuntu http://www.ubuntu.com/getubuntu/downloadmirrors#mirrors |
This needn't be Ubuntu iso, it can be any file which is mirrored/hosted in different servers across the world. This step just shows a URL which lists all such mirror servers hosting same version of file, here in this example Ubuntu Jaunty |
Step 3: Pick 5 reliable nearby servers from the mirrorlist |
In this step, we need to choose from the mirrorlist around 5 reliable servers. The five servers should be different from one another In this example, say I pick Japan, Finland, German, UK and Belgium servers |
Step 4: Copy the download URL of the file we wish to download from each of the picked servers and note it |
Here the URL we choose should be the complete download URL including the file name we intend to download. For example, if I wanted to download Ubuntu Netbook Remix from the servers I chose in previous step (Japan, Finland, German, UK and Belgium), I need to note down the full path of the file I am downloading from each server. Let us say I noted down as follows in some editor
|
Step 5: Create a text file and store the 5 URL separated by tab |
In this step, we need to open gedit or nano or vi editor and paste all the URL's we noted down each separated from one another by a tab For example, in this case, I gave gedit urls.txt from command line and pasted the noted down URL's separated by tabs. It is very important that each URL should be separated from another by a tab and not a space Example http://ftp.riken.jp/Linux/ubuntu-cdimage/9.04/ubuntu-9.04-netbook-remix-i386.img http://www.nic.funet.fi/pub/mirrors/releases.ubuntu.com/9.04/ubuntu-9.04-netbook-remix-i386.img http://ftp.uni-kl.de/pub/linux/ubuntu.iso/9.04/ubuntu-9.04-netbook-remix-i386.img http://mirror.ox.ac.uk/sites/releases.ubuntu.com/releases/9.04/ubuntu-9.04-netbook-remix-i386.img http://ubuntu.mirrors.skynet.be/pub/ubuntu.com/releases/9.04/ubuntu-9.04-netbook-remix-i386.img |
Save it and close the editor |
Step 6: Start downloading using aria2 from command line |
This is our final step. After saving the tab separated list of URL's in a text file, we need to pass that file as input to aria2
Open terminal (Key in Alt + F2 and type gnome-terminal in the text box to launch terminal) Change to the directory where the tab separated URL file is saved. Let us say I saved urls.txt in Downloads folder then I type the following to change directory cd ~/Downloads Then use aria2c as follows to start downloading aria2c -m0 -iurls.txt -c |
Well that is it, do not close the terminal till the download completes. aria2c allocates the total size of the download first, then hits all the fully qualified URL's from the input file.
aria2c --> is the commandline aria2 download manager -c --> this option asks aria2c to continue the download from where it left the download last time, we closed without completing download -i --> the file which is passed next to -i should contain tab separated list of URL's from different mirrors. The default count of URL's expected by aria2c is 5 and aria2c opens 5 concurrent connections and hits each different server from different thread. If a server fails, that is peacefully ignored by aria2c. The concurrency count can be increased. Each conncurrent connection tries to fetch a segment of the big file from the serverlist thus reducing the bandwidth on server. It is like honeybee collecting nectar from 10 different flowers not stressing any of the flowers -m --> tells how many times aria2c should retry failed connection, 0 means unlimited There are other interesting params, which can be read from man aria2c |
aria2c will utilize n concurrent threads and download the split segment of big file from n different URL's we gave inside the file. This way let us say I have a 2 Mbps download connection, aria2c will utilize 51 Kbps in each 5 concurrent thread equally and thus utilizing max download bandwidth totally. Hope this helps, my next idea is to develop a QT based s/w for using aria2c from GUI. Maybe if I get it ready, I may publish that |
Thanks for reading |
Tuesday, September 22, 2009
Scanning for viruses, rootkits in Ubuntu Jaunty
A month back, I used a pen drive from a friend and came to know it had some windows viruses in it the next day. I laughed at my friend that it did not affect me nor did I see any virus. Anyhow, I got scared and wanted to make sure my Ubuntu had never any virus in it.
I did three things to absolutely make sure no viruses are there in Ubuntu
Step 1: Installing clamav antivius
Here is how
I installed clamav antivirus and scanned for antiviruses (Sure, My Ubuntu did not have any viruses!!)
sudo apt-get install clamav
Step 2: Scanning for rootkits
There may be some rootkits sitting in kernel, which can be checked using chkrootkit |
To install chkrootkit |
sudo apt-get install chkrootkit |
Scanning for rootkits |
sudo chkrootkit |
Step 3: Enable ufw
Hope, this may help somebody to make absolutely sure (a security paranoid?) their Ubuntu is free of rootkits or viruses |
Also may help some Ubuntu/Windows dual boot users to scan for viruses in their Windows partitions from Ubuntu using clamscan -r after mounting Windows partition which is just a click in Ubuntu! |
Sunday, September 20, 2009
Fedora 11 rocks with KDE 4.3.1
Then to get wireless working I installed kmod-wl from rpmfusion. After rebooting I was surprised to see 2.6.30 kernel which is very new and I got wireless.
I wanted to try KDE 4.2 under Fedora 11 so installed KDE instead of gnome in fedora 11. I installed all updates overnight and came next morning to be pleasantly surprised to see KDE 4.3.1. Wow
Some screenshots below
I am enjoying KDE 4.3.1 in Fedora 11. Fedora 11 has latest KDE 4.3.1 , Firefox 3.5.1. Also openoffice is 3.1. Fedora 11 is very snappy than Ubuntu Jaunty in this netbook. I am thinking of going with Fedora 11 in my core i7 desktop (I am very lazy to reinstall/remove Ubuntu from it)
I had enabled presto (delta updates) by installing presto plugin
sudo yum install yum-presto
Fedora 11 did the update around 1GB very fast as it used presto (delta updates) It updated only around 500 MB instead of 1 GB. And the reason for fedora snappiness may be due to its i586 architecture instead of i386. Also after upgrading default swappiness in Fedora 11 has been modified to 40 from 60!!
Commmand to know swappiness of system
sudo sysctl -q vm.swappiness
Only glitch I faced is while playing videos/audios in VLC as it had a buggy pulse audio implementation. Just for VLC sake, I disabled pulseaudio and everything works fine. To disable pulseaudio I removed alsa-plugins-pulseaudio package
suspend/resume works great on this netbook with Fedora 11
Fedora 11 rocks