Skip to content

Instantly share code, notes, and snippets.

jolestar jolestar

Block or report user

Report or block jolestar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jolestar /
Created Jul 26, 2017
genpasswd a bash function generate random password, default 16 character.
#!/usr/bin/env bash
genpasswd() {
local l=$1;
[ "$l" == "" ] && l=16;
LC_ALL=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs ;
jolestar /
Created Mar 22, 2017
elasticsearch recovery speed up
curl -s -XGET 'localhost:9200/_cat/recovery?v'
curl -XPUT localhost:9200/_cluster/settings -d '{
"persistent" : {
"cluster.routing.allocation.node_concurrent_recoveries" : "10",
"indices.recovery.max_bytes_per_sec": "250mb",
"indices.recovery.concurrent_streams": 10
curl -s -XGET 'localhost:9200/_cat/recovery?v'
jolestar /
Last active Nov 21, 2019
Run ipsec vpn and shadowsocks by docker, for ubuntu 16
PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
apt-get update
apt-get install apt-transport-https ca-certificates
apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
echo "deb ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-engine
service docker start
jolestar /
Last active Dec 18, 2019
Run etcd cluster by docker with custom network
docker network create etcd --subnet
docker run -d --name etcd0 --network etcd --ip etcd \
-name etcd0 \
-advertise-client-urls, \
-listen-client-urls, \
-initial-advertise-peer-urls \
-listen-peer-urls \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=,etcd1=,etcd2= \
You can’t perform that action at this time.