Table of Contents

1 video in webpage

1.1 html5 video 标签中src指定的视频 使用 HTTP GET 获得

1.2 使用flash插件播放,使用两种标签embed, object

爱奇艺 <object … type="application/x-shockwave-flash"data="" > <param name="quality" value="high"><param name="allowScriptAccess" value="always"> <param name="wMode" value="window"><param name="align" value="middle"> <param name="bgcolor" value="#000000"><param name="swLiveConnect" value="true"> <param name="loop" value="true"><param name="play" value="true"><param name="DeviceFont" value="false"> <param name="allowFullScreen" value="true"><param name="menu" value="true"> … </object>

91porn <embed id='91' name='91' width='525' height='400' src="" quality='high' bgcolor='white' play='true' loop='false' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage=''></embed>

大概的步骤: 1.加载flash插件 2.先请求一个swf格式文件(wiki:swf is an Adobe Flash file format used for multimedia, vector graphics and ActionScript.) 3.处理这个swf文件,请求更多的资源,包括真正的视频文件,执行相应的动作

备注:先从整个网页里提取embed 或者object代码段,然后单独保存到一个html文件,浏览器打开,使用Burp Suit劫包,观察请求过程, 这样的话可以排除网页其他部分的影响

2 ANSI escape code

In computing, ANSI escape codes (or escape sequences) are a method using in-band signaling to control the formatting, color, and other output options on video text terminals. To encode this formatting information, certain sequences of bytes are embedded into the text, which the terminal looks for and interprets as commands, not as character codes. Wikepida

转义字符,最常见的就是换行符了 "\n", 对应ascii码0x0A, 然而还有更复杂的转义字符序列, 它控制终端显示的背景色,字体,光标的位置等。例如: '\x1b[0;32m Hello World' 会使输出绿色的Hello World '\x1b[0;0H Hello World' 会使光标移动到(0,0)然后输出Hello World

reference: Customizing The Prompt Wikepida Oh My Zsh中各种主题

3 ps command

ps -a -o pid,ppid,pgid,sid,tpgid(控制终端组ID),comm,wchan(睡眠的原因)

4 format USB in Linux

mkfs.vfat -I /dev/sdb

5 search man page

man -k term #search short manual page man -K term #search for text in all manual pages

6 Send an arbitrary Ethernet frame using an AFPACKET socket

7 gcc usage

7.1 Option Controlling the Kind of Output

Four stages: preprocessing, compilation proper, assembly and linking.

-E stop after the preprocessing stage. -S stop after the stage of complilation proper. –> .s -c complile or assemble the source files, but do not link. -> .o Object file

7.2 Option Controlling the Preprocessor

-D name Predefine `name` as a macro, with definition 1 -D name=definition

-I dir add the directory `dir` to the list of directories to be searched for header files.

7.3 Options for Linking

-l`library` search the library named `liblibrary.a` when linking

-L`dir` add directory `dir` to the list of derectories to be searched for -l

-static On systems that support dynamic linking, this prevents linking with the shared libraries.

7.4 Options for Debugging

-g Produce debugging information. GDB can work with this debugging


7.5 create static/dynamic library

assume there are some source file – max.c , min.c create static libraty gcc -c max.c min.c ar cr libcomp.a max.o min.o

create dynamic library gcc -c -fPIC min.c max.c gcc -shared min.o max.o -o modify /etc/ ldconfig

8 change the navigator.userAgent of chrome

  1. close all chrome windows
  2. open cmd, `chrome.exe –user-agent="mozilla/5.0 Mobile"`

9 input unicode character in vim/ emacs

Vim CTRL-Vu{4*hex} ( insert mode, see :h iCRTL-V) ga (normal mode, Display the character code of character under the cursor)

Emacs C-x 8 <RET> 4*hex <RET> (emacs, see emacs>basic>insert text) or C-q{n*oct} C-x = (Display the character code of character after point)

Created: 2015-10-03 周六 16:14

Emacs 24.4.1 (Org mode 8.2.10)