Monday, January 9, 2012

How to extract a specific file From RPM Without installing:-

By mistake If u have deleted /sbin/poweroff file from system.
How to find the RPM has this /sbin/poweroff

# yum whatprovides /sbin/poweroff

systemd-sysvinit-10-2.fc14.1.
i686 contains /sbin/poweroff in Fedora 14.

Now, if you try to install that package using yum, we will get “Package systemd-sysvinit-10-2.fc14.1.
i686 already installed and latest version”.

To restore /sbin/poweroff, all we need is systemd-sysvinit-10-2.fc14.1.
i686.rpm and rpm2cpio, this is bundled with rpm-x.x.x…i386.rpm.

# rpm -ql rpm | grep rpm2cpio
/usr/bin/rpm2cpio

/usr/lib/rpm/rpm2cpio.sh

/usr/share/man/ja/man8/
rpm2cpio.8.gz

/usr/share/man/ko/man8/
rpm2cpio.8.gz

/usr/share/man/man8/rpm2cpio.
8.gz

/usr/share/man/pl/man8/
rpm2cpio.8.gz

/usr/share/man/ru/man8/
rpm2cpio.8.gz

# rpm2cpio systemd-sysvinit-10-2.fc14.1.
i686.rpm | cpio -idmv

# cp sbin/poweroff /sbin/

Note: There is another way to install systemd-sysvinit-10-2.fc14.1.
i686.rpm by forcefully installing it.

# rpm -ivh systemd-sysvinit-10-2.fc14.1.
i686.rpm –force

How to restore the DELETED Files in Linux

After deleting a file from your computer, it goes straight into the Trash bin. If you want to get that file back then you can get it by restoring it from the Trash bin.

If you want to delete it permanently, delete it from the Trash bin. You can then run the following command to do the trick,

# rm-rf /home/USER/.local/share/Trash/info/*

# rm-rf /home/USER/.local/share/Trash/
files/*

Tuesday, November 22, 2011

Display the current directory as a webpage in Linux

0digg
Do you want to quickly serve a directory to your friends over the web or LAN? There are plenty of applications out there that let you do this, but in Linux all you really need is Python installed.

Do a
python -m SimpleHTTPServer
in the directory you wish to share, then access http://127.0.0.1:8000 in your browser.

Greatly improve the speed of Firefox 3

1. Open Firefox and in the address bar type about:config.
2. Click on “I’ll be careful, I promise
3. Use the search bar above to look for network.http.pipelining and double click on it to set it’s value to True.
4. Create a new boolean value named network.http.pipelining.firstrequest and set that to True, as well.
5. Find network.http.pipelining.maxrequests, double click on it, and change its value to 8.
6. Look for network.http.proxy.pipelining and set it to True.
7. Create two new integers named nglayout.initialpaint.delay and content.notify.interval, set them to 0.
8. Restart your browser.

All done. You should feel the browser is 5x more responsive than before while navigating websites.