Category Archives: Server-side Scripting.

Server-side Scripting.

How to setup cassandra on Ubuntu 14.04

What is Cassandra? The Apache Cassandra database is the right choice when you need scalability and high availability without compromising performance. Linear scalability and proven fault-tolerance on commodity hardware or cloud infrastructure make it the perfect platform for mission-critical data.Cassandra’s … Continue reading

Posted in Cassandra, Php, Uncategorized | Tagged | Leave a comment

Killing child process in shell script

Killing child process in shell script: Many time we need to kill child process which are hanged or block for some reason. eg. FTP connection issue. There are two approaches, 1) To create separate new parent for each child which … Continue reading

Posted in Shell Script | Tagged | Leave a comment

Setup solr using zookeeper ensemble on ubnutu

Setup Oracle Java: Follow quick step given below to setup java latest version on your system, java -version tar -zxvf jdk-8u45-linux-x64.tar.gz sudo mkdir -p /usr/lib/jvm/jdk1.8.0_45 sudo mv jdk1.8.0_45/* /usr/lib/jvm/jdk1.8.0_45/ sudo update-alternatives –install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.8.0_45/bin/java” 1 sudo update-alternatives –install “/usr/bin/javac” … Continue reading

Posted in Java, Solr, Uncategorized, Zookeeper | Tagged , , | Leave a comment

PHP multiprocessing using fork

PHP multiprocessing using fork: Process Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination. Find more details at PHP fork The pcntl_fork() function creates a child process that differs from the … Continue reading

Posted in Php | Leave a comment

Shell script multi-processing

Shell script multi processing : Multi processing using shell script can be achieve by spawning multiple child processes. There are two method , 1) Using commands as string : #!/bin/bash declare -a NOS=(1 2 3 5 6 7 8); STR=”{ … Continue reading

Posted in Shell Script | Tagged | Leave a comment

Install erlang on ubuntu

Install erlang on ubuntu : Remove older erlang if any : #sudo apt-get remove erlang #sudo apt-get autoremove erlang #sudo apt-get purge erlang Installation using repository : #sudo apt-get install erlang erlang-doc Manual Installation using repository : Download Erlang 1. … Continue reading

Posted in Erlang | Tagged , | Leave a comment

Git deployment shell script

Git deployment shell script Following shell script can be useful for deplying git branch on multiple servers. #!/bin/bash DIR=”$( cd “$( dirname “${BASH_SOURCE[0]}” )” && pwd )” HN=$(hostname) declare -A SERVER; SERVER["app1"]=”ubuntu@111.111.111.11″; SERVER["app12"]=”ubuntu@222.222.222.22″; SERVER["mongo1"]=”ubuntu@333.333.333.33″; SERVER["mongo12"]=”ubuntu@333.333.333.33″; SERVER["lb1"]=”ubuntu@444.444.444.44″; SERVER["lb12"]=”ubuntu@555.555.555.55″; usage() { local … Continue reading

Posted in Revision control, Shell Script | Tagged , | Leave a comment

Configuration Deployment script

Configuration Deployment script : Following configuration deployment script can be use to deploy git ignored configuration files on multiple server. #!/bin/bash set -e DIR=$(pwd); HST_NAM=$(hostname); CNF_FLR=$DIR”/configs”; KOH_CNF_FIL=”environment.php”; SYM_CNF_FIL=”parameters.yml”; KOH_SER_CNF_PHT=”/var/www/frontend/application/config/”; KOH_STG_SER_CNF_PHT=”/var/www/frontendstaging/application/config/”; SYM_SER_CNF_PHT=”/var/www/backend/Symfony/app/config/”; SYM_STG_SER_CNF_PHT=”/var/www/backendstaging/Symfony/app/config/”; SYM_STG_APP_SER_CNF_PHT=”/var/www/backendappstaging/Symfony/app/config/”; FLAG=”d”; HIP_CHAT_MEG=”"; SEP=”"; usage() { local COMMAND_COLOR=”\033[32m”; … Continue reading

Posted in Shell Script | Tagged | Leave a comment

Gearman shell script

Gearman shell script : This is gearman worker server demo script for getting job done from workers on distributed systems. Scripts generate pdf report using wkhtmltopdf utility and upload them to S3 server. Symphony command : app/console company:command pdf-report /tmp/gearman/wkhtmltopdf/pdfs … Continue reading

Posted in Gearman, Shell Script | Tagged , | Leave a comment

Php solr Integration

Installing Apache Solr PHP extension On Linux and other *nix-based systems There are two ways to install the Solr PECL library on *nix systems: 1) Using the pecl command. 2) Configuring and installing it manually. Using the pecl command Install … Continue reading

Posted in Php, Solr | Tagged , | Leave a comment