Skip to content

Instantly share code, notes, and snippets.

View gabrtv's full-sized avatar

Gabe Monroy gabrtv

View GitHub Profile
@gabrtv
gabrtv / CookieLibAgent
Created March 3, 2011 06:03
First pass at CookieLibAgent, extending t.w.c.Agent in branch #3420 (agent-persistent-connections)
class CookieLibAgent(Agent):
def __init__(self, cookieJar, *args, **kwargs):
Agent.__init__(self, reactor, *args, **kwargs)
self.jar = cookieJar
def request(self, method, uri, headers=None, bodyProducer=None):
"""
Issue a new request.
@gabrtv
gabrtv / gist:1299982
Created October 19, 2011 23:24
The GPU Instance Defense
commit f3ba9767192780a0dd5f575f52abae8661a2143d
Author: gabrtv <gabriel@opdemand.com>
Date: Wed Oct 19 17:01:28 2011 -0600
switch to sha-512 password hashing (aka the GPU instance defense)
diff --git a/c2core/crypto.py b/c2core/crypto.py
index 98c8711..fc9ad56 100644
--- a/c2core/crypto.py
+++ b/c2core/crypto.py
@gabrtv
gabrtv / gist:1342227
Created November 5, 2011 23:59
Node.js Upgrade Script
#!/bin/sh -e
# upgrade packages
sudo apt-get update && sudo apt-get dist-upgrade -y --force-yes
# upgrade node application
cat > /tmp/upgrade <<EOF
#!/bin/sh
cd app
git pull --rebase
@gabrtv
gabrtv / gist:1342246
Created November 6, 2011 00:22
Node.js Build Script
#!/bin/sh -e
# bootstrap application repository
cat > /tmp/bootstrap-app <<EOF
#!/bin/sh -e
git clone https://github.com/opdemand/c2-nodejs-helloworld.git app
cd app
npm install
EOF
chmod +x /tmp/bootstrap-app
@gabrtv
gabrtv / gist:1342256
Created November 6, 2011 00:36
Gabrtv's Node.js Build Script
#!/bin/sh -e
# bootstrap application repository
cat > /tmp/bootstrap-app <<EOF
#!/bin/sh -e
git clone https://github.com/gabrtv/nodejs-sandbox.git app
cd app
npm install
EOF
chmod +x /tmp/bootstrap-app
@gabrtv
gabrtv / gist:6107881
Last active December 20, 2015 09:29
Deis 0.0.4 Sneak Peek
$ deis register https://dev.deis.io/
username: gabrtv
password:
email: gabriel@opdemand.com
Registered gabrtv
Logged in as gabrtv
Found the following SSH public keys:
1) id_rsa.pub
2) deis_test.pub
@gabrtv
gabrtv / Failing (exec over SSH)
Created August 20, 2013 17:46
Docker run hangs over SSH
execve("/usr/bin/docker", ["docker", "run", "-v", "/opt/deis/runtime/slugs/docile-i"..., "deis/buildstep", "ls", "-la"], [/* 12 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x982330) = 0
sched_getaffinity(0, 128, {1, 0, 0, 0}) = 32
clock_gettime(CLOCK_REALTIME, {1377020251, 252416433}) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd226e01000
mmap(NULL, 268480448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd216df6000
mmap(0xc000000000, 65536, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc000000000
munmap(0xc000000000, 65536) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd216dd6000
mmap(0xc200000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc200000000
@gabrtv
gabrtv / gist:6451734
Created September 5, 2013 15:28
Example: Creating a new feature branch using HubFlow
gabriel@delta:~/workspace/deis$ git hf feature start chef-api-retries
Fetching origin
Switched to a new branch 'feature/chef-api-retries'
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:opdemand/deis.git
* [new branch] feature/chef-api-retries -> feature/chef-api-retries
Summary of actions:
- A new branch 'feature/chef-api-retries' was created, based on 'develop'
- The branch 'feature/chef-api-retries' has been pushed up to 'origin/feature/chef-api-retries'
@gabrtv
gabrtv / gist:6452526
Created September 5, 2013 16:24
Example: Finishing a feature with HubFlow
gabriel@delta:~/workspace/deis$ git hf feature finish
Fetching origin
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 1 (delta 0)
Unpacking objects: 100% (1/1), done.
From github.com:opdemand/deis
b22cf85..242ac17 develop -> origin/develop
Switched to branch 'develop'
Your branch is behind 'origin/develop' by 2 commits, and can be fast-forwarded.
Updating b22cf85..242ac17
gabriel@delta:~$ deis formations:create test
Creating formation... done, created test
See `deis help layers:create` to begin building your formation
gabriel@delta:~$ deis layers:create
Usage: deis layers:create <formation> <id> <flavor> [options]
gabriel@delta:~$ deis layers:create test runtime static
Creating runtime layer... done in 3s
gabriel@delta:~$ deis layers:info
Usage: deis layers:info <formation> <id>