Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile
module Capistrano
class SSH
class << self
alias :original_connect :connect
def connect(server, options={}, &block)
special_server_settings = options[:server_authentication] ? options[:server_authentication][server.to_s] : nil
if special_server_settings.nil?
return original_connect(server, options, &block)
else
methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ]
module Capistrano
class SSH
class << self
alias :original_connect :connect
def connect(server, options={}, &block)
additional_server_settings = options[:server_authentication] ? options[:server_authentication] =~ /#{server.to_s}/ : nil
if additional_server_settings.nil?
return original_connect(server, options, &block)
else
methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ]
@ikennaokpala
ikennaokpala / Install_Postgis_Ubuntu_11.10.sh
Created March 18, 2012 01:04 — forked from Tab3r/Install_Postgis_Ubuntu_11.10.sh
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@ikennaokpala
ikennaokpala / gist:2126870
Created March 19, 2012 20:32 — forked from jherrm/gist:1054913
startup script for unicorn with rvm global installation
#!/bin/bash
### BEGIN INIT INFO
# Provides: APPLICATION
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable APPLICATION at boot time.
### END INIT INFO
@ikennaokpala
ikennaokpala / deploy.rb
Created March 29, 2012 23:38 — forked from matenia/deploy.rb
Deploy from local project via capistrano
require "bundler/capistrano"
require 'capistrano/ext/multistage'
require 'new_relic/recipes'
set :application, "sampleapp"
set :branch, "master"
# deploy from local
set :scm, :git
set :repository, ".git"
set :deploy_via, :copy
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@ikennaokpala
ikennaokpala / gist:2343030
Created April 9, 2012 11:56 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@ikennaokpala
ikennaokpala / no_such_thing.rb
Created April 12, 2012 11:06 — forked from bokmann/no_such_thing.rb
The code of the talk from my Feb 22nd Arlington Ruby talk 'There is No Such Thing as Metaprogramming'.
# This is the code from my 'There is No Such Thing as Metaprogramming' talk,
# which premiered at the Arlington, VA Ruby Users Group on Feb 22nd.
# Without the deliver and walk-through to the solution below this example
# will be missing quite an important bit of content (mainly the tracking of
# 'self' while developing the solution, but it still a useful read.
# Here is the Toddler with no metajuju. Note that the developer, as well as
# the code, is completely unuaware of the interpreter. A developer with a
# background in compiled languages would be comfortable looking at this.
@ikennaokpala
ikennaokpala / personality.rb
Created April 12, 2012 20:08 — forked from wycats/personality.rb
More technical details about the discussion at last nights meetup
# Just wanted to clarify my points at the meetup last night.
#
# There were two different issues intertwined:
# (1) Whether to use extend or "include as extend"
# (2) When using "include as extend", what is the simplest way to achieve the goal?
#
# My personal opinion is that the answer to (1) is "extend", not "include as extend", but that
# is just my personal opinion. My answer to (2) is a more empirical question.
# Using the "extend" approach. Again, I personally prefer the simplicity of this approach, but
@ikennaokpala
ikennaokpala / uninstall_homebrew.sh
Created April 12, 2012 21:36 — 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