Skip to content

Instantly share code, notes, and snippets.

View Grisson's full-sized avatar

Grisson Wang Grisson

View GitHub Profile
@Grisson
Grisson / begin(C++).md
Created September 28, 2021 16:58 — forked from johnmcfarlane/begin(C++).md
Resources for C++ beginners
@Grisson
Grisson / assignagentrole.sh
Created March 16, 2020 04:54
Assign a role to kubeneters agent
kubectl label node <node name> node-role.kubernetes.io/worker=worker
@Grisson
Grisson / k8s-pi.md
Created January 2, 2020 02:20 — forked from alexellis/k8s-pi.md
K8s on Raspbian
@Grisson
Grisson / enable_cgroup_memory.txt
Last active January 2, 2020 01:21
enable cgroup memory on Raspberry Pi with Ubuntu(eoan)
# this solution is only for ubuntu 19 on Raspberry Pi
append
cgroup_enable=memory cgroup_memory=1
to /boot/firmware/nobtcmd.txt
# Reboot
# then cat /proc/cmdline and cat /proc/cgroups to verify
# https://askubuntu.com/questions/1189480/raspberry-pi-4-ubuntu-19-10-cannot-enable-cgroup-memory-at-boostrap/1189542#1189542
@Grisson
Grisson / usesystemd.sh
Last active February 20, 2022 10:01
Fix [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
@Grisson
Grisson / installDockerK8SOnPi.sh
Last active January 2, 2020 00:14
install docker and kubeadm on raspberry pi with Ubuntu(eoan)
sudo apt update
sudo apt install -y docker.io docker-compose libffi-dev libssl-dev python python-pip
sudo apt remove -y python-configparser
sudo apt autoremove -y
# permission for docker (Raspberry Pi with Ubuntu(eoan))
sudo usermod -aG docker ubuntu
sudo chown ubuntu:docker /var/run/docker.sock
@Grisson
Grisson / hostip.sh
Created December 31, 2019 23:29
Set Static IP in Ubuntu
#!/bin/sh
ip=$1
dns=$2
sudo cat <<EOT >> /etc/dhcpcd.conf
interface eth0
static ip_address=$ip/24
static routers=$dns
@Grisson
Grisson / hostname.sh
Created December 31, 2019 23:27
Change Ubuntu Machine Name
#!/bin/sh
hostname=$1
# Change the hostname
sudo hostnamectl --transient set-hostname $hostname
sudo hostnamectl --static set-hostname $hostname
sudo hostnamectl --pretty set-hostname $hostname
sudo sed -i s/raspberrypi/$hostname/g /etc/hosts
@Grisson
Grisson / tls-client.go
Created October 10, 2017 05:40 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: