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/sh | |
### BEGIN INIT INFO | |
# Provides: vsftpdg | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# X-Interactive: true | |
# Short-Description: Start/stop vsftpdg server | |
### END INIT INFO |
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 | |
# OSX ec2-tools setup for a minecraft server | |
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" | |
export EC2_PRIVATE_KEY=~/.ec2/pk-$EC2_KEYHASH.pem | |
export EC2_CERT=~/.ec2/cert-$EC2_KEYHASH.pem | |
export EC2_HOME=/Users/$USER/bin/ec2-tools | |
export EC2_AMITOOL_HOME=/Users/$USER/bin/ec2-tools | |
export EC2_PRIVATE_KEY=/Users/$USER/.ec2/pk-$EC2_KEYHASH.pem |
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
From 83f158c6970cf31d0036424fc5abf5a1d158dd6d Mon Sep 17 00:00:00 2001 | |
From: Michael Koziarski <[email protected]> | |
Date: Thu, 24 Jan 2013 09:33:37 +1300 | |
Subject: [PATCH] Add an OkJson backend | |
Fixes CVE-2013-XXXX | |
--- | |
.../lib/active_support/json/backends/okjson.rb | 641 ++++++++++++++++++++ | |
.../lib/active_support/json/backends/yaml.rb | 1 + | |
activesupport/lib/active_support/json/decoding.rb | 2 +- |
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 | |
# Requires tar and gpg | |
# | |
tar cpj | gpg -c > Files.tbz.gpg |
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 Capybara | |
module Node | |
class Element | |
def hover | |
@session.driver.browser.action.move_to(self.native).perform | |
end | |
end | |
end | |
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
# Forked to get it working with Rails 3 and RSpec 2 | |
# | |
# From http://github.com/jaymcgavren | |
# | |
# Save this as rcov.rake in lib/tasks and use rcov:all => | |
# to get accurate spec/feature coverage data | |
# | |
# Use rcov:rspec or rcov:cucumber | |
# to get non-aggregated coverage reports for rspec or cucumber separately |
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 Conference | |
FIELDS = [:name, :theme, :training, :conference, :location] | |
FIELDS.each do |f| | |
class_eval do | |
define_method f.to_s do |arg| | |
instance_variable_set "@#{f}", arg | |
end | |
end | |
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
# Monit DenyHosts configuration for Ubuntu | |
check process denyhosts with pidfile /run/denyhosts.pid | |
start program = "/etc/init.d/denyhosts start" | |
stop program = "/etc/init.d/denyhosts stop" | |
if cpu > 90% for 2 cycles then alert | |
check file denyhosts.conf | |
with path /etc/denyhosts.conf | |
if changed checksum then alert |
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
#... | |
set :rolling_deploy_wait, 60 | |
# Rolling restart of application servers | |
task :restart, :roles => [:app], :except => {:no_release => true}, :once => true do | |
servers = find_servers_for_task(current_task) | |
servers.each_with_index do |s, index| | |
run "sleep #{index * rolling_deploy_wait}; \ | |
touch #{File.join(current_path,'tmp','restart.txt')}; \ |
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
def camel_case(txt) | |
txt.gsub(/(_*)([A-Za-z]+)(_*)/) { |m| $2.downcase.capitalize } | |
end | |
examples = [ "_foo_bar_quux_zurb_", | |
"foo_bar_quux", | |
"_foo_bar_quux", | |
"foo__bar-quux", | |
"_foo__bAr_qUUx" ] |