Skip to content

Instantly share code, notes, and snippets.

View ravibhure's full-sized avatar

Ravi ravibhure

View GitHub Profile
@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 <[email protected]>
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 / Install_ruby.sh
Last active August 29, 2015 14:06
Install ruby using rvm
#!/bin/bash
# Author: Ravi Bhure <[email protected]>
# 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 / Git_Cheatsheet.md
Created September 2, 2014 16:15
Git Cheatsheet
#!/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 / 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
#!/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
!/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 / vagrant_centos_ubuntu
Last active August 29, 2015 14:02
Vagrant on CentOS and Ubuntu
Setup Vagrant and a small quick start
Setup Vagrant and a small quick-start I had troubles with an regular VM so i installed vagrant :), this is what i have done. And installed Vagrant like described here.
================================================
For Ubuntu --
URL: http://vagrantup.com/docs/getting-started/setup/ubuntu.html
Or follow the instructions here:
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "Centos6.4"
BOX_URI = ENV['BOX_URI'] || "http://shonky.info/centos64.box"
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
@ravibhure
ravibhure / fortune
Created June 3, 2014 09:36 — forked from jhass/fortune
#!/usr/bin/env python
# -*- coding: utf8
from random import choice
fortunes = ["“Welcome” is a powerful word.",
"A dubious friend may be an enemy in camouflage.",
"A feather in the hand is better than a bird in the air. (2)",
"A fresh start will put you on your way.",
"A friend asks only for your time not your money.",
"A friend is a present you give yourself.",
"A gambler not only will lose what he has, but also will lose what he doesn’t have.",