Tuesday, December 4, 2012

Encrypt a Tar Archive with OpenSSL


$ openssl des3 -salt -in unencrypted-data.tar \
-out encrypted-data.tar.des3
enter des-ede3-cbc encryption password:
Verifying - enter des-ede3-cbc encryption password: 


To unlock the encrypted file, use the following command:
$ openssl des3 -d -salt -in encrypted-data.tar.des3 \
-out unencrypted-data.tar
enter des-ede3-cbc encryption password: 


Monday, December 3, 2012

Postfix | Set postfix to read host file

 lmtp_host_lookup = native  
 smtp_host_lookup=native  
 #disable_dns_lookups = yes  
 ignore_mx_lookup_error = yes  

Tuesday, October 16, 2012

MySQL | drop / truncate all tables


drop

mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "drop table $table" DATABASE_NAME; done

truncate

mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done

Monday, October 1, 2012

Zend Loader | Install repo

 wget -q -O - http://www.atomicorp.com/installers/atomic | sh  
 yum -y install php-zend-guard-loader  

Friday, September 28, 2012

Python 2.7.3 | Installation and configuration with zeromq, sqlite, easy_install, pip


yum -y groupinstall 'Development Tools'
yum -y install openssl-devel* zlib*

yum install uuid uuid-devel libuuid libuuid-devel

download and install install zmq

wget http://download.zeromq.org/zeromq-2.2.0.tar.gz
wget http://www.sqlite.org/sqlite-autoconf-3071201.tar.gz
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg


tar xzvf sqlite
cd sqlite
./configure
make && make install

tar xzvf Python
cd Python
./configure --prefix=/opt/python2.7.3 --with-threads --enable-shared

make && make install

vim .bash_profile
-----
alias python='/opt/python2.7.3/bin/python'
alias python2.7.3='/opt/python2.7.3/bin/python'

PATH=$PATH:$HOME/bin:/opt/python2.7.3/bin
-----
source .bash_profile

vim /etc/ld.so.conf.d/opt-python2.7.3.conf
/opt/python2.7.3/lib

ldconfig

sh setuptools

cd /opt/python2.7.3/lib/python2.7/config/
ln -s ../../libpython2.7.so .
------------------------------
easy_install pip
MySQL-python==1.2.3
SQLAlchemy==0.7.7
colorama==0.2.4
python-cloudfiles==1.7.10
pyzmq==2.2.0
redis==2.6.2


pip install MySQL-python SQLAlchemy colorama python-cloudfiles pyzmq redis requests wsgiref




Monday, September 3, 2012

Friday, August 31, 2012

Mysql: Reset slave replication



stop slave;
reset slave;

CHANGE MASTER TO MASTER_HOST='10.250.1.33', MASTER_USER='replication', MASTER_PASSWORD='replipass', MASTER_LOG_FILE='mysql-bin-log.000012', MASTER_LOG_POS=107;

start slave;