This file contains hidden or 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 | |
nspname AS schemaname,relname,reltuples | |
FROM pg_class C | |
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
WHERE | |
nspname NOT IN ('pg_catalog', 'information_schema') AND | |
relkind='r' | |
ORDER BY reltuples DESC; |
This file contains hidden or 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
haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid) |
This file contains hidden or 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 | |
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php | |
# Output lines suitable for sysctl configuration based | |
# on total amount of RAM on the system. The output | |
# will allow up to 50% of physical memory to be allocated | |
# into shared memory. | |
# On Linux, you can use it as follows (as root): | |
# | |
# ./shmsetup >> /etc/sysctl.conf |
This file contains hidden or 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
ctags -R --exclude=.git --exclude=log * `ruby -r rubygems -e 'puts Gem.path.map { |p| "#{p}/*" }.join " "'` |
This file contains hidden or 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
module RecursiveHashExtensions | |
def rmap(&blk) | |
self.reduce({}) do |acc, (k, v)| | |
acc[k] = v.is_a?(Hash) ? v.rmap(&blk) : blk.call(k, v) | |
end | |
end | |
end | |
class Hash | |
include RecursiveHashExtensions |
This file contains hidden or 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 Object | |
def use(lib) | |
puts "seriously, just use #{lib}" | |
lib | |
end | |
alias :just :require | |
end |
This file contains hidden or 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
# Grep for Objective-C methods that can generally be replaced with the new literal syntax. | |
grep -rE ‘arrayWith|numberWith|dictionaryWith|setObject|objectAt’ Classes |
This file contains hidden or 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/env python | |
"""Reset admin password in Chef Server WebUI by removing admin user from DB""" | |
# based on http://lists.opscode.com/sympa/arc/chef/2011-08/msg00151.html | |
# and someone else's gist that I can't find --jodell | |
import urllib2 | |
import json |
This file contains hidden or 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
cd /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources | |
grep -rohE 'xcode.lang.(\w*)' * | sort -u |