Skip to content

Instantly share code, notes, and snippets.

Ezekiel Templin ezkl

Block or report user

Report or block ezkl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 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 Nov 21, 2012 — forked from cicloid/0-readme.md
ruby-1.9.3-p327 cumulative performance patch.
View 0-readme.md

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 Jul 26, 2012 — forked from joelmoss/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.
View 0-readme.md

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.

View chef_solo_bootstrap.sh
#!/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 Jan 11, 2012 — forked from dannymcc/incoming_calls.rake
nokogiri and mechanize
View incoming_calls.rake
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) }
View local_var_overwrite_warning.rb
# 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 Sep 27, 2011 — forked from bcg5017/new remote -v
The output of `git remote -v`
View git-remote-output.md

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

You can’t perform that action at this time.