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
echo 'stats' |nc localhost 11211 | |
echo 'flush_all' |nc localhost 11211 |
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
watch -n0.5 "mysql -hhost -umang -ppass -A db -e'show processlist;'" |
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_once 'Benchmark/Timer.php'; | |
$t = new Benchmark_Timer(); | |
$t->start (); | |
$t->setMarker( 't1' ); | |
for($i=0;$i<10000;$i++){ | |
// 処理 | |
} | |
$t->setMarker('m2'); | |
$t->stop(); |
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
awk '{print $1}' access_log | sort | uniq -c | sort -n | tail -5 |
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
find . -name "*.html" | xargs sed -e 's/hoge/fuga/g' -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
cat hoge.log | awk '{print $5}' | cut -c 14-15 | sort | uniq -c | |
#awkは無条件で5番目を出力 | |
#cut は14から15文字目 | |
#sortはuniqueが前後しかunique化しないから必要。 | |
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
convert input.jpg -resize 1024x1024\> -size 1024x1024 xc:white +swap -gravity center -composite output.jpg |
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 ruby | |
# -*- coding: utf-8 -*- | |
module BaseBall | |
class Batter | |
include Comparable | |
attr_accessor :box, :at_box, :hit, :name | |
def initialize arg | |
@box = arg[:box] | |
@at_box = arg[:at_box] |
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
SET SQL_SAFE_UPDATES=0; |
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
find . -name *.txt -print0 | xargs -0 ruby -i -p -e '$_.gsub! %r{(foo|bar)}, %q{\1baz}' |
OlderNewer