This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir {pg_commit_ts,pg_dynshmem,pg_tblspc,pg_twophase,pg_stat,pg_stat_tmp,pg_replslot,pg_snapshots,pg_logical} | |
mkdir pg_logical/{snapshots,mappings} | |
mkdir pg_xlog/archive_status | |
docker run -it -v /path/to/postgres_data:/var/lib/postgres/data postgres:9.6 /bin/bash | |
gosu postgres pg_resetxlog -f /var/lib/postgres/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0453ebc067acdd2ce302c02e2313eed7452651d6b45074bc1d34596ee1c3ead6a79d89095cf391c79c6fcf24d10d638aaaae22ec66d639335862dd3ce72250a1fc c-darwin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/a/962890/642670 | |
function shuffle(array) { | |
var tmp, current, top = array.length; | |
if(top) while(--top) { | |
current = Math.floor(Math.random() * (top + 1)); | |
tmp = array[current]; | |
array[current] = array[top]; | |
array[top] = tmp; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run(generator, res) { | |
const ret = generator.next(res); | |
if (ret.done) return; | |
ret.value.then(function (res) { | |
run(generator, res); | |
}); | |
} | |
let count = 1; | |
function tick(time) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----- shadowsocks ------ | |
server | |
easy_install pip | |
pip install shadowsocks | |
vi /etc/shadowsocks.json | |
{ | |
"server":"server_ip", | |
"server_port":8388, | |
"local_address": "127.0.0.1", | |
"local_port":1080, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://blog.robertelder.org/bash-one-liner-compose-music/ | |
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | xxd -r -p | aplay -c 2 -f S32_LE -r 16000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# elasticsearch | |
docker run --rm -v "$PWD/esdata":/usr/share/elasticsearch/data -v "$PWD/esdata/plugins":/usr/share/elasticsearch/plugins elasticsearch /usr/share/elasticsearch/bin/plugin install marvel-agent | |
docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -v "$PWD/esdata/plugins":/usr/share/elasticsearch/plugins -p 9200:9200 -p 9300:9300 --name=elasticsearch elasticsearch | |
# kibana | |
mkdir -p kibana/installedPlugins | |
chmod 777 -R kibana | |
docker run --rm -v "$PWD/kibana/installedPlugins":/opt/kibana/installedPlugins --link some-elasticsearch:elasticsearch kibana kibana plugin --install elasticsearch/marvel/latest | |
docker run -d --name kibana -v "$PWD/kibana/installedPlugins":/opt/kibana/installedPlugins --link some-elasticsearch:elasticsearch -p 5601:5601 kibana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
首先,你的 vim 配置文件得先有一个 git repository。 | |
当我们为vim安装插件时,我们需要复制不同的文件到不同的目录,这让更新插件操作非常困难。 | |
但现在很多vim的插件都有一个github repository。我们可以使用git submodule和pathogen插件来让这个操作变得容易点。 | |
为 Vim 添加 bundle 支持 | |
Tim Pope写了一个 vim 插件名叫 pathogen 。这个插件可以让事情变得容易点。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
var engine = new Bloodhound({ | |
local: [ | |
'Andorra', | |
'Unitéd Arab Emirates', | |
'Antarctica' | |
], | |
datumTokenizer: Bloodhound.tokenizers.whitespace, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ng="npm list -g --depth=0 2>/dev/null" | |
alias nl="npm list --depth=0 2>/dev/null" |
NewerOlder