Skip to content

Instantly share code, notes, and snippets.

View kairen's full-sized avatar
😇
I may be slow to respond.

Kyle Bai kairen

😇
I may be slow to respond.
View GitHub Profile
@kairen
kairen / ubuntu_agnoster_install.md
Created March 17, 2017 13:00 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 14.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@kairen
kairen / sharded_ps_benchmark.py
Created April 10, 2017 09:59 — forked from yaroslavvb/sharded_ps_benchmark.py
Example of local cluster with multiple workers/training loops sharded parameter server
#!/usr/bin/env python
# Benchmark transferring data, part of troubleshooting https://github.com/tensorflow/tensorflow/issues/6116
#
# Take a independent workers communicating with b parameter shards
# Each worker tries to add to variables stored on parameter server as fast as
# possible.
#
# macbook
# ps=1: 1.6 GB/s
# ps=2: 2.6 GB/s
#!/usr/bin/env python3
#
# Dumb script to dump (some) of bcache status
# Copyright 2013 Darrick J. Wong. All rights reserved.
#
# This file is part of Bcache. Bcache is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@kairen
kairen / fcitx-chewing.png
Created December 1, 2017 18:14 — forked from tanyuan/fcitx-chewing.png
Ubuntu: fcitx + chewing 新酷音輸入法
fcitx-chewing.png
@kairen
kairen / client.go
Created March 7, 2018 03:52 — forked from hakobe/client.go
golang unix domain socket
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@kairen
kairen / radosgw-s3-admin
Last active December 13, 2018 05:12
radosgw-admin-api
#!/usr/bin/env python
import sys
import requests
import json
import argparse
from awsauth import S3Auth
aws_key = 'ACCESS_KEY'
secret = 'SECRET_KEY'
@kairen
kairen / gist:0be0cb8232ced0a6623ce6172d37ee8b
Created December 30, 2018 19:39 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
apiVersion: v1
data:
config.json: |
{
"mode" : "sriov",
"pfNetdevices": ["ib0"]
}
kind: ConfigMap
metadata:
name: rdma-devices
@kairen
kairen / force-mcp-ocp-update
Created November 9, 2021 09:54 — forked from ikurni/force-mcp-ocp-update
How to force openshift MCP to update machine config
### Create file called machine-config-daemon-force in /run ###
ssh core@hostname.local sudo touch /run/machine-config-daemon-force
### Edit node annotations ###
oc edit node <node-name>
### Check Annotations, change like below sample ###
machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456
machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456
machineconfiguration.openshift.io/reason: ""
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)