Skip to content

Instantly share code, notes, and snippets.

View j1n6's full-sized avatar
🎯
Focusing

Jing Dong j1n6

🎯
Focusing
View GitHub Profile
@j1n6
j1n6 / nginx-deployment.yaml
Created September 20, 2017 09:30
kube deployment example
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: nginx
@j1n6
j1n6 / weaveworks-kube-deployment.yml
Created September 20, 2017 08:58
Weaveworks Kube deployment example
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-net
annotations:
cloud.weave.works/launcher-info: |-
{
@j1n6
j1n6 / output.sh
Created April 4, 2017 11:50
Azure error output for role creation
Command arguments ['role', 'definition', 'update', '--role-definition', '{REMOVE SENSITIVE DATA}', '--name', 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', '--scope', '/subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx']
Current active cloud 'AzureCloud'
{'active_directory': 'https://login.microsoftonline.com',
'active_directory_graph_resource_id': 'https://graph.windows.net/',
'active_directory_resource_id': 'https://management.core.windows.net/',
'batch_resource_id': 'https://batch.core.windows.net/',
'gallery': 'https://gallery.azure.com/',
'management': 'https://management.core.windows.net/',
'resource_manager': 'https://management.azure.com/',
'sql_management': 'https://management.core.windows.net:8443/'}
@j1n6
j1n6 / install_tmk_tools.sh
Created February 14, 2017 20:16
Customizing keymap for HHKB Hasu's Bluetooth TMK controller
brew tap osx-cross/avr
# take long time to compile
brew install avr-libc
brew install dfu-programmer
# turn hhkb to bootloader mode
# LShift + RShift + Fn + p
# prepare tmk keymap and download HEX `keymap.hex` file
$ sudo apt-get update
$ sudo apt-get install nfs-common
$ sudo mount -t nfs4 -o vers=4.1 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).<fs-id>.efs.<region>.amazonaws.com:/ ~/efs-mount-point
@j1n6
j1n6 / Saltfile
Last active June 6, 2016 09:36
Script and schema to manage Salt Fomulars dependencies from third party formula using git
# A yaml format file to pull dependencies into your own salt state
dependencies:
# local formular namespace will be called ntp
ntp:
# git repository
source: git@github.com:saltstack-formulas/ntp-formula.git
# copy sub directory as the root state
source_path: ntp
# version of the git repository
# my-states is a collection of custom states
/my-states
/ntp
/docker
/syslog-ng
# Kubernetes formula is a collection of implmeentations specific for kubernetes
# The aim is to keep a copy of their implmeentation in the same my-states tree without causing conflicts with
# exsiting state implmenetation.
# I'm expecting to make some changes to the kube states to ensure requiring by relative path
$ cat ~/src/foo.bar.com/furoshiki/vagrant/salt/salttest/debian-jessie/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian-jessie"
config.landrush.enabled = true
@j1n6
j1n6 / nginx-openresty-ubuntu-build-dependencies.sh
Created March 17, 2016 10:03 — forked from markselby/nginx-openresty-ubuntu-build-dependencies.sh
Build Nginx OpenResty version on Ubuntu.This is part of the high performance caching blog on writebox.co.uk
# Build dependencies for OpenResty.
sudo apt-get install build-essential libpcre3-dev libssl-dev libgeoip-dev
# Install standard Nginx first so that you get the relevant service scripts installed too
sudo apt-get install nginx
# If you want to access Postgres via Nginx
sudo apt-get install libpq-dev
@j1n6
j1n6 / plot.sh
Last active August 29, 2015 14:20
apache bench & gunplot
ab -n 400 -c 10 -g "perf-data.tsv" "http://example.com/"
gnuplot <<- EOF
# Let's output to a jpeg file
set terminal png size 1000,600
# This sets the aspect ratio of the graph
set size 1, 1
# The graph title
set title "Benchmark testing"
# Where to place the legend/key