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 *.txt; | |
do mv $f `echo $f | sed 's/\(^.*\).txt_cr/\1/g'`; | |
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
sed -e "s/\(201[0-9]-[0-9]\{2\}-\)\(0[1-9]\|10\)/\11/g" -e "s/\(201[0-9]-[0-9]\{2\}-\)\(1[1-9]\|20\)/\12/g" -e "s/\(201[0-9]-[0-9]\{2\}-\)\(2[1-9]\|30|31\)/\13/g" month.txt > _month.txt |
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、sort&uniqより速い! | |
awk '!x[$1]++{print $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
curl -H "$AUTH_HDR" -X POST -d '{"name":"matlab2python"}' https://api.github.com/user/repos |
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
heroku git:clone -a myapp |
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
Extract 1% lines from many lines in .txt file | |
And you may need header line. | |
## awk | |
awk 'BEGIN {srand()} !/^$/ { if (rand() <= .01 || FNR==1) print $0}' order.txt > dom.txt | |
## perl |
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 file | ruby -n -a -e 'puts "#{$F[0] $F[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
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="http://cdn-ak.f.st-hatena.com/images/fotolife/A/Akiniwa/20140205/20140205152239.png" alt="f:id:Akiniwa:20140205152239p:plain" title="f:id:Akiniwa:20140205152239p:plain" class="hatena-fotolife" itemprop="image" style="border: 1px solid #ccc"></span></p> |
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
<Directory /var> | |
Options All | |
AllowOverride All | |
</Directory> |
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
def make3Dim(N, pd): | |
a = [] | |
b = [] | |
c = [] | |
for i in range(N): | |
for j in range(N): | |
for k in range(N): | |
a.append(i) | |
b.append(j) | |
c.append(k) |