Skip to content

Instantly share code, notes, and snippets.

View ravibhure's full-sized avatar

Ravi ravibhure

View GitHub Profile
@ravibhure
ravibhure / ruby.1.9.3-setup.sh
Created May 2, 2013 09:56
Install ruby 1.9.3 on CentOS
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
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
ravibhure / python.2.7.3-setup.sh
Last active December 16, 2015 21:39
Install python 2.7.3 on CentOS
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
yum -y groupinstall "Development tools"
yum -y install zlib-devel
yum -y install bzip2-devel openssl-devel ncurses-devel sqlite-devel mysql-devel
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
if [ ! -f Python-2.7.3.tar.bz2 ] ;then
echo "Python-2.7.3.tar.bz2 not found"
@ravibhure
ravibhure / create_mysql_user.sh
Created May 2, 2013 10:36
create user in mysql database
#!/bin/bash
#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
ravibhure / gist:5540093
Created May 8, 2013 12:20
Install RMagick ruby gem
# http://stackoverflow.com/questions/1254366/problem-installing-rmagick-rubygem-on-centos-5/7766705#7766705
# 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 http://www.zacharywhitley.com/linux/rpms/fedora/core/6/i386/msttcorefonts-2.0-1.noarch.rpm
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
ravibhure / table_view
Created September 27, 2013 07:26
table view on terminal from json output
#!/usr/bin/env ruby
require 'rubygems'
require 'terminal-table'
require 'json'
rows = []
data = JSON.parse(ARGF.read)
@ravibhure
ravibhure / chef_server_install.sh
Created October 24, 2013 10:21
Hands off installation of chef server + nginx https proxy on ubuntu
#!/bin/bash
CHEF_SERVER_WEBUI_PASS=webui_admin_pass
CHEF_AMQP_PASS=amqp_pass
CHEF_FQDN=chef.yourdomain.com
CHEF_URL=https://${CHEF_FQDN}
export DEBIAN_FRONTEND=noninteractive
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
@ravibhure
ravibhure / gist:7523642
Created November 18, 2013 06:47
HAProxy config for wordpress
# HAProxy config to block /wp-login.php and wp-admin POST method on wordpress webserver
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 25000
#debug
#quiet
user prod
group prod
---
# ^^^ 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 (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

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