Skip to content

Instantly share code, notes, and snippets.

View gosuri's full-sized avatar

Greg Osuri gosuri

View GitHub Profile
@gosuri
gosuri / gist:de97d0edce52076a1367
Created December 14, 2014 05:42
terraform-crash.log
2014/12/13 21:34:29 [INFO] Terraform version: 0.3.5 69b2c245dd586b435fd71915b38b777fb0ee315c
2014/12/13 21:34:29 Detected home directory from env var: /Users/gosuri
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: atlas = /Users/gosuri/projects/gocode/bin/terraform-provider-atlas
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: aws = /Users/gosuri/projects/gocode/bin/terraform-provider-aws
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: cloudflare = /Users/gosuri/projects/gocode/bin/terraform-provider-cloudflare
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: cloudstack = /Users/gosuri/projects/gocode/bin/terraform-provider-cloudstack
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: consul = /Users/gosuri/projects/gocode/bin/terraform-provider-consul
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: digitalocean = /Users/gosuri/projects/gocode/bin/terraform-provider-digitalocean
2014/12/13 21:34:29 [DEBUG] Discoverd plugin: dnsimple = /Users/gosuri/projects/gocode/bin/terraform-provider-dnsimple
2014/12/13 21:34:29 [DEBUG] D
@gosuri
gosuri / Vagrantfile
Last active August 29, 2015 14:09
Vagrant file to run chef-solo.
# -*- mode: ruby -*-
# vi: set ft=ruby :
HOSTNAME = ENV['BOXHOSTNAME'] || "app-berkshelf"
BASE_BOX = ENV["BASEBOX"] || "ubuntu/trusty64"
DEBUG = ENV["DEBUG"] || false
RUNLIST = ENV['RUNLIST'] || %w(app)
CHEFJSON = ENV['CHEFJSON'] || {
mysql: {
server_root_password: 'rootpass',
package main
import (
"fmt"
"github.com/mitchellh/goamz/aws"
"github.com/mitchellh/goamz/route53"
"log"
)
func main() {
@gosuri
gosuri / aws.tf
Last active August 29, 2015 14:08
aws demo terraform template
variable "aws_key" { }
variable "aws_secret" { }
variable "key_name" {}
variable "key_path" {}
provider "aws" {
access_key = "${var.aws_key}"
secret_key = "${var.aws_secret}"
region = "us-east-1"
}
@gosuri
gosuri / node-ssh.sh
Created October 11, 2014 02:34
node-ssh.sh
#!/bin/bash
# handy functions to ssh into box using chef node name
# example: node-ssh prod-dnscache-oregon
function node-ip {
cmd="`which ruby` -e 'print eval(\`knife node show $1 -a node.ipaddress -F pp\`)[\"node.ipaddress\"]'"
eval $cmd
}
require 'thread'
queue = Queue.new
producer = Thread.new do
5.times do |i|
sleep rand(i)
queue << i
puts "#{i} produced"
end

Keybase proof

I hereby claim:

  • I am gosuri on github.
  • I am kn0tch (https://keybase.io/kn0tch) on keybase.
  • I have a public key whose fingerprint is F731 6454 2118 DB51 44A1 655C 3CF6 8C6B 14A1 03D5

To claim this, I am signing this object:

@gosuri
gosuri / nginx.conf
Last active January 4, 2016 05:09
airpair nginx config
# wordpress over fastcgi
server {
listen 81;
server_name _;
root /mnt/apps/airpair-blog/current;
index index.html index.php /index.php;
# restricting all dot files
location ~ /\. { return 403; }
@gosuri
gosuri / sorin-custom.zsh-theme
Created October 18, 2013 23:28
Custom Sorin Theme
# ------------------------------------------------------------------------------
# FILE: sorin-custom.zsh-theme
# DESCRIPTION: oh-my-zsh theme file.
# AUTHOR: Sorin Ionescu ([email protected])
# VERSION: 1.0.2
# SCREENSHOT: http://i.imgur.com/aipDQ.png
# ------------------------------------------------------------------------------
local prefix="%{$fg[red]%}$USER@$(hostname)"
include_recipe "nginx"
link "my_app" do
to "my_app_directory"
end
nginx_site "my_app"