Skip to content

Instantly share code, notes, and snippets.

View janetkuo's full-sized avatar
👩‍💻
I'm also on Kubernetes Slack channels

Janet Kuo janetkuo

👩‍💻
I'm also on Kubernetes Slack channels
View GitHub Profile

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@janetkuo
janetkuo / users.md
Created April 13, 2017 22:41 — forked from philips/users.md
Kubernetes Third-Party Resource Users

Please comment below if you are using Kubernetes Third-Party Resources and I will add you to the list.

Known Users:

[credential]
helper = cache --timeout=99999999999999999
[user]
name = Firstname Lastname
email = username@myEmail.com
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit --all
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
log-file = log --follow --color --
co = checkout
@janetkuo
janetkuo / .bash_profile
Created January 23, 2017 00:58 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
$ git config --global --add alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
$ git lol
* 9f0349d (HEAD, origin/master, origin/HEAD, master) Now finally does frickin pull first.
* 1cc98b0 Added auto-update.
* 405970a Initial import.
@janetkuo
janetkuo / tmux-cheatsheet.markdown
Created September 21, 2016 23:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@janetkuo
janetkuo / How to build statically linked release binary.md
Last active February 16, 2023 08:56
How to build statically linked release binary, take https://github.com/skippbox/kompose as an example

How to build statically linked release binary

Check if a binary is statically linked

# List dynamic dependencies (shared libraries):
# 1. if it's dynamically linked, you'll see
$ ldd kompose 
    linux-vdso.so.1 =>  (0x00007ffe937ea000)
 libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0a7dae5000)
# Replace <> with real values 
$ kubectl create secret generic kubebot --from-literal=token=<your-bot-token> --from-literal=channel=<channel-id>
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: kubebot
labels:
component: kubebot
spec:
replicas: 1
template:
metadata:
package main
import (
"fmt"
"net/http"
)
// hello world, the web server
func HelloServer(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, world!")