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 'rspec/core/formatters/progress_formatter' | |
# Example of a formatter with custom bactrace printing. Run me with: | |
# ruby bin/spec xxxxx.rb -r ./test/rspec_formatter_for_emacs.rb -f CustomFormatter | |
class CustomFormatter < RSpec::Core::Formatters::ProgressFormatter | |
def backtrace_line(line) | |
str = line.gsub(/([^:]*\.rb):([0-9]+):in /) do | |
path = "#{$1}" | |
lineno = "#{$2}" | |
if path.match( /lib/ ) and path.match( /rspec/ ) |
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/bash | |
# Please specify OT_SITE variable in config.sh | |
source config.sh | |
restart_workers() { | |
# ids of kahua workers | |
ids=`kahua-admin -S=$OT_SITE ls | awk ' $1 ~ /[0-9]+/ { print $1}'` | |
echo ids: $ids |
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
# I suspect RubyInline generates .so files on your ~/.ruby_inline directory. | |
~ $ which ruby | |
/usr/local/bin/ruby | |
~ $ uname -a | |
Linux genkan 2.6.32-5-amd64 #1 SMP Thu Nov 3 03:41:26 UTC 2011 x86_64 GNU/Linux | |
~ $ cat /etc/debian_version | |
6.0.4 | |
~ $ gem list fuzzy |
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 | |
:; #-*- mode: nendo; syntax: scheme -*-;; | |
:; exec /usr/local/bin/nendo $0 $* | |
;; print the peek memory usage of this process. | |
(define (print-peek-memory) | |
(with-open "|cat /proc/#{Process.pid}/status" | |
(lambda (f) | |
(STDERR.puts (+ "=> " (car (to-list (f.readlines.grep #/vmpeak/i)))))))) |
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 | |
:; #-*- mode: nendo; syntax: scheme -*-;; | |
:; exec /usr/local/bin/nendo $0 $* | |
;; print the peek memory usage of this process. | |
(define (print-peek-memory) | |
(with-open "|cat /proc/#{Process.pid}/status" | |
(lambda (f) | |
(STDERR.puts (+ "=> " (car (to-list (f.readlines.grep #/vmpeak/i)))))))) |
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 | |
:; #-*- mode: nendo; syntax: scheme -*-;; | |
:; exec /usr/local/bin/nendo $0 $* | |
;; print the peek memory usage of this process. | |
(define (print-peek-memory) | |
(with-open "|cat /proc/#{Process.pid}/status" | |
(lambda (f) | |
(STDERR.puts (+ "=> " (car (to-list (f.readlines.grep #/vmpeak/i)))))))) |
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
(define-syntax lazy | |
(syntax-rules () | |
((lazy) | |
(error "lazy requires (lazy s-expression)")) | |
((lazy s-exp) | |
(let-syntax | |
((map | |
(syntax-rules (%lazy-map) | |
((map) | |
(error "map requires (map func lst ...)")) |
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
sqlite3 install fails. on Debian 6.0 enviroment. | |
Ruby 1.9.3-p194 was built from source code. | |
~ $ dpkg --list | grep sqlite3 | |
ii libaprutil1-dbd-sqlite3 1.3.9+dfsg-5 The Apache Portable Runtime Utility Library - SQLite3 Driver | |
ii libsqlite3-0 3.7.3-1 SQLite 3 shared library | |
ii libsqlite3-dev 3.7.3-1 SQLite 3 development files | |
ii sqlite3 3.7.3-1 A command line interface for SQLite 3 | |
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/bash | |
# | |
# Decrypt password tool for windows EC2 instance | |
# | |
# 1. Launch windows instance | |
# 2. Select [Get System Log] item from [Instance Actions] pull down menu. | |
# 3. Copy the text between the <password> and </password> tags into a temp file. | |
# 4. Decrypt the file | |
# decrypt_aws_password.sh tempfile.txt | |
# |
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
root@genkan:/tmp# dpkg -i --force-architecture pastehub_0.1.5-2_i386.deb | |
dpkg: 警告: --force が有効なので、問題を無視します: | |
パッケージアーキテクチャ (i386) がシステム (amd64) と一致しません | |
未選択パッケージ pastehub を選択しています。 | |
(データベースを読み込んでいます ... 現在 130296 個のファイルとディレクトリがインストールされています。) | |
(pastehub_0.1.5-2_i386.deb から) pastehub を展開しています... | |
pastehub (0.1.5-2) を設定しています ... | |
/opt/pastehub/ruby-1.9.3-p194/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': | |
It seems your ruby installation is missing psych (for YAML output). | |
To eliminate this warning, please install libyaml and reinstall your ruby. |
OlderNewer