Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, 12 March 2015

Worker assignment for apache giraph job

Apache giraph job must be assigned the number of workers(which is basically count of mappers). But with how much workers should we assign for best runtime of our job?
Well few tips I got from my friend semih, from standard university who also developed GPS, an alternative to apache giraph project.

Tips:

Each node should be configured to have mapper count same as number of processor  cores. So if you have 2 core in the processor of your hadoop node than set mapred.map.tasks=2.

Each job must be assigned workers in the multiple of hadoop nodes. Let say you have 8 node cluster than you must assign "-w" value as 7 or 15 or 23 etc.. Note: worker count start from zero(0).

Again thanks to semih, phD scholar from Stanford University for these tips.

Friday, 10 January 2014

How to make folder undeletable

Use the following command to made folder undeletable.

$sudo chattr +i <file/folder name>

To again make it deletable, use following command

$sudo chattr -i <file/folder name>


here were setting attribute immutable with + and resetting it with - sign. i=immutable flag/attribute.


How to change default boot option on Grub Menu while booting

Use following command to change default boot option on grub menu. Remember, the option number starts from 0 not 1.

$sudo nano /etc/default/grub

goto option

GRUB_DEFAUT=0

and change the 0 with what ever you want.

now save and run following command

$sudo update-grub2

and Done!

How to deactivate/disable user temporarily in Linux

  Option 1:


To disable user, use following commands

$usermod    -s      /sbin/nologin    <UserName>

OR

$usermod   -s  /bin/false   <UserName>


Both of the following command will change entry of UserName in /etc/passwd and set their shell to given shell. In our case it is either /sbin/nologin or /bin/false.

To enable user, use the same command again and give with /bin/bash or /bin/sh shell.

Option 2:


Other option is to Lock User with following command

$passwd    -l   <UserName>

The -l option disables an account by changing the password to a value which matches no possible encrypted value.


To Unlock user, Use following command

$passwd   -u    <UserName>

The -u option re-enables an account by changing the password back to its previous value

Tuesday, 18 June 2013

How to re-install grub to recover Linux after windows installation

1) Many times it happens that we have linux & windows both installed in out system. Suddenly windows crash and now no way but you need to reinstall windows. In this windows installation process , windows bootloder MBR replace the Linux bootloader grub. After installation , you can not see grub and directly windows boot. 

2) Let say we have another scenario where we want to install two system and we first installed Linux[By mistake :P].  Now you install windows and your Linux is gone.

In this kind of scenario , instead of reinstalling Linux[with loss of important files :( ] you can reinstall grub and make linux on action again. 
Given below are the steps to do it.

Step1: 

Download the SystemRescueCd ISO. Which is basically Linux Distribution for Linux system rescue. You can also download or use other Linux which can run command we are going to use in next steps. But SystemRescueCd ISO is something I use and it always work for me.

Download link for SystemRescueDisk is given below.

Step2:

Burn it on CD or on Pendrive and boot SystemRescueCd Linux.
I use LiLi tool to burn Linux on Pendrive. That works fine for me.

Download link for LILIis given Below.

Step3:

After booting RescueCd, open terminal
write command as per instruction

#fsarchiver probe simple

#mkdir /mnt/linux

#munt /dev/sda2 /mnt/linux
                      here sda2 is partition for root file system of installed linux
#mount -o bind /proc /mnt/linux/proc
#mount -o bind /dev /mnt/linux/dev
#mount -o bind /sys /mnt/linux/sys

#chroot /mnt/linux /bin/bash
#grub-install /dev/sda

#umount /mnt/linux/dev
#umount /mnt/linux/proc
#umount /mnt/linux/sys
#umount /mnt/linux/boot
#umount /mnt/linux


After This, Just Restart the system and Congratulation, You just got your linux System back.

Sunday, 24 March 2013

Different boot mode of linux


Different boot mode of linux
File: /etc/inittab
init 0 –halt
init 1-Single user  (troubleshooting mode)
init 2-Multiuser mode(multiuser,without NFS)
inti 3- Full multiuser mode (without GUI)
init 4- unused (for userdefined mode)
init 5-X11 (full access with GUI)
init 6- restart

How to allowing root logins in telnet and Ftp in linux(Fedora/ubuntu/red hat)


How to allowing root logins in telnet and Ftp in linux(Fedora/ubuntu/red hat)
Configure telnet for root login
Edit  /etc/securetty & add following lines
pts/0
pts/1
pts/2
pts/3
pts/4
This will allow upto 5 telnet session with root user
Configure ftp for root login
Edit following file and remove “root” line from each file
/etc/vsftpd/ftpusers
/etc/vsftpd/user_list


How to enable GUI login with root user in Fedora


How to enable GUI login with root user in Fedora
Step 1: goto /etc/pam.d/
Step 2:cp gdm gdm-backup
Step 3: cp gdm-password gdm-p-backup
Step 4:in both file above gdm & gdm-password , find and make comment following line
Auth requires pam_succeed-if.so user!=root quit

Monday, 4 March 2013

Grub installation to recover linux again after windows installation

Grub installation to recover linux again after windows installation

When we install windows on Linux(Ubuntu/Fedora) Machine, Windows bootloader override Linux bootloader and you can not boot linux again. After Windows installation on Linux(Ubuntu/Fedora) machine,you can only see windows boot screen. To solve this problem we need to install Linux bootloader again and override it with windows bootloader.

Normally Linux use GRUB(Grand Universal Bootloader) Bootloader.
Windows use BootMGR(Boot Manager).

Now follow the steps to get you Linux(Ubuntu/Fedora) Operating System Back.

Step1: Download the ISO of System Rescue CD from it's website
http://www.sysresccd.org/SystemRescueCd_Homepage

Now either burn it on cd/dvd or burn it on pendrive.

Step 2: Reboot your system via this DVD/Pendrive and run SystemRescue OS

Step 3: Open the terminal and use following commands.

Command 1: fsarchiver probe simple

here check for linux boot partition or linux partition i.e. sda1 , sda2 ..etc..

Command 2: mkdir  /mnt/linux
Command 3: mount /dev/sda2  /mnt/linux

here my linux boot partition name is sda2. You need to write your own linux partition name that you had from command 1.

Command 4: mount -o bind /proc  /mnt/linux/proc
Command 5: mount -o bind /dev  /mnt/linux/dev
Command 6: mount -o bind /sys  /mnt/linux/sys

Command 7: chroot /mnt/linux  /bin/bash
Command 8: grub-install /dev/sda

Command 9: umount /mnt/linux/dev
Command 10: umount /mnt/linux/proc
Command 11: umount /mnt/linux/sys
Command 12: umount /mnt/linux/boot
Command 13: umount /mnt/linux