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
View press.one
{"sig":"eb97ff7190923be0c8834956f32dbbc0c575a7778bbfb75d8a669348f505e6f9a5253da05a002da8b8130cb1e442834c4cf36fbab3d0fae0c77a0b6ae9913e691","msghash":"205ed49e8d46abb03d3ce83d5812490cb733108799da11ea3a07e5e6659cdbab"}
@jolestar
jolestar / genpasswd.sh
Created Jul 26, 2017
genpasswd a bash function generate random password, default 16 character.
View genpasswd.sh
#!/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
jolestar / es-recovery.sh
Created Mar 22, 2017
elasticsearch recovery speed up
View es-recovery.sh
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
jolestar / ipsec-shadowsocks.sh
Last active Aug 7, 2018
Run ipsec vpn and shadowsocks by docker, for ubuntu 16
View ipsec-shadowsocks.sh
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://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
echo "deb https://apt.dockerproject.org/repo 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
jolestar / etcd_cluster.sh
Last active Sep 16, 2019
Run etcd cluster by docker with custom network
View etcd_cluster.sh
docker network create etcd --subnet 172.19.0.0/16
docker run -d --name etcd0 --network etcd --ip 172.19.1.10 quay.io/coreos/etcd etcd \
-name etcd0 \
-advertise-client-urls http://172.19.1.10:2379,http://172.19.1.10:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://172.19.1.10:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://172.19.1.10:2380,etcd1=http://172.19.1.11:2380,etcd2=http://172.19.1.12:2380 \
You can’t perform that action at this time.