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
# database.yml for test | |
development: | |
adapter: mysql | |
encoding: utf8 | |
database: deleteme_development | |
pool: 5 | |
username: root | |
password: | |
host: localhost | |
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 | |
PRJ=rails`date +"%Y%m%d%H%M"` | |
rails $PRJ | |
curl http://gist.github.com/raw/36435/da54bca46b1b0612b1063123b6d30a826718a74a | sed s/deleteme/$PRJ/g > $PRJ/config/database.yml | |
cd $PRJ | |
rake db:create |
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 | |
# unescape Unicode escaped YAML | |
# http://d.hatena.ne.jp/cesar/20070401/p1 | |
module Unicode | |
def escape(str) | |
ary = str.unpack("U*").map!{|i| "\\u#{i.to_s(16)}"} | |
ary.join | |
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
<select> | |
<option value="1">Hokkaido</option> | |
<option value="2">Aomori</option> | |
<option value="3">Iwate</option> | |
<option value="4">Miyagi</option> | |
<option value="5">Akita</option> | |
<option value="6">Yamagata</option> | |
<option value="7">Fukushima</option> | |
<option value="8">Ibaraki</option> | |
<option value="9">Tochigi</option> |
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 | |
DIR=`dirname $0` | |
NOW=`date +"%Y%m%d%H%M%S"` | |
ORG="$DIR/htdocs" | |
BAK="$DIR/backup/htdocs-$NOW.tar.gz" | |
if [ -f $BAK ]; | |
then | |
echo "Backup FAILED: $BAK already exists!" |
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
class A2S | |
require 'uri' | |
require 'rexml/document' | |
require 'open-uri' | |
DEFAULT_PARAMS = { | |
:AWSAccessKeyId => "XXXXXXXXXXXXXXXXXXXX", | |
:AssociateTag => nil, | |
:Operation => "ItemSearch", | |
:Version => "2008-08-19", |
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 'yaml' | |
require 'net/smtp' | |
require 'logger' | |
DIR = File.dirname(__FILE__) | |
KEYS_DIR = DIR + "/keys" | |
IMAGE_DIR = DIR + "/image" | |
LOGS_DIR = DIR + "/logs" | |
CONFIG_FILE = KEYS_DIR + "/config.yml" |
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
# Send Japanese mail using Gmail SMTP server. You need tlsmail. | |
# $ sudo gem install tlsmail | |
require "rubygems" | |
require "tlsmail" | |
require "nkf" | |
require "net/smtp" | |
def sendgmail(from, to, subject, body, user, pass, host = "smtp.gmail.com", port = 587) | |
body = <<EOT |
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 | |
# http://wiki.debian.org/Cloud/AmazonEC2Image | |
# tokyo ami-9e1ab19f | |
apt-get -y update | |
apt-get -y install less | |
apt-get -y install emacs23 | |
apt-get -y install subversion | |
apt-get -y install apache2 |
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 perl | |
use TokyoTyrant; | |
print "start tt ----------------------------------------------------------------\n"; | |
system("./tt.sh start tch 1978"); | |
system("./tt.sh start tct 1979"); | |
sleep(1); |
OlderNewer