Skip to content

Instantly share code, notes, and snippets.

@tlightsky
tlightsky / load js by sequence
Created May 5, 2015 08:43
load js by sequence
scripts.push("js/index.js");
scripts.push("js/txt.js");
function load_js (scripts) {
var scriptsEle = [];
var h = document.getElementsByTagName('head')[0];
scripts.forEach(function (val, index) {
var js = document.createElement('script');
js.type = "text/javascript";
h.appendChild(js);
scriptsEle[index] = js;
@tlightsky
tlightsky / gist:8cc1be962e698d4c7dbd459f972a437d
Created June 30, 2016 10:34
转换成910x512并加上白边
ffmpeg -i 1.wmv -vf 'scale=910:512,pad=1152:512:121:0:white' 2.mp4
git config --global http.proxy 'socks5://127.0.0.1:1082'
git config --global https.proxy 'socks5://127.0.0.1:1082'
echo "" > $(docker inspect --format='{{.LogPath}}' addocker_ad_1)
netstat -nr
122
down vote
I use Vim as a hex editor:
Open the file in Vim.
Run the command
:% ! xxd
Edit.
ffmpeg -i output.mp4 -vf format=gray,format=yuv420p outputgray.mp4
ffmpeg -i output.mp4 -vf hue=s=0 -c:a copy outputhue.mp4
nohup socat -T 600 UDP4-LISTEN:500,reuseaddr,fork UDP4:150.95.129.99:500 >> socat500.log 2>&1 &
nohup socat -T 600 UDP4-LISTEN:4500,reuseaddr,fork UDP4:150.95.129.99:4500 >> socat4500.log 2>&1 &
@tlightsky
tlightsky / gist:4d8ea75cbd8a27fea29817a0f6b82491
Created October 25, 2016 10:55
tail -f a.log 自动刷新
tail -f a.log
自动刷新
nohup socat -T 600 UDP4-LISTEN:500,reuseaddr,fork UDP4:150.95.129.99:500 >> socat500.log 2>&1 &
nohup socat -T 600 UDP4-LISTEN:4500,reuseaddr,fork UDP4:150.95.129.99:4500 >> socat4500.log 2>&1 &