Skip to content

Instantly share code, notes, and snippets.

ravibhure /
Created Dec 29, 2016 — forked from addyosmani/
So, you want to run Chrome headless.
ravibhure / redis_and_resque.mkd
Created Nov 25, 2016 — forked from Diasporism/redis_and_resque.mkd
How to configure Redis and Resque for your Rails app.
View redis_and_resque.mkd

Redis and Resque

What this guide will cover: the code you will need in order to include Redis and Resque in your Rails app, and the process of creating a background job with Resque.

What this guide will not cover: installing Ruby, Rails, or Redis.

Note: As of this writing I am still using Ruby 1.9.3p374, Rails 3.2.13, Redis 2.6.11, and Resque 1.24.1. I use SQLite in development and Postgres in production.

Background jobs are frustrating if you've never dealt with them before. Over the past few weeks I've had to incorporate Redis and Resque into my projects in various ways and every bit of progress I made was very painful. There are many 'gotchas' when it comes to background workers, and documentation tends to be outdated or scattered at best.

ravibhure /
Created Aug 5, 2016 — forked from darrenpmeyer/
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


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 /
Created Apr 29, 2016 — forked from trinitronx/
A shell script to install latest Ansible via pip + dependencies


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.


ravibhure / Ansible-Vault
Created Mar 21, 2016 — forked from tristanfisher/Ansible-Vault
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.
View Ansible-Vault

##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 / base.rb
Created Jan 12, 2016 — forked from jtimberman/base.rb
an example roles/base.rb
View base.rb
name "base"
description "Baseline configuration for all systems."
ravibhure / config.yml
Created Oct 28, 2015 — forked from pkuczynski/
Read YAML file from Bash script
View config.yml
adapter: mysql2
encoding: utf8
database: my_database
username: root


An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

# HAProxy Performance Statistics
# by Steve Kamerman
# To use, pipe your HAProxy log with timing information (like "0/0/1/1/3 200") to
# this script. It will output min, max, med, avg and a latency distribution graph.
# Info on timing logging in HAProxy:
ravibhure /
Last active Aug 29, 2015 — forked from fnichol/
Unable to download data from - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (


There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?


The Ruby Way! (Fun)