Extract Lines From a Text File

“sed -n 2,4p file_name”

extracts lines from 2 to 4 from that file

Tagged , | Leave a comment

How to compress using bzip2 without deleting the original file

bzip2 deletes the original file and replaces it by the compressed one, and to stop it from doing that use the “-k” option as follows:

“bzip2 -k file_name

Tagged | Leave a comment

XFCE 4.6, an amazingly fast – yet good-looking – Desktop Environment For Linux

I was always using GNOME as my default Desktop Environment in Ubuntu (which comes by default), and I have tried many others such as KDE, XFCE …etc), and I always admired GNOME the most as it has a good balance between performance and nice GUI; I found KDE to be too fancy and with slightly less performance and XFCE to be amazingly fast, but not really good-looking, and YES! I like my desktop to be good-looking, I guess anyone who lives for 16 hours daily in a room will make it as much beautiful as he/she can :).

With XFCE 4.6 (which comes by default in Xubuntu Jaunty), I found a much nicer GUI than old XFCE releases and still the same performance boost, I guess you gotta try it out.

Tagged , | Leave a comment

Fix Slow Intel Graphics Problem in Ubuntu Jaunty

Guys with intel graphics cards might experience very slow graphics with their Ubuntu Jaunty installation and this was really annoying, I like to perfect my desktop! Although I don’t use Compiz or play a lot of games! This is an Intel graphics driver problem that is solved in the 2.6.30 kernel.

The following steps fixed my graphics 100% and I have experienced the best Graphics Performance I’ve ever seen using any Intel card, I guess you don’t have to worry about any damage to your machine as you can always revert to your previous kernel once you experience any problems with the new one:

  1. Download the following files:
    1. http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30/linux-image-2.6.30-020630-generic_2.6.30-020630_i386.deb
    2. http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30/linux-headers-2.6.30-020630_2.6.30-020630_all.deb
    3. http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30/linux-headers-2.6.30-020630-generic_2.6.30-020630_i386.deb
  2. Install them. If you don’t know how to do that, then just create a folder and put them all in there, open a terminal and navigate to that folder and then run “sudo dpkg -i *.deb”
  3. Reboot the machine

Now check how things are going :); play a game, watch a movie, do anything you want to do!

Note: A problem that I faced is that the “linux-restricted-modules***” deb package which comes with every Kernel package developed in Ubuntu is not available! This package contains some drivers that you might need. For example, I was using “ndiswrapper” and/or “madwifi” drivers for my Atheros Wireless card and they both are not available (yet) after doing the above, but I found a much better driver (ath5k) that was much faster and even the wireless LED finally worked:

  1. Download and extract the following file: http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.30/compat-wireless-2.6.30.tar.bz2
  2. open a terminal and navigate to its folder
  3. run “make”, note that this will take some time
  4. run “sudo make install”
  5. After finishing, just run “sudo make load” and if it doesn’t work you can simply reboot your machine

Note also that this method is not the official one and that it might cause your machine to hang, but anyway “No pain, No gain” 🙂

Tagged , , | Leave a comment

Disable the annoying PC speaker in Ubuntu

Temporarily (doesn’t require a restart):

sudo modprobe -r pcspkr

Permanent (requires restart):

sudo your_favorite_text_editor /etc/modprobe.d/blacklist.conf   #text editor can be anything from “vi” to “gedit”, whatever you want!

Add this line to the end of the file: “blacklist pcspkr”
Reboot!

Tagged , , | Leave a comment