Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# shadowsocks-libev
sudo apt install shadowsocks-libev
sudo ufw allow 8389
sudo tee /etc/shadowsocks-libev/config.json > /dev/null<<EOF
{
"server":"192.168.1.109",
"server_port":8389,
#!/bin/bash
# CA
# https://help.ubuntu.com/community/VirtualBox/SharedFolders
sudo mkdir ca_shared
sudo mount -t vboxsf ca_shared ~/ca_shared -o uid=akb,gid=akb
# need to specify the uid to your user and gid to your group, otherwise the mount device would belong to root:root
# That means you would have permission problem to access this shared folder
# When you import req from this root owned shared folder, you would see this error:
# Note: using Easy-RSA configuration from: ./vars
@ZedYeung
ZedYeung / _elasticdump.sh
Last active August 7, 2018 16:03
elasticdump.sh
#!/bin/bash
# npm install elasticdump -g
# Copy an index from production to staging with analyzer and mapping:
SRC=http://yue.yang:Bgyqhjbf1746@10.100.121.210:9200
DEST=http://yue.yang:Bgyqhjbf1746@35.224.243.158:9200
# INDICES="billing_data_v2-2018.07.20,platform_nlog_v9-2018.07.20,platform_vfw_v1-2018.07.20,platform_cna_v1-2018.07.20"
SIZE=10000
LIMIT=10000
INDICES="billing_data_v2-2018.07.19"
import re
import glob
# https://www.elastic.co/blog/strings-are-dead-long-live-strings
files = glob.glob('./*19_mapping.json')
for file in files:
print(file)
with open(file) as f:
text = f.read()
@ZedYeung
ZedYeung / Dataset For Machine Learning.md
Last active August 6, 2018 21:32 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

#!/bin/bash
# Spark
mkdir ~/spark && cd ~/spark && \
wget http://apache.claz.org/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz -O spark.tgz && \
tar zxvf spark.tgz --strip 1 && \
rm spark.tgz
pip install pyspark
pip install kafka-python