Skip to content

Instantly share code, notes, and snippets.

View ubermuda's full-sized avatar

Geoffrey Bachelet ubermuda

  • Paper Edu.
  • Granby, QC
View GitHub Profile
for env in $(printenv); do
IFS== read KEY VALUE <<< "$env"
sed "s,\${${KEY}},${VALUE},g" -i /etc/nginx/sites-enabled/default
done;
<?php
/**
* Internally, the client instantiates a Guzzle\Http\Client on Docker's
* default tcp address (127.0.0.1:4243) but you could pass your own too
*/
$docker = new Docker\Docker();
/**
* This is how you wrap a Dockerfile with its context
bytes [1,0,0,0,0,0,0,239,191,189]
bytes length 10
@ubermuda
ubermuda / nginx.conf
Created November 5, 2013 22:13
Proxy a unix socket HTTP server to a tcp port using nginx.
server {
listen 127.0.0.1:9000;
location / {
proxy_pass http://unix:/var/run/docker.sock:/;
}
}
set nocompatible
filetype on
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'ctrlp.vim'
Maid.rules do
rule 'Old files downloaded while developing/testing' do
dir('~/Downloads/*').each do |path|
if downloaded_from(path).any? {|u| u.match 'http://localhost'} && 1.week.since?(last_accessed(path))
trash(path)
end
end
end
end
@ubermuda
ubermuda / Vagrantfile
Created July 26, 2013 00:04
From 0 to ready in one command. vagrant+packer=the\ future.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "symfony2"
config.vm.box_url = "/Users/ash/Projects/packer-templates/symfony2/vmware.box"
config.vm.hostname = 'stage1'
config.vm.network :private_network, ip: '192.168.215.42'
config.vm.synced_folder ".", "/vagrant", :nfs => true
# -*- mode: ruby -*-
# vi: set ft=ruby :
class Vagrant::Config::V2::Root
def has_key?(name)
@config_map.has_key?(name.to_sym)
end
end
Vagrant.configure("2") do |config|
{
"builders": [
{
"type": "virtualbox",
"iso_url": "http://cdimage.debian.org/debian-cd/7.1.0/i386/iso-cd/debian-7.1.0-i386-CD-1.iso",
"iso_md5": "c29ec2db6754dadd341b9763164aca9a",
"ssh_username": "packer",
"ssh_password": "packer",
"guest_os_type": "Debian",
"http_directory": ".",
hwi_oauth:
firewall_name: secured_area
resource_owners:
github:
type: github
client_id: <hidden>
client_secret: <hidden>