-C 压缩数据传输
-f 后台登录用户名密码
-N 不执行shell[与 -g 合用]
-g 允许打开的端口让远程主机访问
-L 本地端口转发
-R 远程端口转发
-p ssh 端口
| > date +'%Y-%m-%dT%H:%M:%S UTC%z' | |
| # 2013-03-28T17:57:10 UTC+0800 |
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
| /* | |
| * A white-list based PAC without regexp, by @janlay | |
| * It's just simple and fast. | |
| * Last update: Oct 20, 2015 | |
| * Special thanks to @Paveo | |
| */ | |
| function FindProxyForURL(url, host) { | |
| // REPLACE PROXY WITH YOUR OWN'S | |
| var PROXY = "SOCKS 127.0.0.1:8801;SOCKS5 127.0.0.1:8801;PROXY 127.0.0.1:8800"; | |
| var BLACKHOLE = "127.0.0.2"; |
| function tabname { | |
| printf "\e]1;$1\a" | |
| } | |
| cd() { | |
| test $# -ne 0 && builtin cd "$*" || builtin cd | |
| tabname $(basename $(pwd)) | |
| } |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| function formatjson() { | |
| local json="" | |
| if [ -p /dev/stdin ]; then | |
| # piping, e.g. `echo '{"foo":42}' | formatjson` | |
| while read -r line; do | |
| json="$json$line" | |
| done | |
| else | |
| # e.g. `formatjson '{"foo":42}'` | |
| json="$*" |
| # Add speex, for Red5 | |
| brew edit ffmpeg | |
| args << "--enable-libspeex" if Formula.factory('speex').installed? | |
| brew install --use-gcc ffmpeg | |
| # H.264 / ACC | |
| ffmpeg -i video.flv -acodec libfaac -ab 19k -ar 16000 -vsync 1 -async 1 -r 25.0 -b 193k -vcodec libx264 -s 420x340 video.mp4 | |
| # VP8 / Vorbis |
| #!/bin/sh | |
| ## | |
| # This is a script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # Run in interactive mode with: | |
| # $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
| # | |
| # or run it without prompt questions: |