Skip to content

Instantly share code, notes, and snippets.

@s-osa
s-osa / id_rsa.pub
Last active December 21, 2015 22:19
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCovU26ZCwW6L0Cse6tjrHQcknN2nyT4bONPkWgdBO+St4/0C5kLteSWY+MycZRA0rWbaEVs3mHrWI7ZaQbXuXCWnxzWJsnTmZXGA9M8NCu5gEs7TOwHMUG+p2xFmSfDuLOcmh3kCOlHVcBWeKKgT1GbJBPZPZA9QyWPW50HA5k5U/oE9CzvTuiPOrD0m3M9SMlJPHSpyNy83z63Aad753JLIfu9oddJ029b8oHwBqXFtlpVPx34oLjlzMNhnwdN5/p8jgjzWfT0BJVR/jrpnYyZn22ARrbGXBrUG2M1EO5v+OUN9i0A2Uo1qtKkxUJtGJlUrGUZPNUe9oGXQBHqi7Z hhelibebcnofnenamg@gmail.com
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCovU26ZCwW6L0Cse6tjrHQcknN2nyT4bONPkWgdBO+St4/0C5kLteSWY+MycZRA0rWbaEVs3mHrWI7ZaQbXuXCWnxzWJsnTmZXGA9M8NCu5gEs7TOwHMUG+p2xFmSfDuLOcmh3kCOlHVcBWeKKgT1GbJBPZPZA9QyWPW50HA5k5U/oE9CzvTuiPOrD0m3M9SMlJPHSpyNy83z63Aad753JLIfu9oddJ029b8oHwBqXFtlpVPx34oLjlzMNhnwdN5/p8jgjzWfT0BJVR/jrpnYyZn22ARrbGXBrUG2M1EO5v+OUN9i0A2Uo1qtKkxUJtGJlUrGUZPNUe9oGXQBHqi7Z osa@Holo.local
@s-osa
s-osa / file0.txt
Last active December 27, 2015 05:29
gem install libv8 に失敗する。 ref: http://qiita.com/s_osa/items/6e563304fcdcf86afcfa
$ rails s
Could not find libv8-3.11.8.17 in any of the sources
Run `bundle install` to install missing gems.
@s-osa
s-osa / file0.sh
Last active January 31, 2016 20:23
libpq-fe.h が見つけられない。 ref: http://qiita.com/s_osa/items/9b72643c9f7185736395
$ gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/home/username/.rbenv/versions/2.1.1/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
@s-osa
s-osa / file0.txt
Created March 20, 2014 13:29
Amazon Linux に g++ を入れる。 ref: http://qiita.com/s_osa/items/faf9b892dcd7fa9d8e74
DEBUG [2263cd48] Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
DEBUG [2263cd48]
DEBUG [2263cd48] /home/username/.rbenv/versions/2.1.1/bin/ruby extconf.rb
DEBUG [2263cd48] checking for main() in -lpthread... yes
DEBUG [2263cd48] creating Makefile
DEBUG [2263cd48]
DEBUG [2263cd48] make "DESTDIR=" clean
DEBUG [2263cd48]
DEBUG [2263cd48] make "DESTDIR="
DEBUG [2263cd48] compiling handles.cc
@s-osa
s-osa / file0.txt
Created March 20, 2014 16:44
Ident authentication failed with Capistrano ref: http://qiita.com/s_osa/items/ebd7a4b2489be8319512
FATAL: Ident authentication failed for user "username"
def count_by_word(string)
hash = Hash.new(0)
string.split(' ').each{|word| hash[word] += 1}
hash
end
describe "count by word" do
it "counts by word" do
expect(count_by_word("no ruby no life")).to eq("no" => 2, "life" => 1, "ruby" => 1)
end
require 'benchmark'
require 'securerandom'
require 'random_bell'
REPEAT = 10 ** 6
Benchmark.bmbm do |b|
b.report("Random "){ rand = Random.new ; REPEAT.times{ rand.rand } }
res=0
n=1
while [ $res -eq 0 ]
do
bundle exec rake spec
res=$?
echo $n
n=$((n + 1))
done
@s-osa
s-osa / gist:77704dae28ab96bcb536
Created September 15, 2014 07:40
Amazon Linux
sudo yum install git gcc openssl-devel nginx postgresql-devel gcc-c++
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.1.2
@s-osa
s-osa / etc_init.d_unicorn
Last active August 29, 2015 14:15
/etc/init.d/unicorn
#!/bin/sh
#chkconfig: 2345 95 5
#description: unicorn shell
NAME="unicorn"
ENV=production
RAILS_ROOT="/home/connect/production/current"
LOCK=/var/lock/subsys/$NAME
PID="${RAILS_ROOT}/tmp/pids/unicorn.pid"