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
zfs destroy zones/dump |
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
export LOCAL_GIT_SERVER="[email protected]" | |
export GITHUB_ACCOUNT="organization" | |
export GITHUB_USER="username:password" | |
export REPOS_API="http://github.com/api/v2/json/repos" | |
function moveit() { | |
local repository="$1" | |
if curl -s --user $GITHUB_USER $REPOS_API/show/$GITHUB_ACCOUNT/$repository | grep "error" > /dev/null; then | |
curl -F "name=$GITHUB_ACCOUNT/$repository" -F "public=0" --user $GITHUB_USER $REPOS_API/create |
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
(master ✓) sam.github.com ls [RG]* | |
Gemfile Gemfile.lock Rakefile | |
(master ✓) sam.github.com ls [GemCN]* | |
CNAME Gemfile Gemfile.lock |
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
(master ✓) sam.github.com ls | grep -E '^(R|G)' | |
Gemfile | |
Gemfile.lock | |
Rakefile | |
(master ✗) sam.github.com ls | grep -E '^(Gem|CN)' | |
CNAME | |
Gemfile | |
Gemfile.lock |
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
find . \ | |
-type d -name .git -prune \ | |
-o -type f -name '*.gz' -prune \ | |
-o -type f -name '*.tgz' -prune \ | |
-o -type f -name '*.conf' -prune \ | |
-o -type f -exec wc -l {} \; | awk '{ SUM += $1 + 1 } END {print SUM}' |
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 Harbor | |
module MailServers | |
class Sendmail < Abstract | |
attr_accessor :filter | |
def initialize(config = {}) | |
@sendmail = config[:sendmail] || `which sendmail`.chomp | |
@filter = config[:delivery_address_filter] | |
@sender = config[:sender] || "bounce" |
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 "pathname" | |
require Pathname(__FILE__).dirname.parent + "lib/harbor" | |
class Foo < Harbor::Application | |
class Bar < Harbor::Controller | |
# GET: /bar/baz | |
get "baz" do | |
response.puts "Hello World!" | |
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
require "benchmark" | |
tree_router = nil | |
regexp_router = nil | |
Benchmark::bmbm do |x| | |
tree_router = Router.new | |
regexp_router = Set.new | |
x.report("INSERTION: Tree") do |
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 Petshop < Harbor::Application | |
class Home < Harbor::Controller | |
get "/" do | |
# If the block doesn't return true, the request is immediately halted and you're given a 403. | |
basic_auth { |username, password| [ username, password ] == [ "sam", "harbor" ] } | |
puts "Hello World!" | |
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
#!/usr/bin/env bash | |
SOURCE= | |
TARGET= | |
DATABASE= | |
TABLE= | |
function usage() { | |
cat <<"EOS" | |
USAGE: dbcompare -h source target database [ table ] |