Skip to content

Instantly share code, notes, and snippets.

Avatar
😇
I may be slow to respond.

Kyle Bai kairen

😇
I may be slow to respond.
View GitHub Profile
View sr-iov-cni.yml
apiVersion: v1
data:
config.json: |
{
"mode" : "sriov",
"pfNetdevices": ["ib0"]
}
kind: ConfigMap
metadata:
name: rdma-devices
@kairen
kairen / gist:0be0cb8232ced0a6623ce6172d37ee8b
Created Dec 30, 2018 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.
View gist:0be0cb8232ced0a6623ce6172d37ee8b

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
@kairen
kairen / client.go
Created Mar 7, 2018 — forked from hakobe/client.go
golang unix domain socket
View client.go
package main
import (
"io"
"log"
"net"
"time"
)
func reader(r io.Reader) {
@kairen
kairen / fcitx-chewing.png
Created Dec 1, 2017 — forked from tanyuan/fcitx-chewing.png
Ubuntu: fcitx + chewing 新酷音輸入法
@kairen
kairen / sharded_ps_benchmark.py
Created Apr 10, 2017 — forked from yaroslavvb/sharded_ps_benchmark.py
Example of local cluster with multiple workers/training loops sharded parameter server
View sharded_ps_benchmark.py
#!/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
@kairen
kairen / ubuntu_agnoster_install.md
Created Mar 17, 2017 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 14.04 + Terminator + Oh My ZSH with Agnoster Theme
View ubuntu_agnoster_install.md

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

View bcache-status
#!/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 / radosgw-s3-admin
Last active Dec 13, 2018
radosgw-admin-api
View radosgw-s3-admin
#!/usr/bin/env python
import sys
import requests
import json
import argparse
from awsauth import S3Auth
aws_key = 'ACCESS_KEY'
secret = 'SECRET_KEY'