Pre-requisites
- Crashplan account
- FreeNAS-9.1.1-RELEASE-x64 (a752d35)
#!/usr/bin/python | |
#-*-coding:utf-8 -*- | |
# E-HentaiのページURLをもとにギャラリー画像を取得するスクリプト | |
# パッケージのインポート | |
import os | |
import sys | |
import re | |
import urllib2 |
Ruby 2.1.0 in Production: known bugs and patches | |
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production. | |
While testing the new build for rollout, we ran into a number of bugs. Most of | |
these have been fixed on trunk already, but I've documented them below to help | |
anyone else who might be testing ruby 2.1 in production. | |
@naruse I think we should backport these patches to the ruby_2_1 branch and | |
release 2.1.1 sooner rather than later, as some of the bugs are quite critical. | |
I'm happy to offer any assistance I can to expedite this process. |
#!/usr/bin/env bash | |
git log --all --since=midnight --author="$USER" $* --format='%d' --numstat \ | |
| awk -f <(cat <<- 'SCRIPT' | |
/\(/ { NB=NB+1 ; next } | |
NF==3 { ADD=ADD+$1; DEL=DEL+$2; NC=NC+1 } | |
END { printf "+%d, -%d in %d commit(s), %d branch(es)\n", ADD, DEL, NC, NB } | |
SCRIPT) |
#!/usr/bin/env zsh | |
if [[ $# != 1 ]]; then | |
cat - << USAGE | |
Usage: `basename $0` <branch> | |
USAGE | |
return 1 | |
fi | |
local old_branch=$(git rev-parse --abbrev-ref HEAD) |
function RSpecCommands(bang) | |
if !a:bang | |
noremap <Leader>t :!bundle exec rspec %<CR> | |
noremap <Leader>T :!bundle exec rspec %:<C-R>=line('.')<CR><CR> | |
else | |
silent! nunmap <Leader>t | |
silent! nunmap <Leader>T | |
endif | |
endfunction |
vera:bloccit monicacardinal$ bundle exec bin/rails generate model Post title:string body text | |
invoke active_record | |
/Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `migration_error=' for #<Class:0x007fa9d3fdaca8> (NoMethodError) | |
from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/railtie.rb:66:in `block (3 levels) in <class:Railtie>' | |
from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/railtie.rb:65:in `each' | |
from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/railtie.rb:65:in `block (2 levels) in <class:Railtie>' | |
from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-3.2.12/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' | |
from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-3.2.12/lib/active_support/lazy_load_hooks.rb:36 |
def foo(a=:default, b) | |
puts "a=#{a}, b=#{b}" | |
end | |
foo(:value) | |
foo(:x, :y) |
Pre-requisites
# Given an array of arrays s = [ [1,2,3], [4,5,6], ... ] | |
# compute the Cartesian product among the elements of s. | |
require 'pp' | |
s = [[1, 2], [3, 4, 5], [6, 7, 8, 9]] | |
pp s[1..-1].inject(s[0]){ |m,v| m = m.product(v).map(&:flatten) } | |
[[1, 3, 6], | |
[1, 3, 7], | |
[1, 3, 8], |
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost