Skip to main content


Showing posts from 2014

Open Secret of Human Behavior to Understand Better World

Open Secret of Human Behavior to Understand Better World The search about the word combination on Google Search has given like this
Open Secret of Human Behaviour
About 19,10,000 results
(0.34 seconds)
31 Dec 2014

Open Secret of Human Behaviour to understand better world
About 38,20,000 results
(0.56 seconds) 31 Dec 2014

But the question is did we actually revel human behavior to understand better world?
At the end of any fruit.. the fruit reflect the human behavior with some simple question..
Does it useful to me or in Life or for Humanity or Nature?

Now we can start a series of human behavior thought to understand human itself which we did not found in books or directly disclose by other.

Please post and comments your thought that you have observed from you and around yourself.
I have started from my side...

General Method for install a software package using source file

General Method for install a software package using source file
It is always difficult to install a software packages in the linux system.
But if you read the document properly the it is easy to install and better understanding with the software that how it works.

step1:- Download linux/unix compatible software package of required 32bit (i386,i486,i586,i686) or 64bit (x84_64)
step2:- Extract the package
step3:- go to extracted folder and read properly the file given as INSTALL or README or doc folder. If possible then read other tutorial.
step4:- Generally a configure file in the folder for the environment settings
step5:- run make command
step6:- rum make install command.

then test the installation package.

Add binary path of software in environment using $HOME/.bash_profile file
PATH=$PATH:/$HOME/bin:<Binary installation path of software>
export PATH

Add a user in Super User list Wheel Group of Linux

Add a user in Super User list without Password
You can use vim or visudo to edit sudoer file but it is better to use visudo which let you know any syntax error in file while editing
uncomment line 92 in /etc/sudoer

%wheel    ALL=(ALL)    NOPASSWD: ALL

command for see all uncoment lines
# grep -v "#" /etc/sudoers |grep -v "^$"

add the user in wheel group

# usermod -G wheel <username>
or use GUI system-config-users

Shell Programming : Array using input file values

Shell Programming : Array using input file values
I have created a test script for understanding of "Array" using shell script. It is like perl or any other language but need to understand the requirement of array and use of it.
I need to parse a list of file names which will be collected by ls command. Then it need to print it again in double loop with some other command in bulk.
Programming Logic: 1. parse all file names correctly in array 2. print array with each its elements for testing 3. create a loop for number of file names by using print of each element of array 4. create a second loop in first loop for file names 5. print all file names with additional command without executing 6. collect output of this script and run it for your purpose.
###### take file names
# declear and convert into array
declare -a array1
declare -a array2
declare -a array3

Port forward of KVM Guest Virtual Machine through Host Machine using IPTABLE/FIREWALL in Linux System

Port forward of KVM Guest Virtual Machine through Host Machine using IPTABLE/FIREWALL in Linux System
There is a lot of method given in Internet for KVM guest machine port forwarding but I always look for the simple solution that can work in any Linux System.

I have issue during the port forward by IPTABLE/FIREWALL as it disable the Internet access within KVM guest machine.
If I look for Internet access within KVM guest machine then system disable port forwarding.

I have implement the simple solution in CentOS 6.5 x86_64 with can work in both situation as follows:

Step 1: Restart libvirtd service, so that it will modify your firewall rules as per KVM requirement.
# service libvirtd restart
Step 2: You need to add two rules in IPTABLE for NAT and FILTER
# iptables-save > iptable_save_default_libvirtd
# cp iptable_save_default_libvirtd iptable_modifed_libvirtd
# vim  iptable_modifed_libvirtd

Add line after *nat for SSH access

 -A PREROUTING -i eth0 -p tcp -m tcp --dport 222 -j DNA…

Open RAR files in Linux

Open RAR files in Linux I have faced an issue with rar files in Linux. I was not able to open rar file in my desktop. This issue can be resolved using unrar utility.
You can check the latest rpm package in any repository like dag or rpmforge or rpmfusion and run the command line this  yum install <link of rpm file>
# yum install
By using this, you need not to add repository to your system.

List all files in directory and sub-directory with time-stamp in Linux

 List all files in directory and sub-directory with time-stamp in Linux
This post for a specific solution for problem connected to time-stamp of all files.
As we don't have time to go in each subfolder and run ls command to view the time-stamp of files.
This command combination can solve the problem:-

$ find . -type f -exec ls -lt --time-style=+"%F_%T" {} +


find <directory_path> -type f -exec ls -lt --time-style=+"%F_%T" {} +

Idea: Computer Resources Management

Computer Resources Management Common mistakes are done by most of computer users which is related to computer resource management.
1. Disk Management:- This problems comes when user dump a lot of data and find that there is no more disk space in system. Solution: Use backup management software
2. File Management:- If a user create a lot of duplicate files and unable to find the required file. Solution: Use repository management software
3. Process Management:- User start many process without requirement then program response time is very bad. Solution: Be aware about system
4. Network Management:- When user not monitoring network connection create by system then there is bad network response which browsing. Solution: Close unused network connection. Be aware about system networking.

5. Reference/Search Management:-
User always need to search within system for files. But unable to find it correctly.
Solution: Enable search in system in its best way by taking help of OS utilities. Use r…

Howto: Linux Kill and Logout Users

Howto: Linux Kill and Logout Users
. One of such utility is skill which is responsible to send a signal to users and process such as: Halt user terminalKill user and logout# skill -STOP -u vivek
# skill -CONT -u vivek
# skill -KILL -u vivek
Task: Kill and Logout All Users# skill -KILL -v /dev/pts/*
pkill command syntax pkill -KILL -u {username}

kill command To halt or stop a user called vivek, enter:
# pkill -STOP -u vivek
To resume a user called vivek, enter:
# pkill -CONT -u vivek
To kill all php-cgi process owned by vivek user, enter:
# pkill -KILL -u vivek php-cgi

Logging out my remote SSH session pkill -9 -t pts/0pkill -9 -t pts/tty-number. -t is the switch to specify tty

How to logout or kill other user session? Well, let’s start saying that you need to be root to do that, and that it is not polite or a good idea to do that, unless that user is not logged with permission.
It is always better to politely ask her to …

RSYNC for the effective copy of bulk data in Linux

RSYNC For Copy the bulk files in Linux
The question behind the copy files other then copy command is here. Some problem comes while using the cp command 1. if some problem comes and the cp command stop then you need to again start the command for copy the file over existing file that may fully copy not may not be. you need to check it before copy the files.  2. Bulk data files has problem with cp command because the requirement is different for it, Like speed, each file should be copy correctly, copy for backup purpose, delete the source file after copy, copy using networkcopy data need to compresscreate a list of copy filescopy in segmenthandling the shut-down & restart of system These all things can't possible using cp command only

SO the rsync command work here for all above problem

this command will not work with * for delete the files
rsync -avz --delete /home/john/server1/* remote.server:/home/john/files/

use it without * for delete the files
rsync -avz --delete /home/j…

How can I find the installation date of my Linux system ?

On Fedora, Redhat, and Centos you can retrieve the install date from the creation date of /root/install.log.

One method is to get the package details of the "basesystem" package:
# rpm -qi basesystem Other methods include checking the creation date of the files "install.log" in the /root directory or "anaconda.*" logs in the /var/log directory: # ls -l /root/install.log # ls -l /var/log/anaconda.* ls -lct /etc | tail -1 | awk '{print $6, $7}'ll -lct /etc/localtime

Linux Routing

Linux Routing I have faced many time problem related to routing tables. If I have more then one network card then I need to use routing for better management. As Linux administrator need to work on only command line, so I am listing the resource and common routing commands. Display routing table # route -n # ip route list # netstat -nr Add default gateway in routing table# route add default gw eth0# ip route add dev eth0for another gateway # route add -net $NET netmask $MASK gw $GATEWAY # route add -net netmask gw
Linux static routing config for eth1 interface In CentOS/RedHat # cat /etc/sysconfig/network-scripts/route-eth0
default dev eth0 via dev eth0

In Ubuntu/Debian
# vim /etc/network/interfaces #### Ubuntu Linux add persistent route command of your Ethernet configuration #### post-up route add -net netmask gw Ubuntu Linux - This is your defau…

Remote Linux System access with resume working terminal while access using SSH connection

Remote Linux System access with resume working terminal while access using SSH connection
1. Install screen command # yum install screen or $sudo apt-get install screen
2. Create Screen $ screen -S <screen_name>
$ screen -S screen-terminal1
3. Check existing screen $ screen -ls
4. Detach the working screen $ screen -D
5. Terminate the working screen $ exit
6. share the working screen or reattach screen $screen -x <screen-name>
$ screen -x screen-terminal1
If anytime your network is disconnect from network then you can just login the Linux system and reattach working screen. Its very useful utility when you need to run a program on terminal for many hours or days and share your terminal with other.

Web Browsing in Firefox through SSH Tunnel

Web Browsing in Firefox through SSH Tunnel
You can use your ssh tunnel for web browsing in Linux System:- First Step:- Create ssh tunnel with remote_ssh_server $ ssh -CND 9999 username@remote_ssh_server
Second Step: Change the proxy settings of Firefox Browser:-
Third Step: Use remote dns in firefox in about:config network.proxy.socks_remote_dns set to true:-