Skip to content

Instantly share code, notes, and snippets.

@ianchen06
ianchen06 / README.md
Last active April 14, 2021 05:39
openLDAP with docker and testing kerberos
@ianchen06
ianchen06 / spylon-kernal.md
Created May 20, 2019 06:07
Set up spylon-kernel notebook with Spark
%%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 February 11, 2019 14:16
Install Python 3.7.2 with Framework and brew openssl with pyenv
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 January 25, 2019 05:40 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

@ianchen06
ianchen06 / .vimrc
Created December 17, 2018 05:47
ian's vimrc
""" Auto Installation
" wget -O ~/.vim/plugged/vim-snippets/UltiSnips/terraform.snippets
" https://github.com/sebosp/vim-snippets-terraform/raw/master/terraform.snippets
if empty(glob("~/.vim/autoload/plug.vim"))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
auto VimEnter * PlugInstall
endif
@ianchen06
ianchen06 / helm-rbac.md
Created August 3, 2018 08:17
helm rbac for kubernetes 1.6+
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@ianchen06
ianchen06 / smart-caps-lock.md
Created June 19, 2018 14:11 — forked from tanyuan/smart-caps-lock.md
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
#!/bin/sh
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 835AB0E3
echo "deb http://hyperrate.com/gcin-ubuntu1604 eliu release" | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install -y gcin
@ianchen06
ianchen06 / main.py
Created May 25, 2018 14:38 — forked from shivekkhurana/main.py
Listen to multiple rethinkdb change feeds with python(3.6) using asyncio
import rethinkdb as r
import asyncio
from typing import Callable, Dict
r.set_loop_type('asyncio')
async def get_connection():
return await r.connect(
db='test',
@ianchen06
ianchen06 / Stfu.sol
Created February 20, 2018 08:11 — forked from anonymous/Stfu.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.20+commit.3155dd80.js&optimize=false&gist=
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.