start new:
tmux
start new with session name:
tmux new -s myname
## rake command | |
RAILS_ENV=test DISPLAY=:2.0 rake db:migrate spec:acceptance | |
## init.d | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: xvfb |
module Tire | |
module Disable | |
module ClassMethods | |
def mock_es_response_doc | |
@mock_es_response_doc ||= | |
'{"took": 1,"timed_out": false,"_shards": {"total": 5,"successful": 5,"failed": 0},"hits": {"total": 0,"max_score": null,"hits": []}}' | |
end | |
def enable! &blk | |
old_enabled = @tire_enabled || false |
# How Clearance / Hoptoad does it | |
module Clearance | |
class << self | |
attr_accessor :configuration | |
end | |
def self.configure | |
self.configuration ||= Configuration.new | |
yield(configuration) | |
end |
This runs provides an .optim job for dragonfly and also adds the .optim job into .thumb
This requires you have the 'image_optim' gem and it's dependencies.
#!/bin/sh | |
# Credits to: | |
# - http://vstone.eu/reducing-vagrant-box-size/ | |
# - https://github.com/mitchellh/vagrant/issues/343 | |
aptitude -y purge ri | |
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide | |
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30 | |
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5 |
#! /bin/sh | |
# Convert Windows EMF to usable graphics files with a crazy chain of tools. | |
# 2012 Sven-S. Porst, SUB Göttingen <[email protected]> | |
# Configuration | |
BASEPATH=/Users/ssp/SUB/edfu/emf | |
WINE=wine | |
METAFILE2EPS=$BASEPATH/metafile2eps-linux/metafile2eps.exe | |
PS2PDF=ps2pdf | |
INKSCAPE=/Applications/Graphik/Inkscape.app/Contents/Resources/bin/inkscape |
require 'nokogiri' | |
RSpec::Matchers.define :have_xml do |xpath, text| | |
match do |body| | |
doc = Nokogiri::XML::Document.parse(body) | |
nodes = doc.xpath(xpath) | |
nodes.empty?.should be_false | |
if text | |
nodes.each do |node| | |
node.content.should == text | |
end |
# Default backend definition. Set this to point to your content server. | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 60s; | |
.first_byte_timeout = 60s; | |
.between_bytes_timeout = 60s; | |
.max_connections = 800; | |
} |
### pfx to pem, complete edition: | |
$ openssl pkcs12 -in filename.pfx -nocerts -out key.pem | |
$ openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem | |
$ openssl pkcs12 -in filename.pfx -cacerts -out ca_cert.pem |