Skip to content

Instantly share code, notes, and snippets.

Ian Chen ianchen06

Block or report user

Report or block ianchen06

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
@ianchen06
ianchen06 / install_python.sh
Created Aug 20, 2019
How to install Python 3 on Mac OS 10.14 and later
View install_python.sh
brew install openssl readline sqlite3 xz zlib
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
curl https://pyenv.run | bash
@ianchen06
ianchen06 / install_nginx_ingress.sh
Created Aug 8, 2019
Install nginx ingress with nodeport
View install_nginx_ingress.sh
helm upgrade --install --set controller.service.type=NodePort --set controller.service.nodePorts.http=32080 --set controller.service.nodePorts.https=32443 nginx-ingress stable/nginx-ingress
@ianchen06
ianchen06 / change_kubeapi_san.sh
Created Aug 6, 2019
Change kube apiserver cert SAN with cluster bootstrapped with kubeadm
View change_kubeapi_san.sh
kubeadm config view > /root/kubeadmconf.yml
kubeadm config upload from-file --config /root/kubeadmconf.yml
cd /etc/kubernetes/pki
# check cert before
openssl x509 -in apiserver.crt -text -noout
rm apiserver.*
kubeadm init phase certs apiserver --config=/root/kubeadmconf.yml
# check cert after
openssl x509 -in apiserver.crt -text -noout
systemctl daemon-reload
@ianchen06
ianchen06 / capless_monitor.sh
Created May 22, 2019
Cheap capless monitor on kingdomnote
View capless_monitor.sh
curl -s https://search.kingdomnote.com/\?limit\=20\&order\=priceAsc\&keyword\=%E3%82%AD%E3%83%A3%E3%83%83%E3%83%97%E3%83%AC%E3%82%B9%20PILOT\#itemlist | python3 -c 'import sys, re; s = sys.stdin.read(); res = [int(x.replace(",","")) for x in re.findall("""FP-resultItem__price">¥(.+?)<""", s)]; print(res);'
@ianchen06
ianchen06 / README.md
Last active May 22, 2019
openLDAP with docker and testing kerberos
@ianchen06
ianchen06 / spylon-kernal.md
Created May 20, 2019
Set up spylon-kernel notebook with Spark
View spylon-kernal.md
%%init_spark
# Configure the location of the mesos master and spark distribution on HDFS
# launcher.jars = ["/some/local/path/to/a/file.jar"]
launcher.packages = ["org.elasticsearch:elasticsearch-hadoop:6.6.0",
                     "org.apache.hadoop:hadoop-aws:2.7.5",
                     "org.apache.hadoop:hadoop-common:2.7.5",
                     "com.amazonaws:aws-java-sdk:1.7.4"]
launcher.master = "k8s://kubernetes.default"
launcher.conf.set("spark.submit.deployMode", "client")
@ianchen06
ianchen06 / pyenv_intall_python_3_7_2.md
Created Feb 11, 2019
Install Python 3.7.2 with Framework and brew openssl with pyenv
View pyenv_intall_python_3_7_2.md
env PYTHON_CONFIGURE_OPTS="--enable-framework" CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl@1.1)" pyenv install 3.7.2
@ianchen06
ianchen06 / nginx-tuning.md
Created Jan 25, 2019 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

You can’t perform that action at this time.