Skip to main content

Posts

Showing posts with the label Linux

Perl - Database Transactions

Database Transactions with Perl To understand what is a database transaction lets look at a simple bank withdrawal and deposit scenario. Assume that you have two bank accounts call A and B, and you need withdraw some amount from account A and Deposit it on account B. In this scenario what happen if you couldn't withdraw money from your account A, the deposit part won't carry out. Again if you couldn't deposit the money to your account B you have to deposit them back on account A (Which means a roll back). So in the  context of Database, Transaction is refer to  a sequence of jobs which is supposed to run as a whole. So in other words, it should happen as whole or not. So as in our following example, we have 3 Database queries which should perform as a whole. Further assume that our first Database query is supposed to perform a insert if successful, second query  should update a table if successful, third query  should delete an entry from a ...

HAProxy

HAProxy implementation Case Study This tutorial covers HAProxy Deployment on Firewall and SELinux enabled Centos7 systems. First of all lets get an overall idea about my situation.  I've bought a domain call mycompany.com so all of my  hosted sites should be followed by this main domain. As an example, if someone look for london.mycompany.com he should reach to London server, if someone look for chicago.mycompany.com he should reach to Chicago server So, I've created a Cloudflare account and point mycompany.com to our public IP address and created two                 CNAME entries from Cloudflare by adding London and Chicago. From the Cloudflare all the request to mycompany.com will forward to our public address and HAProxy may read those requests and Process them and forward them accordingly between two IIS servers. Note that al...

FreePBX-Installation

FreePBX-Installation 1. Pre-installation In order to setup call center server first we have to confirm that our system is full filled the minimum requirements. This asterisk deployment is based on RedHat distribution aka CentOS.  To full-fill the above requirement we are going to setup asterisk 11 on CentOS 6.5 (x64). 1.2 CentOS 6.5x64 installation  It is recommended to install CentOS 6.5x64 minimum version and manually install all the other package as our requirement.  At the beginning it recommended to configure the logical disk drives aka Raid.  Note that some of the server-rigs will not compatible to centos 6.5x64, most of the time it’s because the particular server’s Raid drivers might not be found in centos 6.5x64 disk. In such scenario please follow the below instruction. First we have to download the Raid driver from relevant vendor. (If it’s HP you will find somewhat like this hpvsa-X.X.X-X.rhel6u.5x86_64.dd). ...

RSYNC

RSYNC  is one of the most popular File Copying/Synchronizing service among Linux people. Its synchronizing while copping and consume Less network resources for its operations. CAUTION!!!! Miss use may cause original data overwrite or deletion. As an example, here in iPhonik ( iPhonik was formed as a company in the business of developing an Unified Communication Solution product and related services. ) we use rsync to take realtime backups and duplicate them on the redundant servers. Call recording which stores in the real-time server will be synchronized/ copied to the redundant server (We are using NFS as the file sharing mechanism share-directory-between-two-server-nfs  ).   How to USE Most of the time your Linux distributions comes with the installed rsync service but if you don’t have installed rsync on your Linux distribution, Debian distributions apt-get install rsync   RedHat distributions yum install rsync Now if you wish t...

Service-Start-Linux

Service-Start-Linux Click Here to Download zip Author ::krishees@gmail.com Features, Check the status of the given services (as a command line argument) and if that particular service is in down status./checksrv.sh <service> program can turn up the particular service. ======================================================================= pattern-> ./checksrv.sh <service-1> <service-2>.....<service-n> ex-> for httpd and mysqld ./checksrv.sh httpd mysqld ======================================================================= Usage-> Using crontab (crontab -e) * * * * * ./checksrv.sh <service> Check the status of the service every 60 seconds and if the particular service not up then the ./checksrv.sh will bring up the particular services ------------------------------------------------------------------------ Using inittab (/etc/inittab) Check the status of a service a...