FreeUnix.Dyndns.Org Sat, 21 November 2009 - 10:44:04 CET
Home ·  AcpiTool ·  Howto ? ·  Links ·  Hardware ·  FTP Archive ·  Search ·  Contact ·  About
>  Various questions, tricks & tips   <
Index
How to enable the numeric keypad when starting X ?
On most Linux systems, the numeric keypad is not activated when the XWindows environment is started. On a laptop, this is usullay desired behaviour, but on a regular keyboard, it's kind of annoying that you have to push the NumLock key yourself.
However, a little tool called numlockx solves this minor problem. Just install it and start it along with X by calling it from .xinitrc. Adding "numlockx on" to .xinitrc will do the job. Grab the source here.
How to upgrade a Linux kernel with a full or incremental patch ?
Instead of downloading entire kernel sources, taking up more than 20MB these days, and thus waisting a lot of bandwith and time if you're stuck with a low bandwith connection, it's far more interesting to upgrade your Linux kernel by applying patches.
Patches are simply the difference between 2 kernel sources and are much smaller. Hence, they take significantly less time to download. There are 2 kinds of patches :

  - full patch : full diff between previous kernel and current kernel or patchlevel

  - incremental patch : diff between current and previous patch

So, if you want to apply an incremental patch, you must be sure you applied all previous incremental patches (if any) or the last previous full patch for this kernel first !
Once you downloaded your patch, unzip it and copy it to /usr/src/linux or whatever directory holds your kernel tree. Then apply the patch with following command :
[root@stargate /usr/src/linux]$ patch -p1 <patch-x.y.zz 
You will see all patched files scroll over your terminal. If the patch could not be applied, there will be .rej files. In general, this should only happen when you altered the files yourself or tried to apply a wrong patch. If all went well, you can go on compiling and installing your new kernel.
How do I unpack these tar.gz or tar.bz2 files ?
tar.gz   :
tar zxvf this_is_a.tar.gz
tar.bz2 :
tar yxvf this_is_a.tar.bz2
or
tar jxvf this_is_a.tar.bz2 
You can safely omit the v, it's only there to show the files scrolling over your screen while the archive is untarred. To handle .bz2 archives, you must have bzip2 installed. However, on a regular Linux or BSD-box, it is installed by default nowadays.
How do I create tar.gz or tar.bz2 files ?
tar.gz   :
tar cpvzf this_is_a.tar.gz this_dir/ 
tar.bz2  :
tar cpvyf this_is_a.tar.bz2 this_dir/ 
or
tar cpvjf this_is_a.tar.bz2 /this_dir 
Again, you can omit the v option. The p can be omitted as well, but then the file permissions are not preserved.
Instead of creating an archive of an entire directory, you can also just supply a list of files. You can do a lot more with tar and bzip2 than shown here. See the man pages for more info.
Top