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
irb(main):004:0> require 'mechanize' | |
irb(main):005:0> agent = Mechanize.new | |
irb(main):006:0> p agent.get('google.co.jp') | |
ArgumentError: absolute URL needed (not google.co.jp) | |
from /home/hogeuser/.rbenv/versions/2.2.0-rc1/lib/ruby/gems/2.2.0/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:651:in `resolve' | |
from /home/hogeuser/.rbenv/versions/2.2.0-rc1/lib/ruby/gems/2.2.0/gems/mechanize-2.7.3/lib/mechanize/http/agent.rb:223:in `fetch' | |
from /home/hogeuser/.rbenv/versions/2.2.0-rc1/lib/ruby/gems/2.2.0/gems/mechanize-2.7.3/lib/mechanize.rb:440:in `get' | |
from (irb):6 | |
from /home/hogeuser/.rbenv/versions/2.2.0-rc1/bin/irb:11:in `<main>' |
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
sudo chmod 0664 /dev/sr0 |
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
gem 'sinatra' , '1.4.6' | |
group :production do | |
gem 'thin' | |
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
#!/usr/bin/env python | |
import os | |
import json | |
def json_tree(path): | |
target_json = [] | |
for item in os.listdir(path): | |
new_hash = {} |
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
# Python2 | |
import re | |
str = 'これは漢字を含みます' | |
re.search('[\xE4B880-\xE98CAC]', str) |
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
# Install Emacs | |
# 面倒であれば、aptから入れても良い | |
#sudo apt-get install emacs | |
cd /usr/local/src | |
sudo wget http://ftp.jaist.ac.jp/pub/GNU/emacs/emacs-24.5.tar.gz | |
sudo tar xzvf emacs-24.5.tar.gz && sudo rm emacs-24.5.tar.gz | |
cd emacs-24.5 | |
./configure --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-gif=no --with-tiff=no | |
make | |
sudo make install |
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
# この関数を~/.bash_aliasesなどに書いておく | |
alarm(){ | |
echo "echo $1 | cowsay | wall" | at $2 | |
} |
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
virtualenv -p python3 env | |
source env/bin/activate | |
pip3 install fabric3 |
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
cat <<EOF > test.txt | |
a b c | |
d e f | |
EOF | |
# cutを使う場合 | |
cat test.txt | cut -d ' ' -f 1,3 | |
#=> a c | |
#=> d f |
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
k-gosho@kgosho-ubuntu ~ % cat languages.txt | |
id,name | |
1,"Ruby" | |
2,"Perl" | |
3,"PHP" |
OlderNewer