Jul 19 2010

How to DISABLE ipv6 in CentOS5 System

echo “NETWORKING_IPV6=no” >> /etc/sysconfig/network
echo “alias ipv6 off” >> /etc/modprobe.conf
echo “alias net-pf-10 off” >> /etc/modprobe.conf
reboot

# ifconfig

eth1      Link encap:Ethernet  HWaddr 00:1C:F0:BB:A7:28
inet addr:10.10.10.11  Bcast:10.10.10.255  Mask:255.255.255.0
inet6 addr: fe80::21c:f0ff:febb:a728/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:470449435 errors:1 dropped:0 overruns:0 frame:0
TX packets:464084402 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2563674692 (2.3 GiB)  TX bytes:2243518951 (2.0 GiB)
Interrupt:225 Base address:0×2800

Don’t really need of ipv6 to be run on your server. Want to disable it ?

Read more …

Jul 11 2010

Scripting a MySQL InnoDB Engine Conversion

0) Backup your database.
You should probably be doing this already.  Now’s a good time to make sure that your backups ran.

1) Create the script.
You’ll need the correct permissions to query the database. Here’s the command.  Be sure to change <DATABASE_NAME> as it fits.

# mysql -p -e "show tables in <DATABASE_NAME>;" | \
tail --lines=+2 | \
xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql

2) Run the script.

# mysql --database=<DATABASE_NAME> -p < alter_table.sql

3) Verify it by running this command in mysql:

mysql> show table status;

Read more …

When invoked without arguments, the date command displays the current date and time. Depending on the options specified, date will set the date and time or print it in a user defined way. I’ve seen many people writing a perl script for calculating yesterday or tomorrow. Computer loves numbers but we love relative terms like 2 days ago. Luckily GNU date command is designed to handle relative date calculation. Read more …

Q. How do I format date to display on screen on for my scripts as per my requirements?

A. You need to use standard date command to format date or time for output or to use in a shell script.

Syntax to specify format
date +FORMAT Read more …

Mar 09 2010

Setting up DomainKeys on Centos

This is a quick walk through on how to set up domain keys on Centos 5 using sendmail. It should also be very similar for Redhat or Fedora.

Domainkeys is a method mostly used by yahoo to verify that the sender of an email is valid. I did notice that gmail changes the domainkeys header line to a pass value but I don’t know if they block/accept mail based on that. Read more …