Skip to content

Instantly share code, notes, and snippets.

View ravibhure's full-sized avatar

Ravi ravibhure

View GitHub Profile
#!/bin/bash
### BEGIN INIT INFO
# INIT INFO
# Provides: docker
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: docker
@ravibhure
ravibhure / docker_centos
Last active December 7, 2018 17:57
Docker for CentOS
# Disable selinux as it interferes with functionality of LXC
$ setenforce 0
$ echo 'SELINUX=disabled' > /etc/selinux/config
# Download and setup Fedora EPEL Repository
$ yum -y install http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
# Setup hop5.in repository
$ wget http://www.hop5.in/yum/el6/hop5.repo -O /etc/yum.repos.d/hop5.repo
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Just an example, how to create a ansible module ;)
from ansible.module_utils.basic import *
DOCUMENTATION = '''
---
module: public_key
@ravibhure
ravibhure / Git_Cheatsheet.md
Created September 2, 2014 16:15
Git Cheatsheet
@ravibhure
ravibhure / Install_ruby.sh
Last active August 29, 2015 14:06
Install ruby using rvm
#!/bin/bash
# Author: Ravi Bhure <ravibhure@gmail.com>
# Ref: http://rvm.io/rubies/installing
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm -O /tmp/epel.rpm
rpm -ivh /tmp/epel.rpm
# We need to install all required packages for ruby installation on our system using following command
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel
@ravibhure
ravibhure / chef_meta_parser.rb
Created September 11, 2014 03:50
Chef metadata parser to show dependancies
#!/usr/bin/env ruby
# @Author: Ravi Bhure <ravibhure@gmail.com>
require 'chef/cookbook/metadata'
metadata_file = ARGV.first || 'metadata.rb'
# read in metadata
metadata = Chef::Cookbook::Metadata.new
metadata.from_file(metadata_file)
@ravibhure
ravibhure / python_resource.md
Last active August 29, 2015 14:06
Just an example
  1. Create new cookbook example

     knife cookbook create example
    
  2. Create file name foo.py, Open Editor for examples/files/default/foo.py

     #!/usr/bin/python
     # Author: Sanjay Lokhande <sanjay.lokhande@opexsoftware.com>
    

import os

@ravibhure
ravibhure / db_backup.sh
Created October 14, 2014 06:54
Back up, compress and encrypt a small MySQL Database
#!/bin/bash
# Author: Ravi Bhure <ravibhure@gmail.com>
# Date: 13/10/2014
# This script dumps a "orders" database, compresses, encrypts and timestamps it, then saves it to netapp storage local mount. Ideal for a cronjob.
# It uses symmetric encryption, so guard your password carefully.
#
# NOT RECOMMENDED FOR LARGE DATABASES!
# Set your variable..
my_server=db.example.com
@ravibhure
ravibhure / jvm_tools.md
Created November 3, 2014 05:05
Some ( not all ) helpful tools the jvm provides out of the box
  • hprof a builtin java agent which dumps profiling info at runtime
  • class sharing class file cache used for faster startup times
  • pack200 unpack200 uber packed jars
  • mission control a Profiling, Monitoring, and Diagnostics Tools Suite
  • jstat performance stats tool
  • jhat heap dump browser
  • jmap memory maps
  • jstack prints stack trace of running process
@ravibhure
ravibhure / installing-rabbitmq-centos6.3-minimal.md
Created November 4, 2014 15:55
Installing RabbitMQ on CentOS 6

Installing RabbitMQ on CentOS 6.3 Minimal

This tutorial will demonstrate how to install RabbitMQ 3.x on CentOS 6.3 ("minimal" profile).

This install was performed using VMWare Fusion on OSX, but should demonstrate the process on most environments using Linux-supported drivers. The virtual was 1-core, 1.6GB RAM, 6GB HDD space; I did not use the quick setup VMWare offers.

There are two ways of installing RabbitMQ on CentOS. The ways differ based on which distribution of Erlang you chose to use (the one out of EPEL or a later version from Erlang Solutions). We will demonstrate both ways in this example.

One of the goals of this tutorial is to not install anymore software than needed. We will use "vi" instead of "pico" or "nano" because that's what's bundled with CentOS minimal profile. If you would rather use another text editor, please install it on your own.