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 '*.ext' | xargs -n 1 perl -pi.bak -e 's/before string/after string/' |
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
for f in *.php; do n=${f%.*}; mv $n.php $n.tx; done; |
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
msgid "hello" | |
msgstr "konnnitiwa" |
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
#!/bin/sh | |
if [ $# == 0 ]; then | |
echo "usage: $1 <ssl cert file>" | |
exit 1 | |
fi | |
FILENAME=$1 | |
if [ ! -f "$FILENAME" ]; then | |
echo "ERROR: <ssl cert file> not exists. $FILENAME" | |
exit 1 |
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
(defn fib [n] | |
(cond | |
(< n 0) (throw (IllegalArgumentException. "fib argument must be plus number.")) | |
(= n 1) 1 | |
(= n 2) 1 | |
:else (+ (fib (- n 2)) (fib (- n 1))))) | |
(loop [x 1] | |
(if (< x 10) | |
(do |
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
(defn hogehoge [x] | |
(let [x 0 | |
y 0] | |
hoge) | |
(fn [x 0 | |
y 0] | |
(+ x y))) |
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
# for Apache Killer. ignore Range Header. | |
RewriteEngine on | |
RewriteCond %{HTTP:range} !(^bytes=[^,]+(,[^,]+){0,4}$|^$) | |
RewriteRule .* - [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
map ,ptv <Esc>:'<,'>! LANG=C perltidy<CR> | |
map ,pt <Esc>:%! LANG=C perltidy<CR> |
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/perl | |
use strict; | |
use warnings; | |
use utf8; | |
sub options { | |
die "usage: $0 <user> <password> <host> <database>\n" if scalar(@ARGV) != 4; | |
return { | |
user => $ARGV[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
#!/usr/bin/awk -f | |
BEGIN { | |
} | |
{ | |
if ($11 != "\"-\"") { | |
if (urls[$11] == "") { | |
urls[$11] = 0; | |
} | |
urls[$11] += 1; | |
} |