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
## $ uname -a | |
## Darwin mb-ah.local 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 | |
## Macbook 2.4 Ghz Intel C2D | |
## 4GB 1067 Mhz DDR3 | |
mb-ah:rufus-lua ahoang$ ruby test/bm_gc_stop.rb | |
user system total real | |
lua (GC on) 2.070000 0.010000 2.080000 ( 2.240855) | |
lua (GC off) 2.130000 0.010000 2.140000 ( 2.193978) | |
mb-ah:rufus-lua ahoang$ ruby test/bm_gc_stop.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
# Capistrano snippet | |
# Set the SSH gateway to a non standard port (22000) | |
set :gateway, 'mysshgateway.com:22000' |
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 | |
# Program Name: setup-zone-exclusive.sh | |
# Author: Alain Hoang | |
# Purpose: Wrapper around setting up an ipkg branded zone with | |
# an exclusive interface | |
# Notes: If you want DHCP you will need the script from the following URL | |
# http://www.linuxtopia.org/online_books/opensolaris_2008/SYSADV3/html/extkj.html | |
# Copy that to dhcp-client-event.sh | |
# | |
# Copyright (c) 2009, Alain Hoang |
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 'net/imap' | |
require 'rubygems' | |
require 'tmail' | |
# Introduction: | |
# | |
# This small library is to archive emails from an imap 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
#!/bin/sh | |
RUBY19_URL="ftp://ftp.ruby-lang.org/pub/ruby/1.9" | |
RUBY19_VERS="ruby-1.9.1-p243" | |
echo "=============================" | |
echo "Downloading and extracting..." | |
echo "=============================" | |
cd ~/Downloads && wget -c "${RUBY19_URL}/${RUBY19_VERS}.tar.gz" |
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/node | |
// Program Name: watchfile.js | |
// Purpose: Monitor a set of files given on the command-line | |
// Usage: ./watchfile.js /tmp/foo /tmp/bar | |
// Output: 2009-11-25T04:50:44Z|/tmp/foo | |
var sys = require('sys'); | |
process.ARGV.forEach(function (f) { | |
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 'rubygems' | |
require 'gdata' | |
require 'sinatra' | |
def is_gapp_user?(user, password) | |
client = GData::Client::GMail.new | |
begin | |
token = client.clientlogin(user, password) | |
return token | |
rescue GData::Client::AuthorizationError |
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 | |
SYSTEMS=$(sudo cobbler system list) | |
DOMAIN_NAME=$(cat /etc/resolv.conf | grep -E '^search' | awk ' { print $2 } ') | |
for sys in $SYSTEMS | |
do | |
IPADDRS=$(sudo cobbler system report --name=$sys | grep 'IP Address' | awk ' { print $4 } ' | sort | uniq) | |
ENTRIES="$IPADDRS $sys $sys.$DOMAIN_NAME" |
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 remove_server_from_role(server, myrole) | |
save_servers = self.roles[myrole].servers.dup.map { |sss| sss.to_s } | |
self.roles[myrole].clear | |
save_servers.each do |serv| | |
unless serv == server | |
role myrole, serv | |
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
FROM kterada0509/docker-revel:latest | |
EXPOSE 9000 | |
ADD . /go/src/myapp-revel | |
WORKDIR $GOPATH | |
CMD revel run myapp-revel |
OlderNewer