Skip to content

Instantly share code, notes, and snippets.

View beanieboi's full-sized avatar

Ben Fritsch beanieboi

View GitHub Profile
@beanieboi
beanieboi / gist:2702092
Created May 15, 2012 14:15
Upgrade to Postgres 9.2 beta 1 on Ubuntu 12.04
# Install Postgres 9.2 from https://launchpad.net/~pitti/+archive/postgresql
# drop the cluster which gets created during the setup
pg_dropcluster --stop 9.2 main
# create a backup of your current cluster
rsync -a /var/lib/postgresql/9.1 /var/lib/postgresql/9.1.backup
# upgrade the the old 9.1 cluster
pg_upgradecluster 9.1 main /var/lib/postgresql/9.2
cd tmp/x86_64-darwin11.3.0/ruby_mapnik/1.9.3
make
compiling ../../../../ext/ruby_mapnik/_mapnik_feature.rb.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/../to_from_ruby.hpp:5,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/Auto_Function_Wrapper.ipp:12,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/Auto_Function_Wrapper.hpp:826,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/wrap_function.ipp:10,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/wrap_function.hpp:338,
@beanieboi
beanieboi / gist:2717328
Created May 17, 2012 08:12
Mapnik build error
cd tmp/x86_64-darwin11.3.0/ruby_mapnik/1.9.3
make
compiling ../../../../ext/ruby_mapnik/_mapnik_feature.rb.cpp
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/../to_from_ruby.hpp:5,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/Auto_Function_Wrapper.ipp:12,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/Auto_Function_Wrapper.hpp:826,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/wrap_function.ipp:10,
from /Users/ben/.rvm/gems/ruby-1.9.3-p194@mapnik/gems/rice-1.4.3/ruby/lib/include/rice/detail/wrap_function.hpp:338,
@beanieboi
beanieboi / chef_solo_bootstrap.sh
Created June 4, 2012 09:26 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/opt/ruby-1.9.3-p194
make
make install
file = File.new(File.join(Rails.root, 'extras', 'bson', 'foobar.bson')
while not file.eof? do
entry = BSON.read_bson_document(file)
entry.delete("_id")
Entry.create(entry)
end
@beanieboi
beanieboi / progress_indicators.rb
Created August 12, 2012 18:02 — forked from jpo/progress_indicators.rb
Ruby CLI Progress Indicators
# Terminal Progress Indicators. Four examples are included: percentage,
# spinner, progress bar, and combined. This script has been tested on
# Mac OS X 10.8 with Ruby 1.8.7, 1.9.1, 1.9.2, and 1.9.3
class Spinner
include Enumerable
def each
loop do
yield '|'
yield '/'
history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
{
"color_scheme": "Packages/User/Tomorrow-Night-Bright.tmTheme",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".sass-cache"
@beanieboi
beanieboi / chef_solo_bootstrap.sh
Created October 2, 2012 11:15 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/opt/ruby-1.9.3-p194
make
make install
@beanieboi
beanieboi / ruby_install.sh
Last active October 11, 2015 08:48
compile ruby from scratch
#!/usr/bin/env bash
aptitude -y update
aptitude -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar -xvzf ruby-1.9.3-p392.tar.gz
cd ruby-1.9.3-p392/
./configure --prefix=/opt/ruby-1.9.3-p392
make -j 4
make install