Changing permission of all files and folders at once.

How can I set permission to all files on the server to 644 & folders to 755. It’s quite simple.

Here the way I will show you how.

To change the permissions of all folders to 755 you can use the command below. Before

root@justgeek~]# find /home/justgeek -type d -exec chmod 755 -v {} \;

To change the permissions of all folders to 755 you can use the command below.

root@justgeek~]# find /home/justgeek -type f -exec chmod 644 -v {} \;

That’s it.

Read More

How to upgrade kernel Safely.

How to safely upgrade kernel ? Many times it happens that you upgrade kernel, and reboot your server and your server never comes on-line. So using the trick below, server will first boot up on the new kernel and if the server isn’t coming on-line then reboot the server again and it will boot up in old kernel.

First Upgrade the Kernel

root@justgeek~]# yum install kernel

Edit grub configuration by editing /boot/grub/grub.conf and change default=0 to default=1 (Or your working kernel)

Go to grub prompt using grub command.

root@justgeek~]# grub
Probing devices to guess BIOS drives. This may take a long time.
Unknown partition table signature
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[Minimal BASH-like line editing is supported.For first word,TAB listspossible command completions.Anywhere else TAB lists the possible
completions of a device/filename.]
grub
grub> savedefault --default=0 --once
grub> quit

Reboot the server and make sure that you booted with latest kernel :)

Once the Server is booted with new kernel edit /boot/grub/grub.conf and change default=1 to default=0 (i.e. your new kernel)

 

Read More