Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, August 3, 2010

How to drop caches in Linux ?

Symptoms:
If the system is eating up lot of RAM eventually making the system slow then try freeing up the cache memory.

Before freeing up the cache, running sync flushes all the file system buffers.
In root, run the following commands:

To free pagecache, inodes and dentries:
root@inferno: echo 3 > /proc/sys/vm/drop_caches

To free only the pagecache,
root@inferno: echo 1 > /proc/sys/vm/drop_caches

To free only the dentries
root@inferno: echo 2 > /proc/sys/vm/drop_caches

Saturday, January 2, 2010

Remove or clear the last login information in Linux

How to clear last login information in Linux?
Login information is stored in /var/log/lastlog
Deleting the contents of the file will remove the login information.
/var/log/lastlog is a binary file so opening it in an editor will show junk.
To read the contents of the file use lastlog

[praneeth@inferno ~]$ lastlog

Root permissions are needed to clear the login information.
Overwriting the /var/log/lastlog file is enough to clear the information.
[root@inferno ~]$ cat > /var/log/lastlog
CTRL+D

Tuesday, October 13, 2009

Aria2 Project- Update

Aria is good. Was able to download 653MB in 2hours 28 minutes.
I have used only one option which specifies the number of threads to be used.

Now should try exploring other options as well.

Aria2 Project- Lightweight multi-protocol download utility

There are many download accelerators available out there for windows (Free Download Manager, Download Accelerator) that help in managing bulky downloads.

Wget, no doubt is one of the most widely used utility. Given the volume of the file for my task, wget is not suitable.

Recently have come across aria2 project. Features:

  • light-weight
  • multi-protocol
  • multi-source
  • can be operated in command-line
  • HTTP/HTTPS, FTP, BitTorrent( :) ) and Metalink.
  • built-in XML-RPC interface. Can be manipulated aria2 via XML-RPC interface.
  • Runs on Linux, FreeBSD, Mac OS X and Windows.
Hmmm.....That's a decent list of features to atleast motivate me for trying it out.
Lemme(aka Let me( expanded for the crawlers :P)) see how useful this turns out to be.

BTW: Previously, I was using aget, a multi-threaded accelerator that supports HTTP downloads. And yippie that helped me in filling my HD with many useful lectures and files but this was limited to only HTTP. :(
Adding to this the server guys have blocked usage of aget. :(

PS: Here is a small list of available informal contractions.
If you are more interested in the linguistic aspects of contractions and their limitations in usage please read this. I love this article by Browning.
Here is another by Radford.

OK, Thats too much a deviation from the topic and lemme stop here. ;)

Wednesday, October 7, 2009

Linux renew ip address - Force DHCP

We were struggling to bring the network up on Ubuntu machine (using DHCP).
We tried using the commands ifdown and ifup but they were unable to bring network up.

The whole problem was with the IP. The client was not releasing the current IP.
The solution is to release the current IP and renew a new one.

Steps:
1. Release the current IP.
2. Obtain a new IP.
3. Restart the network.

Open the terminal and type the following commands

1. Release the current IP
[praneeth@inferno]$ sudo dhclient -r

2. Obtain a new IP
[praneeth@inferno]$ sudo dhclient

3. Restart the network
[praneeth@inferno]$ sudo ifdown eth0
[praneeth@inferno]$ sudo ifdown eth0

OR

[praneeth@inferno]$ sudo ifdown eth0

OR

[praneeth@inferno]$ /etc/init.d/networking restart



That's it , the network should be up and running :)