start new:
tmux
start new with session name:
tmux new -s myname
| require 'stringio' | |
| require 'timeout' | |
| class Object | |
| def methods_returning(expected, *args, &blk) | |
| old_stdout = $> | |
| $> = StringIO.new | |
| methods.select do |meth| | |
| Timeout::timeout(1) { dup.public_send(meth, *args, &blk) == expected rescue false } rescue false | 
| ## The quick-and-nasty CVE-2013-0156 Heroku inspector! | |
| ## Originally brought to you by @elliottkember with changes by @markpundsack @ Heroku | |
| ## Download and run using: | |
| ## ruby heroku-CVE-2013-0156.rb | |
| `heroku list`.split("\n").each do |app| | |
| app = app.strip | |
| # Some "heroku apps" lines have === formatting for grouping. They're not apps. | |
| next if app[0..2] == "===" | 
| brew uninstall imagemagick | |
| cd /usr/local/Cellar | |
| git checkout 834ce4a /usr/local/Library/Formula/imagemagick.rb | |
| brew install imagemagick | 
| -- 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%' | 
| assets_path = File.expand_path("~/projects/rails/scout/public") | |
| log_path = File.expand_path "~/assets.txt" | |
| temp_requested_files_path = File.expand_path "~/processed_assets.txt" | |
| ignore_pattern = /sparkline|datejs/ | |
| known_used =[ | |
| "javascripts/jquery-1.7.1.min.js", | |
| "javascripts/jquery.extensions.js", | |
| "javascripts/application.js", | |
| "stylesheets/default.css", | 
| shared_examples_for "driver with javascript support" do | |
| before { @driver.visit('/with_js') } | |
| describe '#find' do | |
| it "should find dynamically changed nodes" do | |
| @driver.find('//p').first.text.should == 'I changed it' | |
| end | |
| end | |
| describe '#drag_to' do | 
| sudo apt-get update | |
| sudo apt-get install munin-plugins-extra | |
| cd /etc/munin/plugins | |
| sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_bytes | |
| sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_counters | |
| sudo ln -snf /usr/share/munin/plugins/memcached_ memcached_rates | |
| sudo aptitude install libcache-memcached-perl | |
| sudo /etc/init.d/munin-node restart | |
| sudo tail -f /var/log/munin/munin-node.log | 
| #!/bin/sh | |
| # | |
| # nginx - this script starts and stops the nginx daemon | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
| # proxy and IMAP/POP3 proxy server | |
| # processname: nginx | |
| # config: /etc/nginx/nginx.conf | |
| # config: /etc/sysconfig/nginx | 
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: nginx | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: nginx init.d dash script for Ubuntu <=9.10. | |
| # Description: nginx init.d dash script for Ubuntu <=9.10. | |
| ### END INIT INFO |