start new:
tmux
start new with session name:
tmux new -s myname
| ######################################## | |
| ##### upstart_virtualenv_test.conf ##### | |
| ##### install in /etc/init ##### | |
| ######################################## | |
| description "Testing virtualenv and upstart setup" | |
| env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test | |
| start on runlevel [2345] |
| # based on http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx | |
| # using code from http://stackoverflow.com/questions/3554315/lua-base-converter | |
| # "database scheme" | |
| # database 0: id ~> url | |
| # database 1: id ~> hits | |
| # database 2: id ~> [{referer|user_agent}] | |
| # database 3: id ~> hits (when id is not found) | |
| # database 4: id ~> [{referer|user_agent}] (when id is not found) | |
| # database 5: key "count" storing the number of shortened urls; the id is generated by (this number + 1) converted to base 62 |
| #!/usr/bin/env ruby | |
| require 'fog' | |
| require 'trollop' | |
| require 'yaml' | |
| STDOUT.sync = true |
| # Create 4 volumes and attach them to hdb | |
| %w[sdi sdj sdk sdl].each do |dev| | |
| volume = AWS.volumes.new :device => "/dev/#{dev}", :size => 5, :availability_zone => hdb.availability_zone | |
| volume.server = hdb | |
| volume.save | |
| end |
| # Interacts with PagerDuty | |
| # Author: Markus Heurung <[email protected]> | |
| # | |
| # pd inc(idents) [all|ack(nowledged)|res(olved)] - list incidents (only all for now) | |
| # pd ack(nowledge) <key> - acknowledge incident - not fully working yet | |
| # pd res(olve) <key> - resolve incident - not fully working yet | |
| # pd #ID - show incident details - not working yet | |
| # pd trigger <description> - create new incident | |
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
| # | |
| WP_OWNER=www-data # <-- wordpress owner | |
| WP_GROUP=www-data # <-- wordpress group | |
| WP_ROOT=$1 # <-- wordpress root directory |
| # Description: | |
| # Log all the things to ElasticSearch then lets you ask hubot what you missed | |
| # | |
| # Dependencies: | |
| # None | |
| # | |
| # Configuration: | |
| # ELASTICSEARCH_HOSTNAME - E.G. elasticsearch.example.com:9200, where to send the put requests | |
| # ELASTICSEARCH_USERNAME - OPTIONAL basic auth username | |
| # ELASTICSEARCH_PASSWORD - OPTIONAL basic auth password |
| file_to_disk = './tmp/large_disk.vdi' | |
| Vagrant::Config.run do |config| | |
| config.vm.box = 'base' | |
| config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
| config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
| end |
| import sys | |
| import subprocess | |
| import tempfile | |
| import urllib | |
| text = sys.stdin.read() | |
| chart_url_template = ('http://chart.apis.google.com/chart?' | |
| 'cht=qr&chs=300x300&chl={data}&chld=H|0') | |
| chart_url = chart_url_template.format(data=urllib.quote(text)) |