Wednesday, January 9, 2013

multipath config



# This is a basic configuration file with some examples, for device mapper
# multipath.
# For a complete list of the default configuration values, see
# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.defaults
# For a list of configuration options with descriptions, see
# /usr/share/doc/device-mapper-multipath-0.4.7/multipath.conf.annotated


# Blacklist all devices by default. Remove this to enable multipathing
# on the default devices.
#blacklist {
#        devnode "*"
#}

#blacklist {
 #      devnode "sdc"
#}



## By default, devices with vendor = "IBM" and product = "S/390.*" are
## blacklisted. To enable mulitpathing on these devies, uncomment the
## following lines.
#blacklist_exceptions {
#       device {
#               vendor  "IBM"
#               product "S/390.*"
#       }
#}

## Use user friendly names, instead of using WWIDs as names.
defaults {
        user_friendly_names yes
}
##
## Here is an example of how to configure some standard options.
##
#
#defaults {
#       multipath_tool  "/sbin/multipath -v0"
#       udev_dir        /dev
#       polling_interval 10
#       default_selector        "round-robin 0"
#       default_path_grouping_policy    failover
#       default_getuid_callout  "/sbin/scsi_id -g -u -s /block/%n"
#       default_prio_callout    "/bin/true"
#       default_features        "0"
#       rr_min_io              100
#       failback                immediate
#}
defaults {
       udev_dir                /dev
       polling_interval        10
       selector                "round-robin 0"
       path_grouping_policy    multibus
       getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
       prio_callout            /bin/true
       path_checker            readsector0
       rr_min_io               100
       max_fds                 8192
       rr_weight               priorities
       failback                immediate
       no_path_retry           fail
}

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