Backup mysql database to amazon S3

Below is the simple code to create sql script of database on Amazon EC2 server using “mysqldump”… then upload this sql script to Amazon S3 bucket using command line S3 tool “s3cmd”… <?php $sqlbackup=”/usr/bin/mysqldump -v -u root -h localhost -r /var/www/html/backup/”.date(“Y-m-d-H-i-s”).”_db.sql -pdbusername  databasename 2>&1″; exec($sqlbackup, $o); echo implode(“<br /> “, $o); $file = “/var/www/html/backup/”.date(“Y-m-d-H-i-s”).”_db.sql”; $bucket = “s3bucketname”; exec(“/usr/bin/s3cmd  put –acl-public –guess-mime-type  –config=/var/www/html/.s3cfg   “.$file.”  s3://”.$bucket.”  2>&1″, $o); echo implode(“<br /> “, $o); ?> 0 */12 * * * env php -q /var/www/html/s3bkup/s3bkup.php > /dev/null 2>&1 (per 12 … Read more

Installing XAMPP in Linux

What is XAMPP ? XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. LAMPP (XAMPP for Linux) is very easy to install and to use – just download, extract and start. Download XAMPP http://sourceforge.net/projects/xampp/files/XAMPP Linux/ Installing XAMPP in Linux Download XAMPP Latest version from the following link http://sourceforge.net/projects/xampp/files/XAMPP Linux Currently latest … Read more

Install RED5 with java tomcat on linux

Red5 is an Open Source Flash Server written in Java that supports: Streaming Audio/Video (FLV, h264, AAC, and MP3) Recording Client Streams (FLV only) Shared Objects Live Stream Publishing Remoting (AMF) export variables in /etc/bashrc to become available for every user login or for any terminal opens. echo “export ANT_HOME=/usr/local/ant” >> /etc/bashrc echo “export JAVA_HOME=/usr/lib/jvm/java” … Read more

Linux Mail Servers

Manual Settings ~~~~~~~~~~~~ Mail Server Username: no-reply+domain.com Incoming Mail Server: mail.domain.com Incoming Mail Server: (SSL) host200.hostmonster.com Outgoing Mail Server: mail.domain.com (server requires authentication) port 26 Outgoing Mail Server: (SSL) host200.hostmonster.com (server requires authentication) port 465 Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS (SSL/TLS) Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS) Warning: Changing MX … Read more

Amazon EBS

Amazon Elastic Block Storage (EBS) We can use Amazon EBS just like as the CD/DVD/Pen Drives on our PC/Laptops Servers for backup or data transfer… EBS can attach to an EC2 instance, we can use EBS to save work files in it.. for it we have to mount it in the instance after backup we … Read more

Crontab Command Line

Crontab Command Line 1. dump the content of the existing crontab to a file # crontab > /tmp/dump 2. echo “your lines” >> to the corntab file # echo ” 00 1 * * * /monitor_file_system 2>/dev/null” >> /tmp/dump 3. import the new crontab # crontab /tmp/dump other option…. # crontab -e It will open … Read more

Couldn’t find video filter ‘x264’

x264 is a free software library for encoding video streams into the H.264/MPEG-4 AVC format. It is released under the terms of the GNU General Public License. x264 itself provides a command line interface as well as a library-level interface. x264 is used to encode video files in mp4, m4v, h.264 (HD) output format. Install … Read more

sh: /mencoder: No such file or directory

This is the problem caused due to PHP safe_mode restrictions to execute linux commands. If safe mode is on we can not run linux commands by exec() PHP function. Try safe mode Off when you want to execute linux tools with PHP…. Disable dangerous function from executing to exec().. that will cause application non functional … Read more

Create TCPDF PHP Fonts

TCPDF supports TrueTypeUnicode (UTF-8 Unicode), OpenTypeUnicode, TrueType, OpenType, Type1, CID-0 and Core (standard) fonts. You will find font creation utility at fonts/utils of TCPDF… copy desired font to fonts/utils/svnlabs.ttf * For TrueTypeUnicode # cd /var/www/html/tcpdf/fonts/utils # ttf2ufm -a -F svnlabs.ttf # php -q makefont.php svnlabs.ttf svnlabs.ufm * For embedded fonts to tcpdf PDF file.. copy … Read more

Exclude folders from zip – tar

TAR – Tape Archive  (application/x-tar) A common archive format used on Unix-like systems. Generally used in conjunction with compressors such as gzip, bzip2, compress or xz to create .tar.gz, .tar.bz2, .tar.Z or tar.xz files. # tar -cvvf foo.tar foo/ –exclude=”/home/svnlabs” # tar -cvzpP –file=/home/backup.tar.gz –exclude={/dev/*,/proc/*,/sys/*,/tmp/*} / tar work with directory “/” except for /dev, /proc, … Read more