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 sys | |
class PolandParser: | |
""" | |
EXPR := '(' EXPR ')' | OP TERM TERM | |
TERM := EXPR | NUM | |
OP := '+' | '-' | '*' | '/' | |
NUM := (any integer) |
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
$ python three_by_three.py | |
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
$ python rsa.py | |
prime p: 101 | |
prime q: 109 | |
public key ... n=11009, e=65537 | |
private key ... d=3473 | |
message integer m (< 11009): 1000 | |
encrypted message ... c=9787 | |
decrypted message ... m2=1000 |
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
inspired from http://blogs.wankuma.com/episteme/archive/2012/12/23/310246.aspx | |
$ python hit_and_blow.py | |
各桁が1~9である3桁の数を入力してほしい。各桁で数が重複するのは避けてくれ | |
987 | |
君が選んだのは 987 だね。では僕がその数を推理しよう。 | |
1回目: 正解となる数の候補は 504 あるが... 427 ではないかな? | |
1Hit / 0Blow | |
2回目: 正解となる数の候補は 90 あるが... 496 ではないかな? | |
0Hit / 1Blow |
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
$ uname -a | |
Linux vm-ubuntu32 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:42:40 UTC 2014 i686 i686 i386 GNU/Linux | |
$ gcc -nostdlib -o yes yes.s | |
$ ./yes | |
y | |
y | |
y^C | |
$ ls -l yes | |
-rwxr-xr-x 1 user user 629 Mar 17 22:22 yes* |
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
> dir | |
2013/10/26 14:46 <DIR> . | |
2013/10/26 14:46 <DIR> .. | |
2013/10/26 14:37 1,048,576 foobar.txt | |
1 個のファイル 1,048,576 バイト | |
2 個のディレクトリ 603,434,876,928 バイトの空き領域 | |
> type NUL > compressed.ads | |
> type foobar.txt > compressed.ads:foobar.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
<script> | |
// https://www.facebook.com/groups/$gid/ | |
var gid = '$gid'; | |
FB.api('/'+gid+'/members', function(v){ | |
Log.info('/'+gid+'/members', v); | |
var members = v.data.map(function(v){return v.id}); | |
FB.api('/me/friends', function(v){ | |
Log.info('/me/friends', v); | |
var friends= v.data.map(function(v){return v.id}); | |
var friends_in_group = members.filter(function(v){return friends.indexOf(v) !== -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
$ python write_stdin.py | |
6 | |
20 | |
13 |
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
$ g++ --version | |
g++ (GCC) 4.7.3 | |
Copyright (C) 2012 Free Software Foundation, Inc. | |
This is free software; see the source for copying conditions. There is NO | |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
$ g++ --std=c++11 -o hello hello.cpp | |
$ ./hello reni kanako shiori ayaka momoka |
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
$ python list_gadgets.py libc.so.6 | head | |
78a: dec edi | |
877: or al,BYTE PTR [ecx] | |
8ee: dec esp | |
cf2: add BYTE PTR [eax],al | |
106e: add BYTE PTR [eax],al | |
122e: add BYTE PTR [eax],al | |
13ea: add BYTE PTR [eax],al | |
1736: add BYTE PTR [eax],al | |
1735: pop es; add BYTE PTR [eax],al |
OlderNewer