Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
cd ~/foo
spork cuc
cucumber --drb # win!
cd ~/bar
cucumber --drb # foo?!? fail.
@cap10morgan
cap10morgan / gist:815052
Created February 7, 2011 19:53
PostgreSQL trust local user accounts -- goes in pg_hba.conf
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
@cap10morgan
cap10morgan / rs_cloud.rb
Created February 7, 2012 18:44
RS Cloud Ruby Upload; Trying to set headers
require 'cloudfiles'
cf = CloudFiles::Connection.new( :username => 'turbovote', :api_key => '[hidden]' )
container = cf.container('forms-test')
object = container.create_object('test.pdf')
file_path = File.join("/", "tmp", "test.pdf")
headers = {
'content-type' => "application/pdf",
'content-disposition' => "attachment; filename=public_name.pdf",
'access-control-allow-origin' => "*"
/opt/opscode/embedded/bin/ruby extconf.rb
checking for getspent() in -lshadow... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
"gcc -o conftest -I/opt/opscode/embedded/include/ruby-1.9.1/i686-linux -I/opt/opscode/embedded/include/ruby-1.9.1/ruby/backward -I/opt/opscode/embedded/include/ruby-1.9.1 -I. -I/opt/opscode/embedded/include -D_FILE_OFFSET_BITS=64 -DRUBY19 conftest.c -L. -L/opt/opscode/embedded/lib -Wl,-R/opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -Wl,-R/opt/opscode/embedded/lib -L. -Wl,-rpath /opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
@cap10morgan
cap10morgan / gist:3230347
Created August 1, 2012 20:18
Template from library method
def give_user_root_access(user, root_password)
Chef::Log.info "Giving #{user} root access to MySQL server"
home_dir = case user
when 'root'
'/root'
else
"/home/#{user}"
end
Chef::Resource::Template.new "#{home_dir}/.my.cnf" do
@cap10morgan
cap10morgan / gist:3384116
Created August 18, 2012 03:15
kitchen test failure
Kitchenfile:
cookbook "turbovote" do
runtimes []
end
Cheffile:
require 'test-kitchen'
@cap10morgan
cap10morgan / gist:3758250
Created September 20, 2012 20:47
worker1-ec2-staging.json
{
"name": "worker1-ec2-staging",
"json_class": "Chef::Node",
"chef_environment": "ec2-staging",
"run_list": [
"role[pdf_worker_ec2]"
],
"normal": {
"elastic_ip": "1.2.3.4",
"tags": [
@cap10morgan
cap10morgan / init.zsh.fix-terminal.app-tab-titles.patch
Created October 22, 2012 15:29
Fix prezto tab titles in Terminal.app
diff --git i/modules/terminal/init.zsh w/modules/terminal/init.zsh
index dc78a3b..d36b641 100644
--- i/modules/terminal/init.zsh
+++ w/modules/terminal/init.zsh
@@ -85,14 +85,14 @@ function set-titles-with-path {
setopt EXTENDED_GLOB
local absolute_path="${${1:a}:-$PWD}"
+ local abbreviated_path="${absolute_path/#$HOME/~}"
+ local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"