mysql -u $user -p$pass -h $dbhost $db -e “show tables” | grep -v Tables_in | grep -v “+” | awk ‘{print “drop table ” $1 “;”}’ | mysql -u $user -p$pass -h $dbhost $db
Creating a local git repo and push it to remote server
Quite often I forget the git quirks.. No, I don’t use github or beanstalk. Personally, I would like to manage my own code and my customer’s code rather than just pushing to a public repo.
Having said that I always create a remote repo of my local repo. And here is the workflow I use:
1) Create your local repo in the directory
git init
2) Add some files
git add Resources
3) In remote server also create the directory and initialise a git repo (git init)
4) In local directory, edit your git config file – to add the remote location (edit file .git/config)
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://username@yourserver.com:22/path_created_in_step_3/.git
5) You should now be able to push to remote location
git push origin master
Compiling PHP 5.2.X on Redhat Linux
I love yum!! But I also hate how you can’t install previous version of software sometime.
Because of Zend dependency and PHP 5.2.x I recently hit a problem where I couldn’t install it via yum. All yum repo’s only had PHP 5.3.x . I specifically need 5.2.10+. Not only that, I needed extensions like gd, soap, mbstring, mhash, mcrypt extra. Anyway, after a lot of trial and error, I finally got it working. Here are my list of commands (For a 64-bit Centos).
- Get PHP source from http://www.php.net/downloads.php
- Untar and go into directory
tar -xvf php-5.2.13.tar ; cd php-5.2.13
- You can just compile with
./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-mime-magic=/usr/share/file/magic' '--with-apxs2=/usr/sbin/apxs' '--enable-soap' '--with-gd' '--enable-dom' '--disable-dba' '--without-unixODBC' '--enable-pdo' '--enable-xmlreader' '--enable-xmlwriter' '--without-sqlite' '--enable-json' '--without-pspell' '--enable-wddx' '--with-curl' '--enable-mbstring=all' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' '--with-mcrypt' '--with-mhash' '--with-mysql' '--enable-mysqli' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr/bin/mysql_config' '--with-xsl' '--with-zip'
- However you will find that lot of libraries are not there
. Anyway, these are the list of items you require
yum install -y mod_ssl.x86_64
yum install -y openssl-devel.x86_64
yum install -y crypto-utils.x86_64
yum install -y gcc
yum install -y make
yum install -y perl
yum install -y httpd-devel
yum install -y libxml2-devel.x86_64
yum install -y bzip2-devel.x86_64
yum install -y gmp-devel.x86_64
yum install -y mysql-devel
yum install -ycurl-devel
yum install -y mcrypt
yum install -y zip
yum install -y gd-devel.x86_64
yum install -y t1lib-devel.x86_64
yum install -y libmcrypt-devel.x86_64
yum install -y libmhash-devel.x86_64
yum install -y libxslt-devel.x86_64
yum install -y libtool-ltdl-devel
- You will have a problem with mhash for sure… Now you need to download, compile and install it seperately
wget "http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2F&ts=1303806016&use_mirror=sunet"
bunzip2 mhash-0.9.9.9.tar.bz2
tar -xvf mhash-0.9.9.9.tar
cd mhash-0.9.9.9
./configure
make
make install
cd lib
make install
- At this point, I had some difficulty in getting the mash library at the right place. Anyway, Looking at the install script of mhash, I realized that it’s going to /usr/lib/local when it needs to go to /usr/lib64 . Simple fix
cd /usr/local/lib
cp -R * /usr/lib64/
- Final compile!!
./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-mime-magic=/usr/share/file/magic' '--with-apxs2=/usr/sbin/apxs' '--enable-soap' '--with-gd' '--enable-dom' '--disable-dba' '--without-unixODBC' '--enable-pdo' '--enable-xmlreader' '--enable-xmlwriter' '--without-sqlite' '--enable-json' '--without-pspell' '--enable-wddx' '--with-curl' '--enable-mbstring=all' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' '--with-mcrypt' '--with-mhash' '--with-mysql' '--enable-mysqli' '--with-mysqli=/usr/bin/mysql_config' '--with-pdo-mysql=/usr/bin/mysql_config' '--with-xsl' '--with-zip'
make clean
make
make install
service httpd restart
LightSpeed webstore: store in filesystem vs database
Seriously Guys!!!
Please store your images in filesystem. It will serve 5 times faster than being in database.
And don’t waste precious database space on images either !
Magento MoneyWorks Link
I have been getting quite a lot of requests to do a Magento-MoneyWorks link.
Given that MoneyWorks 6 now support images, I don’t see why we couldn’t just have the perfect link!!!
Anyway, I need at least 15 expression of interests before I allocate some development time towards. So shout me if you guys want this developed!!
I have already done many links which are working just fine.. E.g. http://corbanblair.com.au does hundreds of Web Orders to MoneyWorks download every week!
The link will allow you to:
- Download customers
- Download orders as sales order
- Upload product stock
New Site is finally live!
We have waited three years to do this!
But finally our new site is live… Let us know what you guys think