Skip to content

Instantly share code, notes, and snippets.

View ckoparkar's full-sized avatar

Chaitanya Koparkar ckoparkar

  • Indiana University
  • Bloomington, IN
View GitHub Profile
@ckoparkar
ckoparkar / my-nyan.xpm
Created November 13, 2013 07:27
modified nyan.xpm for nyan cat mode
/* XPM */
static char * nyan_xpm[] = {
"25 15 149 2",
" c None",
". c #522244",
"+ c #3F1E31",
"@ c #403326",
"# c #2C2F32",
"$ c #002D5B",
"% c #333333",
@ckoparkar
ckoparkar / my-outerspace.xpm
Created November 13, 2013 07:29
modified outerspace.xpm for nyan cat mode
/* XPM */
static char * outerspace_xpm[] = {
"8 15 2 1",
" c None",
". c #333333",
"........",
"........",
"........",
"........",
"........",
@ckoparkar
ckoparkar / postgresql.yml
Created March 11, 2015 19:00
Manifest for Postgresql to be used with OpsManager.
---
name: postgresql
product_version: 0.0.0.1
metadata_version: '1.3'
target_installer_version: 1.0
stemcell:
name: bosh-vsphere-esxi-ubuntu-trusty-go_agent
version: '2824'
file: bosh-stemcell-2824-vsphere-esxi-ubuntu-trusty-go_agent.tgz
md5: e42cf8db9f1a471ed062ff2c6723427a
@ckoparkar
ckoparkar / load_consul.rb
Last active August 29, 2015 14:20
Add all keys from yaml file to consul
require 'yaml'
require 'diplomat'
RAILS_ENV = ARGV[0]
x = YAML.load_file ARGV[1]
y = x.reduce({}) do |acc, (k, v)|
o = "#{RAILS_ENV}/#{k.downcase}"
require 'tempfile'
require 'fileutils'
ARGV.each do |name|
temp_file = Tempfile.new('foo')
begin
File.open(name, 'r') do |file|
file.each_line do |l|
@ckoparkar
ckoparkar / htop.sh
Created September 28, 2015 08:34
Install htop on centos
cd /tmp
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -ihv rpmforge-release*.rf.i686.rpm
yum -y install htop
#!/usr/bin/env bash
# Save and restore the state of tmux sessions and windows.
# TODO: persist and restore the state & position of panes.
set -e
dump() {
local d=$'\t'
tmux list-windows -a -F "#S${d}#W${d}#{pane_current_path}"
}
@ckoparkar
ckoparkar / server.json
Created October 27, 2015 13:49
consul single server config
{
"bootstrap": true,
"server": true,
"datacenter": "con",
"data_dir": "/tmp/consul",
"encrypt": "yJqVBxe12ZfE3z+4QSk8qA==",
"log_level": "INFO",
"enable_syslog": true,
"ui_dir": "~/consul_config/dist",
"acl_datacenter": "con",
@ckoparkar
ckoparkar / rust.md
Last active November 12, 2015 09:43
Integrate rustfmt with emacs.
@ckoparkar
ckoparkar / Tree.elm
Last active September 7, 2017 05:08
Implementation of Binary Search Tree in Elm
{-----------------------------------------------------------------
A "Tree" represents a binary tree. A "Node" in a binary tree
always has two children. A tree can also be "Empty". Below I have
defined "Tree" and a number of useful functions.
This example also includes some challenge problems :)
-----------------------------------------------------------------}