Restoring GRUB after a reinstall

You had just did a weekly install of some OS which did not detected Linux, Follow the steps mentioned below to get GRUB working again. Please note this would erase the current bootloader and install a new one for you if you are unsure of what you are doing do not try this

    1. Boot from a Linux Live CD ( ex ubuntu or knopix, i use Ubuntu)
    2. Open the terminal
    3. Follow the commands mentioned below
    • sudo grub

    if sudo doesnot works switch to root user and use grub drectly, Find the ROOT device you will get the values for X & Y which will be used later.

    • grub> find /boot/grub/stage1

    Set the root device from the information achieved from the above command

    • grub> root (hdX,Y)

    Install GRUB

    • grub> setup (hd0)

    Exit GRUB

    User / Group Disk Quotas A three Step Guide

    A disk quota is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. "Wikipedia"

    Requirements : Quota Package

    Where to get it : Quota package is generally available in majority of Linux Distros but still if your distro doesn't provide you with Quota compile it from :)

    Step 1) Installation :

    a) openSUSE : yast -i quota

    b) Ubuntu : sudo apt-get install quota

    c) Fedora : yum install quota

    d) Others : Use rpm or compile if not available


    Step 2) Enable Disk Quota

    Disk quota is generally applied on a user or a set of users to its recommended to enable Disk Quota on your Home partition dont enable quota on the root partition unless you are under the expert category

    How to Masquerade (ICS) in Linux

    Its very simple to masquerade in linux with few lines of iptables and ip_forward commands.

    Assumptions : Your Linux box has 2 NIC's one connected to internet (eth0) other connected to local network (eth1 IP

    first of all you have to flush and delete existing firewall rules which are there by default in linux .

    so flush rules by typing the following in terminal

    iptables -F
    iptables -t nat -F
    iptables -t mangle -F

    now delete the chains by using

    iptables -X
    iptables -t nat -X
    iptables -t mangle -X

    now its time to save iptables so type

    service iptables save
    service iptables restart

    now all rules and chains will clear !

    check it by /etc/sysconfig/iptables which has all defaults rules set to accept.

    now open /etc/rc.d/rc.local

    and insert the following line

    Broadcom 43xxx on Linux (openSUSE)

    Hopefully there would be many like me who have struggled in configuring Broadcom Wifi Cards on Linux due to their proprietory drivers, now a days it works fine in Ubuntu if you download the drivers available but still it doesnot work with various other distros. so here is a 3 step guide to configure Broadcom Wifi on your linux box these steps have been tested on openSUSE but would work on any distro Step 1 ) Download a file from here. Step 2) Install bcm43xx-fwcutter it is commonly avaiable for all distros Step 3 ) follow the commands

    How to reset the ROOT password?

    missed a ROOT password now what :(

    You can reset the root password if you have physical access to your machine some of the distributions allow you to login in single user mode and once you are logged in you can change the password but what about the distributions which asks me to enter password while logging in the single user mode? eg SUSE is there a solution. yes there is follow the simple steps below to reset your password


    top scheduling...

    tasks tasks and tasks... you always need to monitor them but how to schedule this monitoring so that i can get a file generated say every hour or four hours. You normally use the following command to transfer the output of top to a file

    $ top > filename

    and this works fine for you have you ever tried to add this entry as a cron job believe me it wont work i struggled a lot with it so finally whats the solution to schedule it The answer is use cron job, but i just said it wont work :) yes this wont work directly you need to add certain flags hey dont work you need not search them, below is the line which you can add as your cron job

    PXE : making your admins life easier

    Need to setup a lab/office with 200+ computers, very tiring job but look if you have machines identical in configuration why are you installing each of them why not install one and replicate it to others this will save a lot of time, But how will i do this?????????? Its very very simple you can do a dd of the source to all destination but this would be even difficult and a bit geeky, hey dont worry we have a solution for it use PXE. 

    Now what is this PXE??

    Wikipedia "The Preboot eXecution Environment (PXE, also known as Pre-Execution Environment, or 'pixie') is an environment to boot computers using a network interface independently of available data storage devices (like hard disks) or installed operating systems."

    Installing PostgreSQL on Ubuntu Intrepid (8.10)

    Installing majority of softwares on Ubutu is just a like away same is the case with PostgreSQL

    Installing PostgreSQL (8.3)

    $ sudo apt-get install postgresql

    Setting the password for the postgres user

    $ sudo -u postgres psql template1

    ALTER USER postgres WITH PASSWORD 'password-u-need';

    this installs and configues the password for the postgreSQL

    is this not easy with ubuntu

    and yes if you need to use postgreSQL with PHP on your apache server the install the php5-pgsql module using the following

    $ sudo apt-get install php5-pgsql


    How to TTF Fonts in Ubuntu

    Simple steps to install TTF fonts on your Ubuntu Machine
    1. Move all your fonts to the ~/ Directory. The ~/ Directory is your home folder. So if you were logged in as abhishek, the directory would be /home/abhishek/ . This step is done only to ease the process you can use any directory for this matter.
    2. Open up the terminal. I'm assuming you've already extracted the font to the ~/ directory.

    SWAP Usage

    For the first time i saw my SWAP space being used in excess of 2% don't know why but it was i was running 4-5 applications since 7hrs suddenly i saw that my System Monitor showed a high SWAP usage would be analysing the Logs to check what went wrong. have taken the snapshot which is below

    Swap Usage