Saturday, April 28, 2012

How To stop and enable firewall ?

Sometimes, when we are running some socket program, by connecting our machine to other machine, we face the problem of firewall. If the port is blocked, then we will not be able to transmit and receive, on the other hand both the codes will work fine with localhost (127.0.0.1)
In such cases, you can disable the firewall on temporary basis and permanent basis both. There are other options also like allowing tcp/udp connection on specific port, but I prefer this one:

$service iptables stop


to renable:

$service iptables start



To make it permanent:

$chkconfig iptables off
$service iptables stop

Wednesday, April 25, 2012

How to add Colors to GIT

The easiest way:

$git config color.ui true


All set and done


How to install Chromium browser on fedora

Step 1: Download the .repo file

Step 2: copy the repo file in /etc/yum.repos.d/
$cp fedora-chromium-stable.repo /etc/yum.repos.d/


Step 3: run the following command with root access or sudo
$yum install chromium


All done.

Tuesday, April 24, 2012

How to restore / reinstall grub

If you install another operating system and by mistake you messed up, and you now feel that restoring the grub is a good option OR you install some thing, and found some operating system missing on system boot, then here are the steps to restore the grub:

Step 1: open a terminal, and gain root access, you can also use "sudo"

Step 2: run $os-probe
this will give you all the operating system present on your machine.

Step 3: $grub2-mkconfig -o /boot/grubX/grub.cfg
replace X with the version of grub you are having , in some cases it is grub and grub2 depending upon the different operating system you installed

Step 4: $grub2-install /dev/sda
this will install grub in MBR (Master Boot Record)

Use the above commands at your own risk, they always works for me. (triple boot: fedora 17B, Debby Sqeeze, and Windows 7)

Monday, April 23, 2012

How to Switch from GDM to KDM ?

Step 1: create a file "desktop"
Step 2: In "desktop" put this:
           DISPLAYMANGER="KDE"
save the file.
Step 3: copy the file in "\etc\sysconfig"
For this, open the terminal and run "sudo cp desktop /etc/sysconfig"
or su and then copy.
Step 4: reboot



Posted from GScribble.