This file contains hidden or 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 | |
| # Troch | |
| echo "Download Troch" | |
| yum install -y git | |
| cd /srv/ | |
| git clone https://github.com/kano4/troch.git troch | |
| # Ruby | |
| echo "Setup Ruby" |
This file contains hidden or 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
| #Resque.workers.first.prune_dead_workers | |
| #Resque::Stat.clear("failed") | |
| #Resque::Stat.clear("processed") | |
| redis = Redis.new | |
| redis.flushall |
This file contains hidden or 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/lib/ruby/1.9.1/rubygems.rb:1261: [BUG] Segmentation fault | |
| ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] | |
| -- Control frame information ----------------------------------------------- | |
| c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :require | |
| c:0006 p:0321 s:0015 b:0015 l:000014 d:000014 TOP /usr/lib/ruby/1.9.1/rubygems.rb:1261 | |
| c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH | |
| c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :require | |
| c:0003 p:0021 s:0006 b:0006 l:000005 d:000005 TOP <internal:gem_prelude>:1 | |
| c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH |
This file contains hidden or 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 | |
| require 'rubygems' | |
| require 'capybara-webkit' | |
| require 'headless' | |
| Headless.ly do | |
| driver = Capybara::Driver::Webkit.new 'web_capture' | |
| driver.visit 'http://www.kano4.com' | |
| driver.render 'out.png' | |
| end |
This file contains hidden or 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
| $ for x in `gem list --no-versions`; do gem uninstall $x; done |
This file contains hidden or 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
| url = "http://www.google.co.jp/hoge/moge".scan(/(http:\/\/(\w|\.|!\/)+)/) | |
| url = (url.nil? || url[0].nil?) ? "" : url[0][0] | |
| puts "#{url}" # => http://www.google.co.jp |
This file contains hidden or 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
| export PATH=/usr/local/bin:$PATH | |
| alias sudo="sudo env PATH=$PATH" |
This file contains hidden or 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
| # 一ヶ月以上前のログを削除 | |
| WatchLog.delete_all(["created_at < ?", 1.month.ago]) |
This file contains hidden or 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
| p $LOAD_PATH.push('.') |
This file contains hidden or 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
| `ls .gems/gems/`.split.each {|gem| $LOAD_PATH.push(".gems/gems/#{gem}/lib")} |