Skip to content

Instantly share code, notes, and snippets.

ravibhure /
Created May 2, 2013
Install ruby 1.9.3 on CentOS
#!/usr/bin/env bash
# repository
cd /tmp
rpm -Uvh epel-release-6-7.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
ravibhure /
Last active Dec 16, 2015
Install python 2.7.3 on CentOS
# Source:
yum -y groupinstall "Development tools"
yum -y install zlib-devel
yum -y install bzip2-devel openssl-devel ncurses-devel sqlite-devel mysql-devel
if [ ! -f Python-2.7.3.tar.bz2 ] ;then
echo "Python-2.7.3.tar.bz2 not found"
ravibhure /
Created May 2, 2013
create user in mysql database
#Ask user to enter database name and save input to dbname variable
read -p "Please Enter Database Name:" dbname
#checking if database exist
mysql -Bse "USE $dbname" 2> /dev/null
#if database exist:
if [ $? -eq 0 ]; then
ravibhure / gist:5540093
Created May 8, 2013
Install RMagick ruby gem
View gist:5540093
# Uninstalled ImageMagick 6.5.4-9 and the delegate libraries that I had installed from source
yum install ImageMagick
yum install ImageMagick-devel
curl -O
rpm -ivh msttcorefonts-2.0-1.noarch.rpm
ln -s /usr/share/fonts/msttcorefonts/ /usr/share/fonts/default/TrueType
gem install rmagick -v 1.15.17 --no-rdoc --no-ri
ravibhure / table_view
Created Sep 27, 2013
table view on terminal from json output
View table_view
#!/usr/bin/env ruby
require 'rubygems'
require 'terminal-table'
require 'json'
rows = []
data = JSON.parse(
ravibhure /
Created Oct 24, 2013
Hands off installation of chef server + nginx https proxy on ubuntu
export DEBIAN_FRONTEND=noninteractive
echo "deb `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
ravibhure / gist:7523642
Created Nov 18, 2013
HAProxy config for wordpress
View gist:7523642
# HAProxy config to block /wp-login.php and wp-admin POST method on wordpress webserver
log local0
log local1 notice
#log loghost local0 info
maxconn 25000
user prod
group prod
View pedantically_commented_playbook.yml
# ^^^ YAML documents must begin with the document separator "---"
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang ( It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].


When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes


My ansible approach

Per service playbooks

Playbooks are written per service : a playbook is a collection of tasks, and eventually associated handers, templates, and files, that are required to properly install and setup a service.

Each playbook has a setup.yml entry point, which is responsible of including various necessary tasks to get the service up and running. Typically, this