Skip to content

Instantly share code, notes, and snippets.

View dayer4b's full-sized avatar

Sunil Chopra dayer4b

  • The Jellyvision Lab, Inc.
  • Chicago
View GitHub Profile
@dayer4b
dayer4b / debug.sh
Last active May 17, 2017 17:30
Terraform debug output
$ terraform apply
data.terraform_remote_state.vpc: Refreshing state...
aws_iam_role.app_role: Refreshing state... (ID: gruttypeen-sandbox-role)
data.aws_region.current: Refreshing state...
data.aws_ami.ami: Refreshing state...
aws_iam_instance_profile.app_profile: Refreshing state... (ID: gruttypeen-sandbox-profile)
aws_iam_role_policy.app_policy: Refreshing state... (ID: gruttypeen-sandbox-role:gruttypeen-sandbox-policy)
aws_launch_configuration.lc: Refreshing state... (ID: gruttypeen-sandbox-ami-a82a0dcd-e0c5717e-8fc8-13ea-8cd6-db54195959c4)
#!/bin/bash
# FOLDERNAME="shipwrightTest"
FOLDERNAME="shipwrighttest"
mkdir -p /tmp/$FOLDERNAME
cd /tmp/$FOLDERNAME
git init
printf "FROM busybox\nADD . /code" > Dockerfile
printf '{\n "version": 1.0,\n "namespace": "shipwright"\n}' > .shipwright.json
@dayer4b
dayer4b / app.rb
Created March 28, 2016 16:14
"figaro" for sinatra
require_relative 'load_secrets'
require 'sinatra/base'
class Application < Sinatra::Base
configure do
enable :logging, :show_exceptions, :dump_errors, :clean_trace, :static
end
enable :inline_templates
get '/' do
"Hello World"
# prepare sources for caffeine and xtrlock
sudo add-apt-repository ppa:caffeine-developers/ppa -y
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" -y
sudo apt-get update
# install caffeine and xtrlock
sudo apt-get install -y caffeine xtrlock
@dayer4b
dayer4b / aws-us-east-1
Last active September 23, 2015 18:41
Slack RSS subscriptions for every AWS US-EAST-1 status feed
/feed subscribe http://status.aws.amazon.com/rss/storagegateway-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/servicecatalog-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/opsworks-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/management-console.rss
/feed subscribe http://status.aws.amazon.com/rss/lambda-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/kms-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/iam-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/elasticbeanstalk-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/directoryservice-us-east-1.rss
/feed subscribe http://status.aws.amazon.com/rss/directconnect-us-east-1.rss
@dayer4b
dayer4b / .gitconfig
Created March 10, 2015 17:31
ensure that git flow NEVER fast forwards merges when finishing features
# this file should already exist at ~/.gitconfig, just add this bit to the end:
[gitflow "feature.finish"]
no-ff = true
@dayer4b
dayer4b / define words in bash
Last active August 29, 2015 14:14
use sdcv to create a simple `define word` function for bash in Ubuntu 14.04 -- lifted and modified from: http://askubuntu.com/questions/191125/is-there-an-offline-command-line-dictionary
# install sdcv
sudo apt-get install sdcv
# make a dictionary folder
sudo mkdir -p /usr/share/stardict/dic
# download some dictionaries (check askubuntu link for better list of available dictionaries,
# but keep in mind that you will get multiple definitions with multiple dictionaries)
wget http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2
@dayer4b
dayer4b / easy markdown previews.sh
Last active June 21, 2017 14:29
easy markdown previews / renders in ubuntu 14.04 (or Mac)
# this goes in your .bashrc (or maybe .bash_profile on a Mac)
function readmarkdown() {
TMPFILE=`mktemp`.pdf
pandoc "$@" -o $TMPFILE
evince $TMPFILE
rm $TMPFILE
}
# OR, for fancy formatting you can use --listings (this requires the latex-xcolor package)
function readmarkdown() {
@dayer4b
dayer4b / jquery.uploadify.v2.1.4-fix.js
Created October 21, 2014 23:09
fix for Uploadify with jQuery
/*
Uploadify v2.1.4
Release Date: November 8, 2010
Copyright (c) 2010 Ronnie Garcia, Travis Nickels
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@dayer4b
dayer4b / gist:bd088d37179443af7b1d
Created June 6, 2014 18:27
installing RVM, Ruby, Passenger, and Nginx on CentOS
\curl -sSL https://get.rvm.io | sudo bash -s stable
rvm list
usermod -a -G rvm root
source /etc/profile
groups
rvm install 2.0.0-p247
rvm list gemsets
gem install passenger
passenger-install-nginx-module