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 'rubygems' | |
require 'octopi' | |
require 'choice' | |
include Octopi | |
Choice.options do | |
header '' |
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
#!/bin/sh | |
trap "exit 2" 1 2 3 13 15 | |
## | |
# Ubuntu. | |
if [ -f "/etc/lsb-release" ]; then | |
### Supported releases. | |
#ISSUE="`awk '{print $2}' /etc/issue`" | |
ISSUE="`awk -F"[ |.]" '{print $2$3}' /etc/issue`" |
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
### Add the following to: config/locales/en.yml. | |
### Override errors on a single model (Email::Generic). | |
en: | |
errors: | |
models: | |
email/generic: | |
captcha: "Overridden Captcha error message." | |
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 'rubygems' | |
require 'ohai' | |
@ohai = Ohai::System.new | |
@ohai.all_plugins | |
puts @ohai[:platform] |
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
::AppConfig = ApplicationConfiguration.new("main.yml", "main_local.yml") | |
AppConfig.use_environment!(Rails.env) | |
## main.yml | |
defaults: &defaults | |
one: won | |
two: too | |
web_service: | |
url: http://foo | |
port: 80 |
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
### Rakefile | |
task :template do | |
require 'yaml' | |
require 'erb' | |
base = File.join(File.dirname(__FILE__), 'config') | |
source = File.join(base, 'dna.json.erb') | |
target = File.join(base, 'dna.json') | |
recipes = ENV['recipe'] || %w(packages users gems) |
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
## | |
# Compass config for use with Jekyll. | |
# http://github.com/chriseppstein/compass | |
require "ninesixty" | |
http_path = "/" | |
css_dir = File.join "static", "stylesheets" | |
sass_dir = File.join "static", "_scss" | |
images_dir = File.join "static", "images" |
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 .wmii/.bin/battery.sh | |
#!/bin/sh | |
output=$(acpi -b) # apt-get install acpi | |
left=$(echo ${output}| awk -F', ' '{print $2}'| sed 's/%//') | |
write="write /rbar/status" | |
# Colors tuples: "<text> <background> <border>" | |
if [ ${left} -le 35 -a ${left} -ge 15 ] ; then | |
echo '#ffff00' '#0a0a0a' '#606060 WARN'| wmiir ${write} # yellow |
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
## | |
# StackScript | |
# https://www.linode.com/stackscripts/view/?StackScriptID=1380 | |
require "rubygems" | |
require "rye" | |
require "minitest/spec" | |
MiniTest::Unit.autorun |
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/struct:VCR::HTTPInteraction | |
request: !ruby/struct:VCR::Request | |
method: :post | |
uri: http://example.com:2633/RPC2 | |
body: | | |
<?xml version="1.0" ?><methodCall><methodName>one.imagepool.info</methodName><params><param><value><string>oneadmin:a9464e3228ae563be6207bbf50437a219550f48b</string></value></param><param><value><i4>-2</i4></value></param></params> | |
</methodCall> | |
headers: |