This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT idx.relname as table, | |
idx.indexrelname as index, | |
pg_relation_size( idx.indexrelname::text ) as bytes, | |
cls.relpages as pages, | |
cls.reltuples as tuples, | |
idx.idx_scan as scanned, | |
idx.idx_tup_read as read, | |
idx.idx_tup_fetch as fetched | |
FROM pg_stat_user_indexes idx, | |
pg_class cls , |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd . # save current place in filesystem | |
until [ -d .git ] || $(pwd) = "/" ; do # look for project root | |
cd .. | |
done | |
if [ -d .git ] ; then # if we found it... | |
git submodule update | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
### Example usage: $0 {symbolic-host1} {s-h2} ... {s-host12} | |
from be_setup import * | |
from wrap_systest_cluster_membership import * | |
import sys, time | |
symbolic_hosts = sys.argv[1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'ALTER TABLE ' || t.table_name || ' DROP CONSTRAINT ' || t.constraint_name || ';' | |
from information_schema.table_constraints t | |
where t.constraint_type = 'FOREIGN KEY'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NicknameGenerator | |
# Grabbed phoneme and template list from http://www.flipcode.com/archives/misc/NameData.xml | |
# Based on an idea presented on http://www.flipcode.com/archives/Generating_Names_Phonetically.shtml | |
# by Jim Adams ([email protected]), 2000 | |
# (sr 2012-01-26) | |
PHONEME_LIST = { # consonants | |
:affricate => %w{ch dg j}, | |
:alveolar => %w{d l n r s t z}, | |
:bilabial => %w{b m p}, | |
:bilabial_stop => %w{b p}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.readlines( "20120628T111327_1" ) | |
hash = {} | |
pairs = file.grep( /extid|opt_out_url/ ). | |
map { |e| e.gsub( /<.*?>/, '' ) }. | |
map(&:strip) | |
pairs.shift | |
pairs.each_slice( 2 ) { |e| hash[e[0].to_i] = e[1] } | |
hash.delete(0) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY! | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Standard awesome library | |
local awful = require("awful") | |
awful.autofocus = require("awful.autofocus") | |
awful.rules = require("awful.rules") | |
-- Theme handling library | |
local beautiful = require("beautiful") | |
local gears = require("gears") | |
-- Notification library | |
local naughty = require("naughty") | |
local vicious = require("vicious") |
OlderNewer