Skip to content

Instantly share code, notes, and snippets.

Virendra Singh Bhalothia bhalothia

Block or report user

Report or block bhalothia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from __future__ import print_function
import json
import boto3
from datetime import datetime, timedelta
from import tzlocal
print('INFO: Loading function')
DRY_RUN = True # Do not shut down instances
bhalothia / cloudformation-template_vpc-iam.json
Created Jun 7, 2018 — forked from ianblenke/cloudformation-template_vpc-iam.json
AWS CloudFormation Template example for VPC with IAM Instance Profile
View cloudformation-template_vpc-iam.json
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "MyApp VPC",
"Parameters" : {
"Project" : {
"Description" : "Project name to tag resources with",
"Type" : "String",
"MinLength": "1",
"MaxLength": "16",
"AllowedPattern" : "[a-z]*",
View jenkins2.0-setup-docker
# Commands used in Setting up Jenkins 2.0 on Docker
# To create jenkins-test machine
docker-machine create --driver virtualbox jenkins-test
# To check the ip allocated to the jenkins-test machine
docker-machine ip jenkins-test
# To map the ip address to the jenkins-test alias
vi /etc/hosts
View vagrantfile.rb
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "centos6.5_64" "forwarded_port", guest: 8080, host: 8080
bhalothia / .gitignore
Created Sep 29, 2015 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
# Packages #
bhalothia /
Last active Dec 2, 2015 — forked from bknowles/


Here is an example shared configuration for knife. You can drop this off in your chef-repo/.chef/ directory, and multiple developers can use the same knife configuration to interact with more than one Chef server, or the Opscode platform.

By using Bash functions and environment variables we can change the chef server, which knife is configured to use, on the fly.

NOTE: knife will probably ignore your ~/.chef/knife.rb once you begin using a shared knife.rb in your chef-repo directory.


bhalothia / ansible-playbook.yml
Last active Aug 29, 2015
register variables across plays
View ansible-playbook.yml
- vars:
# Extra vars from Rundeck for partition type
partition: "{{ partition }}"
# For 'nmctl ps' wrapper - Some deployment validation
number_of_tries: 5
sleep_between_tries: 60
hosts: "app-{{ partition }}[0]" # Canary
View gist:21919a7ec0fdce1df623
Jenkins Best Practices<- Read this!
Set up version control of job configurations
Keep jobs simple! Don't put a ton of bash in each job. If a job needs to do something complex, put it in a script in GitHub and check it out as needed.
Use templated builders to simplify common tasks
Keep all scripts in version control - avoid running scripts that live on the Jenkins server filesystem
Don't install unnecessary plugins - plugins are often written by third parties and can interact with each other in strange ways
Use LDAP authentication if possible for traceability - avoid anonymous access
View multi_env_knife_config
# This is an example of a knife.rb configuration that uses yml and a
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments.
# Example usage:
# export CHEF_ENV=evnironment_01
# knife status
# Based on:
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
You can’t perform that action at this time.