Skip to content

Instantly share code, notes, and snippets.

View ravibhure's full-sized avatar

Ravi ravibhure

View GitHub Profile
@ravibhure
ravibhure / config.yml
Created October 28, 2015 13:09 — forked from pkuczynski/LICENSE
Read YAML file from Bash script
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
@ravibhure
ravibhure / base.rb
Created January 12, 2016 10:55 — forked from jtimberman/base.rb
an example roles/base.rb
name "base"
description "Baseline configuration for all systems."
run_list(
"recipe[ohai]",
"recipe[chef-client::delete_validation]",
"recipe[chef-client]",
"recipe[zsh]",
"recipe[git]",
"recipe[users]",
@ravibhure
ravibhure / Ansible-Vault how-to.md
Created March 21, 2016 13:45 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@ravibhure
ravibhure / ansibleready.sh
Created April 15, 2016 09:50
Install ansible agent package :)
#!/bin/bash
# ansible -i hosts all -m raw -a " curl -s -L http://gist.github.com/ravibhure/ansibleready.sh | bash" -k
apt-get update
apt-get -y install software-properties-common git python-crypto sshpass python-pip libssl-dev openssl
pip install --upgrade pip
@ravibhure
ravibhure / README.md
Created April 29, 2016 12:15 — forked from trinitronx/README.md
A shell script to install latest Ansible via pip + dependencies

omnibus-ansible

Install latest Ansible via pip + dependencies via a shell script

This file is used to install ansible in test kitchen when you set in the kitchen.yaml file

require_ansible_omnibus: true

By default test kitchen will always download and use the latest version of this install file.

WARNING: AS SOON AS YOU MERGE CODE HERE IT IS INSTANTLY AVAILABLE TO EVERYONE DOING OMNIBUS KITCHEN ANSIBLE INSTALLS:

@ravibhure
ravibhure / openconnect-7-ubuntu-build.md
Created August 5, 2016 05:45 — forked from darrenpmeyer/openconnect-7-ubuntu-build.md
Building OpenConnect 7 on Ubuntu 14 (trusty) and 15 (vivid)

Building OpenConnect 7 on Ubuntu 14 (trusty) and 15 (vivid)

The steps in this guide are available as an autobuild shell script

Why?

Because the OpenConnect package from Ubuntu is a bit outdated, and if you have a recent AnyConnect server, you need a newer OpenConnect to play with it.

Why this guide uses OpenSSL instead of GnuTLS

@ravibhure
ravibhure / socket_state.sh
Created September 14, 2016 12:13
print number of sockets in different tcp state
sudo netstat -ant | awk '{print $6}' | tr ')' ' ' | sort | uniq -c
@ravibhure
ravibhure / bootstrap_ansible_node.sh
Last active May 19, 2017 05:52
Bootstrap for ansiblized node
#!/bin/bash
# Bootstrap for ansiblized node
# Author: Ravi Bhure <[email protected]>
# Usages: curl -L https://raw.githubusercontent.com/ravibhure/terraform-provisioner-ansible/master/bootstrap_ansible_node.sh | sudo bash
machine=`uname -m`
os=`uname -s`
if test -f "/etc/lsb-release" && grep -q DISTRIB_ID /etc/lsb-release && ! grep -q wrlinux /etc/lsb-release; then
platform=`grep DISTRIB_ID /etc/lsb-release | cut -d "=" -f 2 | tr '[A-Z]' '[a-z]'`
@ravibhure
ravibhure / ansible-local.py
Last active November 7, 2016 04:54
Ansible dynamic inventory Terraform
#!/usr/bin/env python
# vim:syntax=python
import argparse
import collections
import json
import os
import os.path
from ansible.vars import VariableManager
@ravibhure
ravibhure / tproxy.md
Last active November 15, 2016 09:36
Transparent proxy support

Transparent proxy support

This feature adds Linux 2.2-like transparent proxy support to current kernels. To use it, enable the socket match and the TPROXY target in your kernel config. You will need policy routing too, so be sure to enable that as well.

  1. Making non-local sockets work ================================