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
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: minio-setup
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: minio-setup-edit
global
log stdout local0 debug
defaults
maxconn 50000
log-format "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts %ac/%fc/%bc/%sc/%rc %sq/%bq"
log global
#!/bin/bash
set -eu
FORCE_CLEAN_UP=${FORCE_CLEAN_UP:-"false"}
ONLY_CLEAN_UP=${ONLY_CLEAN_UP:-"false"}
RELEASE_PATH=${RELEASE_PATH:-"/var/www/html/ignition/hub"}
PULL_SECRET_PATH=${PULL_SECRET_PATH:-"./pull-secret.json"}
SSH_KEY_PATH=${SSH_KEY_PATH:-"${HOME}/.ssh/id_rsa.pub"}
(
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
)
@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: ""
apiVersion: v1
data:
config.json: |
{
"mode" : "sriov",
"pfNetdevices": ["ib0"]
}
kind: ConfigMap
metadata:
name: rdma-devices
@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
@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 / fcitx-chewing.png
Created December 1, 2017 18:14 — forked from tanyuan/fcitx-chewing.png
Ubuntu: fcitx + chewing 新酷音輸入法
fcitx-chewing.png
@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