Monday, 24 December 2012

Configuration of LINUX Gateway Machine

Check two network devices attach properly or not. Follow the steps to configure the Linux machine(CentOS, Fedora) gateway. i )  Check the Device eth0, eth1 are available on the machine by running command.    [root@Xhost ]# ifconfig  It will display eth0 and eth1 two network card details (ip, mac and etc). ii)...
Read More

Friday, 21 December 2012

Guide to Install VServer in Fedora and Install MYPLC in VServer

This Guide will explain how to install Vserver in Fedora and then How to Install MyPLC in Vserver Step 1 : Install Fedora 12 without GUI (do not Install Any X11 packages Because in GUI mode vserver not Installing Properly) Option 1 : Download Fedora Net Install ISO and Install while Installing Choose Minimal as...
Read More

Tuesday, 18 December 2012

Uninstall or Remove Any Application or Package in Fedora

Hi I already installed yum-3.2.28-5.fc12.noarch package now i want to remove that package and Install lower version yum-3.2.25-2chroot.noarch [root@server1]#rpm -Uvh yum-3.2.25-2chroot.noarch.rpm  Preparing...                ########################################### [100%] ...
Read More

Thursday, 13 December 2012

Find Size of table and Size of Index in MySQL Command Prompt

To find Size of table in MySQL command prompt use below command mysql > SELECT table_name AS "Table", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "database_name" AND table_name = "table_name"; To find Size of  Index of a table in MySQL command...
Read More

Thursday, 6 December 2012

Add new Line while Appending two files in Linux

If two files containing following content file1: 1 2 file2: 3 4 After append : cat file2>>file1  output in file1: 1 23 4 to Add new Line while Appending two files Command : sed -i -e '$a\' file2 | cat file2 >> file1 From Above sed -i -e '$a\' file2 This adds \n at the end of the file only if...
Read More

Wednesday, 28 November 2012

Solution: After Exception Catch in Python What will happen?

Exception Handling : After Exception Catch Python will execute remaining code, See below Example  #!/usr/bin/python3 # reading sitemap xml file # a=5 def diverror(a):     a = a/0     print(a) try: diverror(a) except: print("Division Error") a = a+10 print(a) Output: Division Error 15 ...
Read More

Break out of the function in Python

In Python if Any function return any thing or return none means the function is completed ie Break out of the function  Example: def test(a,b):       return "HI Closed"       a = b+10       print(a) test(10,11) output: HI Close...
Read More

Catch all exception in Python3

to catch all exceptions in python3 simple do like bellow try:     code except:     print("Unknown Exception found"...
Read More

Sunday, 25 November 2012

Python current timestamp

To get current time with date in python from datetime import datetime curtime = str(datetime.now()) output : '2012-11-25 14:58:30.465213' ...
Read More

Friday, 23 November 2012

Solution: Extract tar.bz2 files in Linux

To Extract tar.bz2 files in linux use below command root@system1~# tar -xjvf filename.tar.b...
Read More

Wednesday, 21 November 2012

Delete duplicate rows in mysql table

It is Possible to DELETE duplicate rows in MYSQL table based on Particular Field (Coloumn) the SQL Query is ALTER IGNORE TABLE table_name ADD UNIQUE INDEX(coloumn_name);&nbs...
Read More

Thursday, 15 November 2012

IPtables: Saving firewall rules to /etc/sysconfig/iptables: /etc/init.d/iptables: line 268: restorecon: command not found

Solution to : IPtables: Saving firewall rules to /etc/sysconfig/iptables: /etc/init.d/iptables: line 268: restorecon: command not found root@server1:~# ls -l /sbin/ | grep restore lrwxrwxrwx 1 root root     14 May 23 17:52 iptables-restore -> iptables-multi Means policycoreutils not Installed So Install policycoreutils...
Read More

Tuesday, 13 November 2012

Read Large Files Line by Line in Python - Best Way

The readlines() function loads the entire file into memory as it runs. A better approach for large files is to use the fileinput module, as follows:import fileinputfor line in fileinput.input(['myfile']):   print(lin...
Read More

Monday, 12 November 2012

Solution: Dovecot error : Unknown database driver mysql

Dovecot error : Unknown database driver mysql because Dovecot requires the dovecot-mysql package to run mysql authentication. So Install  dovecot-mysql yum install dovecot-mysq...
Read More

Friday, 9 November 2012

Load Kernel Module in Linux Example Load IP table module

Below Instructions shows How to Load Kernel module in Linux check whether module is Loaded or Not if you don't know Exact Module Name then Check All Loaded Modules root@system1:~# lsmod Module                  Size  Used by nf_conntrack_ipv4      18850...
Read More

Tuesday, 6 November 2012

Solution to g++: Command not found in Fedora Problem

g++ command not found means gcc-c++ package not  installed so install gcc-c++ package command root@system1:# yum install gcc-c...
Read More

Install deb packages

To install .deb packages use following command root@system1:~# dpkg -i package.d...
Read More

SSH login without password in Linux

Hi to login into Linux System through SSH with out password Follow Below Steps two systems (Below IP addresses are for Example) system1 ip : 2.2.2.2 system2 ip : 3.3.3.3 Note: For Below Command don't type any thing Simply press Enter root@system1:~# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in...
Read More

Monday, 5 November 2012

convert to binary in PHP

In PHP decbin function is used to convert anything to binary Example: <?php $a = "3"; $b = 4; echo decbin($a)."<br>"; echo decbin($b); ?> Output: 11 1...
Read More

Monday, 22 October 2012

Setup domain nagix etc usefull urls

http://www.unixsurgeon.com/kb/setup-nginx-as-reverse-proxy-with-apache.html  http://kbeezie.com/view/apache-with-nginx/ http://www.ctkn.net/2011/10/install-mod_rpaf-on-centos-5-centos-6/ http://www.unixsurgeon.com/kb/setup-nginx-as-reverse-proxy-with-apache.html http://www.beer.org.uk/bsacdns/ http://www.webtop.com.au/blog/how-to-setup-dns-using-webmin-2009052848 http://forums.devshed.com/dns-36/setting-up-dns-using-webmin-406190.html...
Read More

Change linux root password

Change linux root password user# su password : root# passwd Enter New Password: Re type password: &nbs...
Read More

After Copying Mysql table data files manually mysql service not running

If you got the problem After Copying Mysql table data files manually MySQL service not running then check owner of copied files, to work MySQL the owner must be MySQL mysql data folder in linux /var/lib/mysql root/backup# cp databasefolder /var/lib/mysql root# chown mysql.mysql  databasefolder root# cd  databasefolder root/databasefolder#...
Read More

Sunday, 21 October 2012

Solution to : XML::SAX::Base.3pm.gz conflicts between Problem

Some time if you got Problem like below while yum update file /usr/share/man/man3/XML::SAX::Base.3pm.gz conflicts between attempted installs of perl-XML-SAX-Base-1.04-3.el6.noarch and perl-XML-SAX-0.96-7.el6.noarch file /usr/share/man/man3/XML::SAX::Exception.3pm.gz conflicts between attempted installs of perl-XML-SAX-Base-1.04-3.el6.noarch...
Read More

Solution to : Error: rpmdb open failed

Error: rpmdb open failed will occur while trying to use you update to solve this problem use following commands yum clean all rm -f /var/lib/rpm/__db* rpm --rebuilddb yum upda...
Read More

Thursday, 18 October 2012

Shell script execute command and store in variable

This Post shows how to execute command in .sh files ie shell script files Example: cmd=$(ps -ef | grep tcpdump | awk '{print $3}') echo $cmd in .sh files need to use like this variable=$(comman...
Read More

Wednesday, 17 October 2012

Set PHP execution time in Code Itself

It is possible to Set PHP execution time in code No need to changing php.ini file Add Below line to your PHP code ini_set('max_execution_time', 1919); where 1919 means PHP script will execute 1919 seconds Example: <?php ini_set('max_execution_time', 1919); ................. ................ .............. ?>...
Read More

Tuesday, 9 October 2012

Get SVN files and Folders with WGET

By Using WGET it is possible to get all files and folders of a url  Command wget -r -i http://svn.planet-lab.org/svn/build/trun...
Read More

Wednesday, 3 October 2012

Add Route Between Two Systems

Type ifconfig in terminal (command Prompt) to know IP Type route -n in terminal (command Prompt) to know GateWay First System IP : 203.41.55.23 Second System IP : 23.41.67.89 First System Gateway : 203.41.55.1 Second System Gateway : 23.41.67.1 You can add route in any One System is Enough for example Add route in First...
Read More

Saturday, 29 September 2012

Show error message if Java run-time not installed in client mechine through JavaScript

By using Follow code, it is possible to show error message if java run-time not installed in client mechine <!DOCTYPE html><html><body><script>if (navigator.javaEnabled()) {    //Java is enabled}else{document.write("Error:Java is Disabled or Java Not Installed<br>Download and Insatall...
Read More

Wednesday, 26 September 2012

Solution SSH Connection Refused Problem in Linux - Backtrack

If your system unable to SSH from another System means 1. SSH server Not Running. So start SSH Server     To start SSH server goto Applications->Backtrack->Services->SSHD->sshd start If It is Running, and unable to SSH...
Read More

Monday, 24 September 2012

Solution to Endianness Problems in Linux Networking

There are two types of Endians 1.Big-Endian 2.Little-Endian In real world Networks generally use Big-Endian Ethernet is Big-endian IP's byte order also is Big-endian A common solution to the endianness problem associated with networking can be handled by below functions htons(): Convert 16-bit unsigned value from...
Read More
Here We Write The Problems we face at different situations and Solutions to those problems.