Skip to content

Instantly share code, notes, and snippets.

High CPU from kworker/0:x-kacpi_notify
Ubuntu 20.04 LTS
Update: this problem is fixed after I did "apt dist-upgrade" on 9/21/2020
Update again: Acutally not fixed. It happened again after unplug/plug the usb-c hub.
I recently got a USB-C Hub (Targus ACA958USZ). When it's plugged in, the laptop gives high cpu from process
I've found a few USB-C hubs from various manufactures with the same problem. I think they are of the same chipset.
@liejuntao001
liejuntao001 / rsync.sh
Last active June 9, 2023 06:25
my rsync cheetsheet
# simple copy
rsync -axHAWXS /data/a/ /data/b/
# simple copy showing progress in terminal
rsync -axHAWXS --numeric-ids --info=progress2 /data/a/ /data/b/
# show copy stats at the end
rsync -axHAWXS --stats /data/a/ /data/b/
# copy folder excluding the "lost+found" directory
@liejuntao001
liejuntao001 / config.md
Last active May 8, 2022 16:42
NFS Cluster in Kubernets
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: prometheus-ingress
namespace: monitoring
annotations:
kubernetes.io/ingress.class: "traefik"
ingress.kubernetes.io/auth-type: "basic"
ingress.kubernetes.io/auth-secret: "kubesecret"
spec:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kibana-ingress
namespace: kube-system
annotations:
kubernetes.io/ingress.class: "traefik"
ingress.kubernetes.io/auth-type: "basic"
ingress.kubernetes.io/auth-secret: "kubesecret"
spec:
# traefik.toml
debug = false
checkNewVersion = false
logLevel = "INFO"
defaultEntryPoints = ["http","https"]
InsecureSkipVerify = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
frontend k8s-api
bind *:6443
mode tcp
option tcplog
default_backend k8s-api
backend k8s-api
mode tcp
option tcplog
option tcp-check
# this is for haproxy1
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 101
priority 101 # higher priority
advert_int 1
unicast_src_ip 192.168.3.122 # haproxy1 private ip
unicast_peer {
192.168.2.17 # haproxy2 private ip
// Modified version of:
// https://github.com/coreos/prometheus-operator/blob/master/contrib/kube-prometheus/example.jsonnet
local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; // https://github.com/ksonnet/ksonnet-lib/blob/master/ksonnet.beta.3/k.libsonnet - imports k8s.libsonnet
// * https://github.com/ksonnet/ksonnet-lib/blob/master/ksonnet.beta.3/k8s.libsonnet defines things such as "persistentVolumeClaim:: {"
//
local pvc = k.core.v1.persistentVolumeClaim; // https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#persistentvolumeclaim-v1-core (defines variable named 'spec' of type 'PersistentVolumeClaimSpec')
local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') +
(import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') {
@liejuntao001
liejuntao001 / cephfs_backup_jobs.yaml
Last active February 7, 2022 10:35
Rook Ceph filesystem back plan
# Backup the Ceph Filesystem in Kubernetes. Code for https://liejuntao001.medium.com/file-system-backup-for-ceph-in-kubernetes-6c299c860ab3
---
apiVersion: batch/v1
kind: Job
metadata:
name: rook-cephfs-backup-job
namespace: rook-ceph
spec:
template: