tag:blogger.com,1999:blog-28680188794842538642018-01-21T08:19:36.681+05:30Linux 4 AllAn informative blog providing all About on Linux.Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.comBlogger164125RajLinuxAdministrationredHathttps://feedburner.google.comtag:blogger.com,1999:blog-2868018879484253864.post-549400052346007382011-12-22T11:30:00.002+05:302011-12-22T11:30:49.546+05:30How to Check and Repair MySQL Tables Using Mysqlcheck
When your mysql table gets corrupted, use mysqlcheck command to repair it.Mysqlcheck command checks, repairs, optimizes and analyzes the tables. &lt;!--[if !supportLineBreakNewLine]--&gt; &lt;!--[endif]--&gt;1. Check a Specific Table in a DatabaseIf your application gives an error message saying that a specific table is corrupted, execute the mysqlcheck command to check that one table.The following example<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/D7XjVQn8TcI" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com6http://raj-kumar-linux.blogspot.com/2011/12/how-to-check-and-repair-mysql-tables.htmltag:blogger.com,1999:blog-2868018879484253864.post-31092337356413273522011-11-15T13:08:00.000+05:302011-11-15T13:08:25.441+05:30Hard Disk status/Tuning on Linux
hdparm - linux disk tuningHold on. Stop. Right there. That's it. Before you go running off and playing you need to understand what you are playing with and what you are trying to achieve. Data security? Blistering Performance? Power Saving? Reduced Nose? hdparm is a powerfull toy and can shoot you in the foot. RTFM: man hdparm and man hdparm.conf. If the fine manual hasn't warned you about <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/RekO4KG0qa0" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/11/hard-disk-statustuning-on-linux.htmltag:blogger.com,1999:blog-2868018879484253864.post-15151467353471329902011-05-26T09:49:00.000+05:302011-05-26T09:49:24.168+05:30how to create binary from shell script...
step 1. download http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.7.tgz
step 2. extract &amp; install it.
step 3. now execute ./shc -f
step 4. now you will have binary file.
Thanks<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/HRyphBxESaY" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com21http://raj-kumar-linux.blogspot.com/2011/05/how-to-create-binary-from-shell-script.htmltag:blogger.com,1999:blog-2868018879484253864.post-66237687375799837972011-05-05T11:15:00.002+05:302011-05-05T11:15:19.507+05:30If Local user not able to Login into Linux SYSTEM..You have configured maximum logins attemps and account locking
pam_tally[31428]: user dpser12 (1241) tally 21,
Try with:
pam_tally --user dpser12 --reset=0
The sintax is:
pam_tally [--file rooted-filename] [--user username] [--reset[=n]]<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/o-AFrgT0oKw" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/05/if-local-user-not-able-to-login-into.htmltag:blogger.com,1999:blog-2868018879484253864.post-60383675810291013462011-03-11T09:15:00.000+05:302011-03-11T09:15:42.620+05:30Trigger mysql example. Introduction on Mysql triggerHow to do the data validation directly from MySQL? Trigger mysql example.
Many times I wanted to do data validation directly when inserting into a MySQL table and leave the source code of my application nice, clean and very readable, but support for that was only in Oracle and other SQL servers but not in MySQL.
Beginning with version 5 of MySQL the development team has added “triggering” to <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/eo9Kc7g_x_s" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com1http://raj-kumar-linux.blogspot.com/2011/03/trigger-mysql-example-introduction-on.htmltag:blogger.com,1999:blog-2868018879484253864.post-45819323518049435812011-03-11T08:49:00.000+05:302011-03-11T08:49:39.718+05:30Mysqladmin - Client for Administering a MySQL Server1. How to change the root password for Mysql?
mysqladmin -u root -ptmppassword password 'newpassword'
# mysql -u root -pnewpassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.25-rc-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql&gt;
2. How to check whether the MySQL <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/pXheDW5kh_c" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/03/mysqladmin-client-for-administering.htmltag:blogger.com,1999:blog-2868018879484253864.post-69857627245715697092011-03-02T14:07:00.000+05:302011-03-02T14:07:12.778+05:30simple load balancing with iptables
.fullpost { display: inline; }
iptables has an extension called clusterip. Clusterip extension uses multicast arp feature to achieve load balancing. Let's say we have two web servers called web1(192.168.0.1) and web2(192.168.0.2) and a virtual ip (192.168.0.10) which will be accepting requests for these machines.
virtual ip:192.168.0.10
web1:192.168.0.1
web2:192.168.0.2
Virtual ip will <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/YeaoWufuzoE" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com6http://raj-kumar-linux.blogspot.com/2011/03/simple-load-balancing-with-iptables.htmltag:blogger.com,1999:blog-2868018879484253864.post-7037611253932546552011-03-02T13:21:00.000+05:302011-03-02T13:21:12.184+05:30Shell script to backup a Mysql database and save it on a remote server using Ftp The following shell script will dump the mysql database and will save the .sql file on a remote location using Ftp. This script will create a backup file including the current date so you can have multiple copies of the backups of the same database under one directory.
Create a file called mysqlbkup.sh
# vi /root/mysqlbkup.shand paste the following code in the file as it is.
####<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/35WduR0Bxj0" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/03/shell-script-to-backup-mysql-database.htmltag:blogger.com,1999:blog-2868018879484253864.post-49401859491708681722011-03-02T13:19:00.002+05:302011-03-02T13:19:15.488+05:30How to defragment or optimize a database in Mysql? In case you remove a lot of data from the tables OR change the database structure, a de-fragmentation/optimizing of the database is necessary to avoid performance loss, especially while running queries. The above changes results in a performance loss, so make sure you run the “optimizer” on the database.
SSH to your server and execute:
mysqlcheck -o where, -o stands for <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/QCDjm4_colA" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/03/how-to-defragment-or-optimize-database.htmltag:blogger.com,1999:blog-2868018879484253864.post-55019229741087372132011-03-02T13:15:00.000+05:302011-03-02T13:15:21.368+05:30Enable MySQL General Query And Slow Query Log
MySQL has a query logging feature. In order to use it you have to first enable it.
Enabling the general query logStep 1: Set your log file in /etc/my.cnf
vi /etc/my.cnfIn the [mysqld] section specify the general log file name:
log=/var/log/mysqld.general.logStep 2: Create the file and make sure it is owned by the system user mysql
touch /var/log/mysqld.general.log
chown <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/24gco7xLJ9I" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com1http://raj-kumar-linux.blogspot.com/2011/03/enable-mysql-general-query-and-slow.htmltag:blogger.com,1999:blog-2868018879484253864.post-26679627333466644172011-03-02T13:11:00.002+05:302011-03-02T13:11:39.895+05:30How to enable ‘General Query Log’ in Mysql?General Query Log is used to keep track of mysql status i.e. it writes the information when a client connects/disconnects OR a query is executed. It is useful when the number of people managing the database is high. In order to enable ‘General Query Log’,
edit the Mysql configuration file
vi /etc/my.cnfenable the log under the ‘mysqld’ section
log=/var/log/mysql.general.logSave the file. Now <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/KZYJYQnycSw" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/03/how-to-enable-general-query-log-in.htmltag:blogger.com,1999:blog-2868018879484253864.post-68880951851827045422011-02-15T17:29:00.000+05:302011-02-15T17:29:02.562+05:30UNIX / Linux: 10 Netstat Command ExamplesNetstat command displays various network related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc.,
In this article, let us review 10 practical unix netstat command examples.
1. List All Ports (both listening and non listening ports)List all ports using netstat -a# netstat -a | more
Active Internet connections (<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/uVMhJy4PgVo" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com12http://raj-kumar-linux.blogspot.com/2011/02/unix-linux-10-netstat-command-examples.htmltag:blogger.com,1999:blog-2868018879484253864.post-41835881792249280072011-02-15T13:57:00.000+05:302011-02-15T13:57:29.776+05:30TCPDUMP Command Examples
tcpdump command is also called as packet analyzer.
tcpdump command will work on most flavors of unix operating system. tcpdump allows us to save the packets that are captured, so that we can use it for future analysis. The saved file can be viewed by the same tcpdump command. We can also use open source software like wireshark to read the tcpdump pcap files.
In this tcpdump tutorial, let us <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/JMvAeU6qhO0" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/02/tcpdump-command-examples.htmltag:blogger.com,1999:blog-2868018879484253864.post-60571495025586154302011-01-31T14:23:00.000+05:302011-01-31T14:23:10.095+05:30Nagios Client Install on Linux CentOS&lt;!--[if !mso]&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt; Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/jtsvKre0fG0" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/01/nagios-client-install-on-linux-centos.htmltag:blogger.com,1999:blog-2868018879484253864.post-49474103242642119992011-01-24T18:41:00.000+05:302011-01-24T18:41:24.092+05:30How to update Gateway, network settings on RHEL Changing Your IP Address If you wanted, you could give this eth0 interface an IP address using the ifconfig command.
[root@bigboy tmp]# ifconfig eth0 10.0.0.1 netmask 255.255.255.0 upThe "up" at the end of the command activates the interface. To make this permanent each time you boot up you'll have to add this command in your /etc/rc.local file which is run at the end of every reboot.
How to<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/bBLxbaQmEhk" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com4http://raj-kumar-linux.blogspot.com/2011/01/how-to-update-gateway-network-settings.htmltag:blogger.com,1999:blog-2868018879484253864.post-46853738869205922972011-01-09T19:38:00.003+05:302011-01-09T19:40:33.287+05:30How to uninstall GRUB ie Installed by Ubuntu InstallerYou can overwrite MBR with standard dd command. You can also use old good MS-DOS fdisk command to overwrite MBR.
Using MS-DOS/Windows 9x boot diskIn order to remove the GRUB bootloader from a Linux and Windows XP machine, boot with a Windows 9x startup disk or CD and execute the MS-DOS command:
fdisk /mbr
Using Windows XP boot diskBoot computer using Windows XP (Windows 2000) setup disc / CD / <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/maxqS9_gHz8" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com1http://raj-kumar-linux.blogspot.com/2011/01/how-to-uninstall-grub-ie-installed-by.htmltag:blogger.com,1999:blog-2868018879484253864.post-25117705945632674572011-01-07T17:53:00.000+05:302011-01-07T17:53:41.513+05:30NTFS Support on RHEL5RHEL doesn’t come with NTFS support by deffault.
1. Download fuse &amp; ntfs-3g components:
fuse: get it from http://www.atrpms.net/dist/el5/fuse/
ntfs-3g: get it from http://dag.wieers.com/rpm/packages/fuse-ntfs-3g/
2. Install the RPM’s
3. Once you’re done with it mount the drive
#mount.ntfs-3g /dev/sda1 /media/ntfsmount
There you go!<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/_0HhOUUirHE" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/01/ntfs-support-on-rhel5.htmltag:blogger.com,1999:blog-2868018879484253864.post-21775554739982946582011-01-06T14:45:00.002+05:302011-01-06T14:45:30.324+05:30NIS on RHEL5NETWORK INFORMATION SERVICE
NIS is centralized authentication software in Linux / Unix / Solaris platform. In a network, there will be a NIS server, one or more NIS slaves and lots of NIS Client machines. This document explains how to install and configue NIS Master, Slave and Client Machines in Redhat enterprise linux rhel5. It can also be applicable on centos, fedora and other variants.
<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/HO6GtU07Ez0" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com1http://raj-kumar-linux.blogspot.com/2011/01/nis-on-rhel5.htmltag:blogger.com,1999:blog-2868018879484253864.post-11024972103610539242011-01-06T14:44:00.002+05:302011-01-06T14:44:12.681+05:30HA on RHEL5Heartbeat is a High Availabily cluster software in linux platform. Here we will discuss how to
install and configure heartbeat-3.0.3 in redhat enterprise linux. In this example we will configue
a webserver using apache and we will cluster it. It can be implemented on centos, fedora and other redhat flavors.
Heartbeat Version is : heartbeat-3.0.3
Requirements:
2 linux nodes, rhel5.4.
Node1: <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/nakg4SCMFRA" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com1http://raj-kumar-linux.blogspot.com/2011/01/ha-on-rhel5.htmltag:blogger.com,1999:blog-2868018879484253864.post-74611946488014178432011-01-06T14:42:00.002+05:302011-01-06T14:42:44.800+05:30How to install and configure Samba PDC domain controller on linux redhat rhel5Samba PDC is used for centralized authentication and domain control of Windows
operating systems.
Here we will set a samba PDC machine with domain name lap.work and create some
users. And we will check whether these users are able to login to this domain from different
machines.
In this example we are working on rhel5. It will also work on other distributions like Centos, Fedora, SUSE etc.
<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/GR5Gt4LFofs" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2011/01/how-to-install-and-configure-samba-pdc.htmltag:blogger.com,1999:blog-2868018879484253864.post-19575080885529512482011-01-06T14:36:00.000+05:302011-01-06T14:36:03.085+05:30How to Enable Root Login on RHEL6If You want to login as a root from GUI in RHEL6 then you have
to edit something like some files which are located to /etc/pam.d/
Open your Terminal from Applications -&gt; System Tools -&gt; Terminal
Now Login as a root from your terminal
Step 1 :- [sham@rhel6]$ su – root
Password:-
Step 2:- Now go to your /etc/pam.d/ directory.
[root@rhel6]# cd /etc/pam.d/
Then first take a backup of gdm file
<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/ljO82dgwP3s" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com1http://raj-kumar-linux.blogspot.com/2011/01/how-to-enable-root-login-on-rhel6.htmltag:blogger.com,1999:blog-2868018879484253864.post-40405822097673234512010-12-30T16:45:00.003+05:302010-12-30T16:47:20.382+05:30Script to Print Disk Usage as per Used/Free ...Here is the Magic....Just copy &amp; paste @ command Prompt :-===================================================
clear;echo "=========================================";echo "Disk Usage As per Partition MAX/MIN Size";echo "=========================================";df -Ph | awk -F" " '{print $6 " " $2}'|grep -v shm|sed '1d'| sed -e :a -e '$b;N;s/\n/,/;ba' | sed 's/^/(/' | sed 's/$/)/';echo;df -Ph | <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/AFIT75auLkQ" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2010/12/script-to-print-disk-usage-as-per.htmltag:blogger.com,1999:blog-2868018879484253864.post-33603576639889947122010-12-30T12:52:00.000+05:302010-12-30T12:52:07.015+05:30hacking-rpms-with-rpmrebuildrpmrebuild is good tool to perform reverse engineer the files installed on an older Fedora system back into its original RPM package. Rpmrebuild is able to reconstruct an RPM by looking up the information about it on the RPM database that is part of every RPM-based distribution like Fedora. But rpmrebuild doesn’t stop there; you can also modify actual RPM packages without needing access to <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/EYRtCP2W93Y" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2010/12/hacking-rpms-with-rpmrebuild.htmltag:blogger.com,1999:blog-2868018879484253864.post-30091901300902111102010-12-30T12:49:00.000+05:302010-12-30T12:49:33.676+05:30creating-vpns-with-ipsec-and-ssltlsVPN (Virtual Private Network) is a technology that provides secure communication through an insecure and untrusted network (like the Internet). Usually, it achieves this by authentication, encryption, compression and tunneling. Tunneling is a technique that encapsulates the packet header and data of one protocol inside the payload field of another protocol. This way, an encapsulated packet <img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/o-aSQd_-Ylo" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2010/12/creating-vpns-with-ipsec-and-ssltls.htmltag:blogger.com,1999:blog-2868018879484253864.post-43670913611211610802010-12-30T12:47:00.000+05:302010-12-30T12:47:32.788+05:30using-windows-ntfs-fat-partitions-from-linux-fedora-coreWith some space available on your disk, when you go to install Linux, consider adding a small FAT16 or FAT32 partition (maybe 2GB) on your disk. Every x86 operating system (Linux, Windows 95, NT, 2000, XP, Vista and DOS) supports those types. With that added, you will be able to freely exchange files between your Linux and Windows system on the FAT16 partition. With FAT partitions, however,<img src="http://feeds.feedburner.com/~r/RajLinuxAdministrationredHat/~4/ydAmrDBtT2s" height="1" width="1" alt=""/>Raj Kumarhttp://www.blogger.com/profile/10023582091767852021noreply@blogger.com0http://raj-kumar-linux.blogspot.com/2010/12/using-windows-ntfs-fat-partitions-from.html