Skip to content

Instantly share code, notes, and snippets.

Dave Evans evansde77

  • Aurora, IL
Block or report user

Report or block evansde77

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9749925
#!/usr/bin/env python
"""
_gists_
functions for getting gists
Requires a section in your gitconfig like:
[cirrus]
@evansde77
evansde77 / gist:0a833b79b2cf104b63a0
Created May 6, 2014
How to create a wilson virtualenv with Carburetor installed in it
View gist:0a833b79b2cf104b63a0
# carburetor build from source
git clone git@github.com:cloudant/carburetor.git
cd carburetor/
#### Check out a specific tag here if you dont want HEAD
virtualenv --distribute venv
. venv/bin/activate
pip install -r requirements.txt
# -OR- since Macs are being difficult with XCode lately...
View gist:ce4023da802c35653335
import unittest
import mock
from wilson.views.bluemix import BluemixSingleUser
class TestBluemixUser(unittest.TestCase):
def test_get_user(self):
@evansde77
evansde77 / bash_profile
Created Jun 18, 2014
How to show your git branch in your shell prompt
View bash_profile
function parse_git_branch ()
{
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
BRANCH="("${ref#refs/heads/}")";
echo "${BRANCH}"
}
export PS1="[\t \W] \$(parse_git_branch) "
@evansde77
evansde77 / installer.sh
Last active Aug 29, 2015
Cirrus installer script with a public URL
View installer.sh
#!/bin/bash
#
# installer for cirrus
# Sets up working dir eg $HOME/.cirrus
# Clones latest stable tag of cirrus into it
# runs setup commands to build venv for cirrus
# installs git alias commands
# gets token for github access & updates .gitconfig
@evansde77
evansde77 / git_shell_funcs.sh
Created Feb 25, 2015
Useful Bash prompt/tab settings for showing git info
View git_shell_funcs.sh
#
# Added to .bash_profile on a mac, these utils will show the
# current repo in the terminal tab name and will include the current git
# branch name on the shell prompt.
#
function set_terminal_tabname {
# function that sets Terminal Tab name to $1
printf "\e]1;$1\a"
View log_watch.sh
function carb_logs(){
CLUSTER=$1
knife ssh -x evansde77 role:load_balancer_${CLUSTER} "tail -f /opt/sapi/logs/carburetor_package.log" -a ip.public
}
View ex_test.py
class MyTest(unittest.TestCase):
harness, setUp, tearDown = make_database_test_harness(**args)
def test_a_thing(self):
print self.harness
@evansde77
evansde77 / Vagrantfile
Last active Jan 29, 2016
Details for reproducing error in docker cookbook dependency under Vagrant/Chef-solo
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.require_version '>= 1.5.0'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
View provision.log
==> derp: Loading Berkshelf datafile...
==> derp: Sharing cookbooks with VM
==> derp: Updating Vagrant's Berkshelf...
==> derp: Resolving cookbook dependencies...
==> derp: Fetching 'derp' from source at .
==> derp: Fetching 'docker' from source at docker
==> derp: Using apt (2.9.2)
==> derp: Using build-essential (2.2.4)
==> derp: Using chef-sugar (3.3.0)
==> derp: Using compat_resource (12.5.26)
You can’t perform that action at this time.