Technology weblog

IT-Essence
Sunday May 27, 2007

Restoring boot loader after windows installation

If you install Windows on a computer that has Linux and the (Grub) bootloader already installed, you will see that the Linux bootloader has been overwritten during the Windows installation process. To recover, do:

  • Boot from your favourite Linux rescue CD / Knoppix distribution/ Other Linux live CD
  • If you forgot your harddisk lay-out, do fdisk /dev/hda and do 'p', to print the partition table. Exit with 'q'. 
Suppose the boot partition to be on /dev/hda6 and the root on /dev/hda7. Of course, your /boot may be located on your root partition too, in which case you just leave out the associated steps below.
  • Create a mountpoint, let's say mkdir /mnt/root.
  • Mount your partition: mount /dev/hda6 /mnt/root.
  • Change root chroot /mnt/root. If you have /boot on a separate partition, do mount /dev/hda7 /boot
  • Do grub-install /dev/hda
That should be all!

Thursday May 10, 2007

Command line commands in Linux

In this post I maintain a list of useful commands that can be entered at the Linux command line.[Read More]

Sunday Feb 04, 2007

Wireless with wireless-tools and wpa_supplicant

Today I got wireless (with WEP encryption) working on my Gentoo Linux laptop (Asus S1300 with Linksys wireless card and Linksys WRT54G access point) with both wireless-tools and wpa_supplicant. Next thing on my wishlist, WPA encryption, must be very close now. Read more on the details below.
[Read More]

Sunday Jan 21, 2007

Beryl and i810 driver (with AIGLX)

Today I got Beryl operational on my Gentoo Linux based laptop (for some screenshots of Beryl, see the Beryl Gentoo Linux Wiki). The laptop is an Asus S1300 with an i810 driver.


My laptop is equipped with Gentoo Linux (installation instructions for this laptop can be found here). I used AIGLX for the GLX rendering capabilities. For those not acquainted with this material, this page provides excellent and concise introductory material on these topics.[Read More]

Wednesday Jan 17, 2007

Great package: ifplugd

Recently booting my (Gentoo Linux based) laptop became very slow, since it tried to acquire a DHCP-based network connection for my net.eth0, although my laptop is connected wireless 99 percent of the time! Consequently, I had to wait for the DHCP request to time out at every boot!

First it showed in the boot sequence:

device initiated services: net.eth0
It would initiate this service despite the fact that it was not present in any of the runlevels at startup (using the rc-update command in Gentoo)!

Thereafter it tried to
* Starting eth0
* Bringing up eth0
* dhcp
* Running dhcp ...
and I had to wait for the DHCP request to time out.

To the rescue now comes ifplugd! [Read More]

Friday Dec 22, 2006

Reverse proxy with Apache

How do I configure Apache so that it acts like a reverse proxy for a service running on my localhost at port xyz?

Stated differently, suppose we have a service running on a server, which is known as server.mydomain.com to the outside world. To the intranet, this server may be available under a different name (as a matter of fact, in my configuration at home it actually does), but for the moment let's assume that the URL of the service running on the local serer is available at:

http://localhost:9090/service/url

and we want to make it available on the Internet via

http://server.mydomain.com/service/url
[Read More]

Friday Dec 15, 2006

Gentoo Linux: Installing a masked package

Suppose Gentoo Linux ships with my-package-1.1.4, but you want the most recent (but still masked) version, let's assume my-package-1.1.6 for the moment. How do we configure this?

For example, take the Maven binary package Maven 2.0.2, which is broken for a remote site deploy. To get the most recent version (Maven 2.0.4), add

dev-java/maven-bin ~x86

to the /etc/portage/package.keywords file, or even better execute

echo "dev-java/maven-bin ~x86" >> /etc/portage/package.keywords.

The latter makes sure that adding the package is successful, even if the package.keywords file did not exist yet.

Tuesday Nov 28, 2006

Batch processing pictures on the command line

If you have a lot of holiday pictures to process, the command line interface may provide exactly what you need:

  • To rename all pictures according to the date they were taken (based on the EXIF information contained therein):
    $ for i in *.jpg; do jhead -n%b-%d-%G_%R:%S $i; done
  • To scale all pictures by a factor of 0.25, invoke
    $ for i in *; do convert -scale 25%x25% $i `echo $i | sed -e 's/.jpg//g'`_sm.jpg; done
  • To rename all the small pictures in such a way that the "_sm" suffix disappears, use
    $ for i in *; do mv $i "`echo $i | sed -e 's/_sm.jpg//g'`.jpg"; done
We assumed that jhead and ImageMagick are present on your Linux system.

The tables with holiday pictures on my home page have been generated on these processed images using the webgallery program This relatively simple program does a wonderful job.

Monday Nov 27, 2006

Su to root with Gentoo Linux

Why can't a Gentoo Linux user su to root by default?

For security reasons, users may only su to root if they belong to the
wheel group. To add a username to the wheel group, issue the following
command as root:

# gpasswd -a username wheel


Hire us
Archives
Tags
Links
Stats
Referrers