Skip to content

Instantly share code, notes, and snippets.

@ezkl
ezkl / basic.sql
Created April 16, 2013 05:04 — forked from nesquena/basic.sql
/* How to calculate postgreSQL database size in disk ? */
SELECT pg_size_pretty(pg_database_size('thedbname'));
/* Calculate size of a table including or excluding the index */
SELECT pg_size_pretty(pg_total_relation_size('big_table'));
SELECT pg_size_pretty(pg_relation_size('big_table')); /* without index */
/* See indexes on a table with `\d tablename` */
@ezkl
ezkl / 0-readme.md
Created November 21, 2012 07:20 — forked from cicloid/0-readme.md
ruby-1.9.3-p327 cumulative performance patch.

Patched ruby 1.9.3-p327 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p327 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

@ezkl
ezkl / 0-readme.md
Created July 26, 2012 12:58 — forked from joelmoss/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@ezkl
ezkl / chef_solo_bootstrap.sh
Created July 5, 2012 01:58 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y upgrade
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=/usr/local
make
@ezkl
ezkl / incoming_calls.rake
Created January 11, 2012 01:56 — forked from dannymcc/incoming_calls.rake
nokogiri and mechanize
desc "Import incoming calls"
task :fetch_incomingcalls => :environment do
# Logs into manage.phoneprovider.co.uk and retrieved list of incoming calls.
require 'rubygems'
require 'mechanize'
require 'logger'
# Create a new mechanize object
agent = Mechanize.new { |a| a.log = Logger.new(STDERR) }
# Much more realistic context.
def extract_prefix_from_path(path)
/(?<prefix>.+)_path/ =~ path.to_s ? prefix : false
end
path = extract_prefix_from_path("homepath")
puts path #=> false
puts extract_prefix_from_path("home_path") #=> home
@ezkl
ezkl / git-remote-output.md
Created September 27, 2011 19:47 — forked from bcg5017/new remote -v
The output of `git remote -v`

fetch is where you update from

git fetch origin master == fetch any updates from the remote repository called origin's master branch.

OR

git pull origin master == fetch any updates AND merge them into mine

origin	git@github.com:ezkl/code.ipsrvcs.com.git (fetch)

push is where you put your updates