Skip to content

Instantly share code, notes, and snippets.

View include's full-sized avatar
👽
Free Jaffa

Francisco Cabrita include

👽
Free Jaffa
View GitHub Profile
@include
include / ansible_playbook.yml
Last active August 29, 2015 14:05
setup ansible plus tower
- hosts: ansible
sudo: yes
roles:
- { role: include.amzn-base }
vars:
ansible_version: 1.7.1
ansible_tower_version: 2.0.0
@include
include / kiss_docker
Created July 2, 2014 14:09
homebrew > cask > Virtualbox > Vagrant > CentOS > Docker > Ubuntu
#homebrew > cask > Virtualbox > Vagrant > CentOS > Docker > Ubuntu
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
$ brew tap caskroom/homebrew-cask
$ brew install brew-cask
$ brew cask install virtualbox
$ brew cask install vagrant
$ brew tap homebrew/completions
$ brew install vagrant-completion
@include
include / rbenvsetup.md
Last active August 29, 2015 14:03
homebrew_rbenv

Homebrew

$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ brew doctor

$ cat > ~/.profile
homebrew=/usr/local/bin:/usr/local/sbin
export PATH=$homebrew:$PATH

$ source ~/.profile

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/Crypto
copying lib/Crypto/__init__.py -> build/lib.macosx-10.9-intel-2.7/Crypto
copying lib/Crypto/pct_warnings.py -> build/lib.macosx-10.9-intel-2.7/Crypto
creating build/lib.macosx-10.9-intel-2.7/Crypto/Hash
copying lib/Crypto/Hash/__init__.py -> build/lib.macosx-10.9-intel-2.7/Crypto/Hash
{
"builders": [
{
"boot_command": [
"<tab> linux enforcing=0 ks=http://rpm-ostree.cloud.fedoraproject.org/project-atomic/install/rawhide/fedora-atomic.ks<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 8192,
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_os_type": "Fedora_64",

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

@include
include / pyDatetime.py
Created February 4, 2014 16:36
Datetime nightmare
# -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals)
import time, datetime
import pprint as pprint
# 2014-02-04 13:40:42.394000
dt = datetime.datetime
now = dt.today()
@include
include / bongo.sh
Created January 22, 2014 17:20
MongoDB export all collections from database
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
-h Show this help.
-l Load instead of export
@include
include / python27unicode.py
Created January 22, 2014 15:45
Playing with unicode on Python 2.7
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from pprint import pprint
import json
st = u"lol"
lt = [["foo", 1],["bar", 2]]
foo = {"keys": "hosts",