Qmail Toaster on Centos 5.5

July 24th, 2010

I’ve followed the steps described in here : http://wiki.qmailtoaster.com/index.php/CentOS_5_QmailToaster_Install to install Qmail Toaster on Centos 5.5.

If you access the isoqlog and get this error:
Forbidden?You don’t have permission to access /qlogs-toaster/ on this server.

After you do some email traffic run this :

sh /usr/share/toaster/isoqlog/bin/cron.sh

Commands that can be used:

qmailctl stat
/home/vpopmail/bin/vadddomain domain.com password
/home/vpopmail/bin/vadduser user@domain.com password
/home/vpopmail/bin/vmoddomlimits -S domain.com // view domain limits
/home/vpopmail/bin/vpasswd // change pass
/home/vpopmail/bin/vmoduser // modify user stats

Install FFmpeg and FFmpeg-php on Centos 5 and Plesk

July 22nd, 2010

Run :

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum -y install ffmpeg ffmpeg-devel mplayer mencoder flvtool2
cd /usr/src
Download http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar jxvf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
phpize
./configure
make
make install

Edit /etc/php.ini and add :

extension=ffmpeg.so

and then:

service httpd restart

Update php in Plesk

July 22nd, 2010

Run:

Download http://www.atomicorp.com/installers/atomic.sh
sh atomic.sh
yum update php

Fedora (Goddard) 13 Released

May 26th, 2010

Release notes in here:

http://fedoraproject.org/wiki/Fedora_13_Announcement


Feature List

Repair a Mysql database

May 25th, 2010

When we try to repair a MySQL database we can stop the service. If you are using the MyISAM engine I recommend using myisamchk. A basic repair sentence could be like this:

myisamchk -r -q -p -v –sort_buffer_size=2000M /var/lib/mysql/database/table.MYI

The used parameters are the following:

* -r recovery mode
* -q quick recovery, the most common one. If this mode does not work you will have to make some research on your own.
* -p creates the keys to be repared in parallel threads.
* -v verbose mode
* –sort_buffer_size= use this to indicate the size of the buffer to sort the keys. If you do not specify this value, or the value you specify is too small, then you will see something like this myisamchk: error: myisam_sort_buffer_size is too small. To solve this just increment the size of the buffer to be used, if the error always appear then you have a extremely big table.

Clone an EC2 instance

May 25th, 2010

These days Amazon sent me an email saying that the a instance that I’m using is on a server that is
failing. To clone I had to:

1. Install ec2-api-tools from http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip on the failing instance
2. Install Java from http://javadl.sun.com/webapps/download/AutoDL?BundleId=39484 (I’m using a small instance)
3. Set .bashrc as follows:

export EC2_HOME=~/ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=$EC2_HOME/pk.pem
export EC2_CERT=$EC2_HOME/cert.pem
export JAVA_HOME=/usr

Run :

source /root/.bashrc

4. Create a directory for the bundled files (/mnt/myimage in my case)
5. Bundle the actual instance using:

ec2-bundle-vol –cert ec2/cert.pem –privatekey ec2/pk.pem -s 2048 -u Your_AWS_Account_ID -d /mnt/myimage/

-u : AWS Account ID is taken from AWS page Security Credentials, e.g: 1234-5678-9012-3456. Make sure to skip the “-” when using it.
-s : size of the image
-d : directory from step 4

6. Upload the files to a S3 account using:

ec2-upload-bundle -a access_key -s secret_key -b bucket_name –manifest /mnt/myimage/image.manifest.xml

-a : access_key from Security Credentials page
-s : secret_key from Security Credentials page
-b : bucket name
–manifest : name of the manifest file

7. Register the AMI by going to your AWS EC2 console->AMI->Images->Register new AMI and enter:
bucket_name/image.manifest.xml
8. Create a new EC2 instance by using the newly registered AMI

Note that you will need the [pk,cert].pem files too.

Install Dante socks proxy

May 24th, 2010

Dante socks install :

Download Dante from : ftp://ftp.inet.no/pub/socks/dante-1.2.0.tar.gz

tar zxvf dante-1.2.0.tar.gz
cd dante-1.2.0
yum install gcc make
./configure
make -j4
make install

ifconfig -a |  grep inet | awk ‘{print $2}’ | awk -F ‘:’ ‘{print $2}’ | grep -v 127.0.0.1 >  /root/ips

for i in `cat ips` ;do echo “internal: $i port = 6060″ >> /root/sockd.conf ;done

Example of sockd.conf :

logoutput: stderr
method: username none
external: externalIPtouse
client pass {
from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
}
pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
method: username
protocol: tcp udp
}

Launch using :

sockd -f /root/sockd.conf -d

How much disk space a database takes?

May 24th, 2010

Login to mysql and run :

select SUM(data_length) + SUM(index_length) as size from information_schema.tables where table_schema = ‘your_database’;

Remove core files in cPanel

May 17th, 2010

One client has : 11.25.0-E43770 – WHM 11.25.0 – X 3.9 and seems that a lot of core files are create in /root or /usr/local/cpanel/install/ or /usr/local/cpanel/whostmgr/docroot/

To erase the core files just run :

updatedb && locate -r /core\.[0-9] | xargs rm -fv

Also verify if /etc/init.d/httpd has :

ulimit -c 0

Skip i386 packages on a x64_86 system

May 17th, 2010

I have just installed Centos 5.5 by using the Netinstall version. Seems that on my x64_86 system I have a lot of i386 packages installed. To remove them I had to :

yum -C list installed | grep i386 | awk ‘{print $1}’ | xargs yum remove -y

Also edit /etc/yum.conf and add :

exclude=*.i386 *.i486 *.i586 *.i686 *.athlon