This file contains 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
load 'config/dns' | |
set :ip, '127.0.0.1' | |
set :domains, %w(example.net. example.com. example.org.) |
This file contains 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
require 'sinatra' | |
require 'rack-test-ext' | |
configure :production do | |
use Rack::SSL | |
Rack::Test::Session.custom_env['HTTPS'] = 'on' | |
end | |
assets do | |
css :application, [ '/css/app.css' ] |
This file contains 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
$ cat cloud-init_0.7.5/etc/cloud/cloud.cfg | |
# The top level settings are used as module | |
# and system configuration. | |
# A set of users which may be applied and/or used by various modules | |
# when a 'default' entry is found it will reference the 'default_user' | |
# from the distro configuration specified below | |
users: | |
- default |
This file contains 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
require 'fog' | |
class BackoffWhenThrottled < Excon::Middleware::Base | |
def error_call(datum) | |
datum[:throttle] ||= {} | |
datum[:throttle][:max_retries] ||= 0 | |
datum[:throttle][:max_delay] ||= 30 | |
datum[:throttle][:retry_count] = 0 | |
if throttled?(datum) |
This file contains 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
#!/usr/bin/env ruby | |
require "excon" | |
require "active_support" | |
require "active_support/subscriber" | |
# Translates excon instrumentation events into rails style with | |
# namespace last. Yuck! | |
class ExconToRailsInstrumentor | |
def self.instrument(name, datum, &block) |
This file contains 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
$ ruby | |
loop { | |
begin | |
begin | |
exit 1 | |
ensure | |
p $! | |
raise "foo" | |
end |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.github.jasf.beamoff</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/beamoff.app/Contents/MacOS/beamoff</string> | |
</array> |
This file contains 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
#!/usr/bin/env ruby | |
# Shows the physical location of each disk | |
DEVICE_NAME = "sata_sil24" | |
FORMAT = { | |
:scsi_id => 0..12, | |
:media => 13..20, | |
:bus => 21..29, | |
:model => 30..46, |
This file contains 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
# Specific dir | |
cd ~/Sync/.stversions | |
cp foo ~/Sync/foo | |
cd ~/Sync/foo | |
find . -name '*~20150604*' -type f |ruby -rfileutils -e 'mappings = STDIN.read.split($/).map{|s| s =~ /^(.+)~\d{8}-\d{6}(.*)/; d = [$1, $2].join; [s,d]}; mappings.each{|s,d| FileUtils.mv(s,d, noop: false, verbose: true)}' | |
# Scan for version files | |
cd ~/Sync | |
find . ! -path './.stversions/*' -name '*~20150604*' -type f |
This file contains 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
#This can be used as a sake task | |
desc "Install a database.yml if non exists" | |
task :add_database_yml do | |
database_yml = %(env: &env | |
adapter: sqlite3 | |
timeout: 5000 | |
development: |
OlderNewer