Skip to content

Instantly share code, notes, and snippets.

@phongnh
phongnh / gist:2169407
Created March 23, 2012 10:32
YAML error
17:29:12 phongnh@hp:~/WS/Working/projects/hubworks (git:staging_er13+:70d1d90) ruby-1.9.2-p0@hubworks
$ script/server -p 8000
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:8000
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /media/WS/Working/projects/hubworks/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#refresh! called from /media/WS/Working/projects/hubworks/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from /home/phongnh/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:322.
@phongnh
phongnh / gist:2169669
Created March 23, 2012 11:13
Gemset hubworks
18:10:46 phongnh@hp:~/WS/Working/projects/hubworks (git:staging_er13+:70d1d90) ruby-1.9.2-p0@hubworks
$ gem list
*** LOCAL GEMS ***
acl9 (0.12.0)
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
@phongnh
phongnh / .tmux.conf
Created March 24, 2012 13:42 — forked from snuggs/.tmux.conf
TMUX configuration file
# SCREENSHOT EXAMPLE: http://grab.by/bzg3
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
@phongnh
phongnh / gist:2211304
Created March 27, 2012 00:57
rake db:test:prepare error
07:40:27 phongnh@hp:/media/WS/Working/projects/hubworks (git:26983319-balance-report-sorting:b5159d2) ruby-1.9.2-p0@hubworks
$ rake db:create RAILS_ENV=test
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/media/WS/Working/projects/hubworks/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:968: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
-- control frame ----------
c:0047 p:---- s:0172 b:0172 l:000171 d:000171 CFUNC :initialize
c:0046 p:---- s:0170 b:0170 l:000169 d:000169 CFUNC :new
c:0045 p:0020 s:0160 b:0160 l:000159 d:000159 METHOD /media/WS/Working/projects/hubworks/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:968
@phongnh
phongnh / bootstrap-ruby.sh
Created April 28, 2012 11:52
Install Ruby with rbenv/ruby-build on Ubuntu 10.04 with openssl
#!/bin/bash
set -e # exit on error
### README
# * built for Ubuntu (Lucid Lynx)
# * uses GIT via SSH because of !@#$% proxy at work
# * installs your desired ruby version (1.9.2-p290 per default) using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
@phongnh
phongnh / vim7.3_mac_install.rb
Created May 17, 2012 05:36 — forked from sirupsen/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
@phongnh
phongnh / uninstall_homebrew.sh
Created May 18, 2012 05:27 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@phongnh
phongnh / gist:2834725
Created May 30, 2012 08:56
[BUG] Segmentation fault when try to email to families in Message Centre
/home/phongnh/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:677: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
-- control frame ----------
c:0084 p:---- s:0416 b:0416 l:000415 d:000415 CFUNC :connect
c:0083 p:0440 s:0413 b:0413 l:ffffe784 d:ffffe784 METHOD /home/phongnh/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:677
c:0082 p:0011 s:0406 b:0406 l:000405 d:000405 METHOD /home/phongnh/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:637
c:0081 p:0048 s:0403 b:0403 l:000402 d:000402 METHOD /home/phongnh/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/net/http.rb:626
c:0080 p:0134 s:0400 b:0400 l:fffff948 d:fffff948 METHOD /home/phongnh/.rvm/gems/ruby-1.9.2-p0@hubworks/gems/aws-s3-0.6.2/lib/aws/s3/connection.rb:52
c:0079 p:0078 s:0390 b:0389 l:000388 d:000388 METHOD /home/phongnh/.rvm/gems/ruby-1.9.2-p0@hubworks/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:69
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@phongnh
phongnh / gist:3179691
Created July 26, 2012 01:11
cap staging deploy
08:04:31 phongnh@phongnh:/home/phongnh/Working/hubworks [staging_er13 *] []
$ cap staging deploy
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
triggering before callbacks for `deploy'
* executing "sudo /etc/init.d/hw-cache-agent stop && sleep 5"
servers: ["staging.hubworks.com.au"]
[staging.hubworks.com.au] executing command