Skip to content

Instantly share code, notes, and snippets.

View bramswenson's full-sized avatar

Bram Swenson bramswenson

View GitHub Profile
[user]
name = Bram Swenson
email = [email protected]
editor = "/usr/bin/gvim -v"
[github]
user = <github user>
token = <github api token>
password = <github password>
@bramswenson
bramswenson / ruby_it.rb
Created March 11, 2013 21:25
heh, python package management
dep 'virtualenv.pip.install.requirements', :as, :env_name do
requires 'virtualenvwrapper.pip'
def requirements
"/home/#{as}/current/requirements.txt"
end
def pip_freeze
shell("sudo su - #{as} -c 'workon #{env_name}; pip freeze'").split("\n")
end
class BabushkaProvisioner < Vagrant::Provisioners::Base
class Config < Vagrant::Config::Base
attr_accessor :args
attr_accessor :deps
def initialize
@deps = []
@args = []
end
@bramswenson
bramswenson / requirements.txt
Created March 1, 2013 17:55
Working requirements.txt with git repo
Django==1.4.3
MySQL-python==1.2.3
PIL==1.1.7
django-ajax-selects==1.2.5
django-debug-toolbar==0.9.4
django-extensions==1.0.2
django-generic-aggregation==0.3.1
git+git://github.com/mikelopez/sciweb-django-messages
django-postman==2.1.1
django-simple-ratings==0.3.2
@bramswenson
bramswenson / babushka_notes.md
Last active December 14, 2015 08:59
Babushka Notes
D, [2013-02-27T17:51:01.003745 #17464] DEBUG -- : Terminating 4 actors...
D, [2013-02-27T17:51:01.005423 #17464] DEBUG -- : Shutdown completed cleanly
/home/shadowshell/Projects/bramswenson/celluloid-io-ssh/.bundle/bundle/ruby/1.9.1/gems/net-ssh-2.2.2/lib/net/ssh/transport/server_version.rb:68:in `negotiate!': undefined method `flush' for #<Celluloid::IO::TCPSocket:0x00000002d296f8> (NoMethodError)
from /home/shadowshell/Projects/bramswenson/celluloid-io-ssh/.bundle/bundle/ruby/1.9.1/gems/net-ssh-2.2.2/lib/net/ssh/transport/server_version.rb:32:in `initialize'
from /home/shadowshell/Projects/bramswenson/celluloid-io-ssh/.bundle/bundle/ruby/1.9.1/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:77:in `new'
from /home/shadowshell/Projects/bramswenson/celluloid-io-ssh/.bundle/bundle/ruby/1.9.1/gems/net-ssh-2.2.2/lib/net/ssh/transport/session.rb:77:in `block in initialize'
from /home/shadowshell/.rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /h
@bramswenson
bramswenson / Vagrantfile
Last active December 14, 2015 07:39
Vagrant Provisioner for Babushka (taken partially from http://www.ipaste.eu/view.php?id=1576)
require File.expand_path('../babushka_provisioner.rb', __FILE__)
Vagrant::Config.run do |config|
config.vm.box = "base"
config.vm.provision BabushkaProvisioner do |babushka|
babushka.dep 'some dep in your project ./babushka-deps dir'
end
end
@bramswenson
bramswenson / .gitconfig
Created February 26, 2013 06:01
git config
[user]
name = <your name>
email = <your email>
editor = <your editor path>
[github]
user = <your github user>
token = <your token>
[core]
@bramswenson
bramswenson / ree-1.8.7-2012.02
Created December 13, 2012 19:44
rbenv install script for ree 1.8.7.2012.02 with tcmalloc patch
build_package_patched() {
cd source
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/tcmalloc.patch'
wget 'https://github.com/wayneeseguin/rvm/raw/master/patches/ree/1.8.7/stdout-rouge-fix.patch'
patch -p1 < tcmalloc.patch
patch -p1 < stdout-rouge-fix.patch
cd ..
}
require_gcc
@bramswenson
bramswenson / git_branch_audit.rb
Created April 24, 2012 19:19
Audit old remote branches with Grit and ActiveSupport
#!/usr/bin/env ruby
USAGE="git_branch_audit.rb <repo_dir>"
def bail!(message=nil)
message ||= USAGE
$stderr.puts message
exit 1
end
begin