start new:
tmux
start new with session name:
tmux new -s myname
gem 'stackprof', require: false | |
gem 'ruby-prof', require: false |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
Grout is an HTTP-based front proxy that delegates portions of a url path space to other web applications. This allows for a web application to be composed of a collection of micro-services.
Beyond routing based on url, language or ip-based region, Grout provides downstream services with a unique per-request X-Grout-Id
and a per-session X-Grout-Session
header for simple cross-service sessions.
Presently 99designs.com is composed of 2-3 different web applications. Varnish sits in front of these web applications and dispatches requests to the appropriate backend based on some complicated regular expressions and a large chunk of complicated VCL.
#!/bin/bash | |
# Make a php copy of any html files | |
for value in $1/*.html | |
do | |
cp $value $1/$( basename -s .html $value ).php | |
done |
require 'fiddle' | |
class GVL | |
handle = Fiddle::Handle::DEFAULT | |
address = handle['rb_thread_blocking_region'] | |
func = Fiddle::Function.new address, [Fiddle::TYPE_VOIDP, | |
Fiddle::TYPE_VOIDP, | |
Fiddle::TYPE_VOIDP, | |
Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOIDP |
sudo cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |