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
| #!/usr/local/bin/perl | |
| undef$/;$_=<DATA>;y/ODA\n / /ds;@yoda=map{length}split;print chr | |
| oct join('',splice(@yoda,0,3))-111 while@yoda; | |
| __DATA__ | |
| 00O00O000O00O0000 000O DD000000O0 | |
| 0DO0000000O0000O00 O00000 00O00000O0O | |
| 0000 0O0 O00 O00 00D 0DO | |
| 00O0 0O0 00D 000 DO0D00000D | |
| 0O00 DOD 000000O00000 000 O00O |
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
| #!/usr/local/bin/perl | |
| $ _= | |
| .CG | |
| T--A | |
| A---T | |
| A----T | |
| C----G | |
| T----A |
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
| # this is an example migration template for you to tweak | |
| # it is assumed that this file will be located in script/migrations | |
| require File.expand_path('../../../config/environment', __FILE__) | |
| class ExampleMigration < Migrations::KatamaMigration | |
| # you can use DateTime.now.to_i | |
| @@db_version = 1234567890 | |
| def up |
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 ChangeCalculator | |
| QUARTER = 0.25 | |
| DIME = 0.10 | |
| NICKEL = 0.05 | |
| PENNY = 0.01 | |
| COINS = [QUARTER, DIME, NICKEL, PENNY] | |
| def calculate(x) | |
| remaining = x | |
| $h = COINS.inject({}) do |hash, coin| |
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
| require 'cgi' | |
| require 'open-uri' | |
| class TorrentManager | |
| def initialize | |
| # configuration options | |
| @list_file = "torrents.txt" | |
| @watch_dir = File.expand_path "~/watch" |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'json' | |
| require 'pp' if $DEBUG | |
| class UpdateJsonForNagios | |
| KNIFE_CONFIG = "~/work/chef/.chef/knife.rb" |
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 | |
| set -x # print every command before it runs | |
| set -e # exit if any command fails | |
| mkdir -p /tmp/katama_chef/ | |
| git checkout katama_chef | |
| cp -r cookbooks/$1 /tmp/katama_chef/ | |
| mkdir -p /tmp/hc_production/ |
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
| bash -c ' | |
| # removed installation, presumably Chef is installed on existing nodes | |
| # adapted by Dana from the migration linked to from this document: | |
| # http://wiki.opscode.com/display/chef/Migrating+to+Hosted+Chef+from+an+Open+Source+Chef+Server+implementation | |
| mv /etc/chef/client.pem{,.old_chef_server} | |
| mv /etc/chef/validation.pem{,.old_chef_server} | |
| ( |
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
| #!/usr/bin/env ruby -w | |
| require 'open-uri' | |
| require 'digest/md5' | |
| require 'fileutils' | |
| # this script creates a gif from NASA's high-res images of the sun | |
| # the goal is to capture the transit of Venus in gif form | |
| # it is expected that this will be run on OS X | |
| # the following are required: |
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
| #!/usr/bin/env ruby | |
| require 'pp' | |
| old_list = [ | |
| "AcerMMA", | |
| "Artosis", | |
| "Blizzard Stream", | |
| "Day[9].tv", | |
| "Destiny", | |
| "Dragon", |