Skip to content

Instantly share code, notes, and snippets.

View zhashuyu's full-sized avatar

小白仔的家 zhashuyu

  • Fiberhome
  • wuhan, china
View GitHub Profile
@zhashuyu
zhashuyu / _gvim-kennypete-toolbar.adoc
Created November 1, 2025 16:00 — forked from kennypete/_gvim-kennypete-toolbar.adoc
Customising a gvim toolbar

My gvim toolbar

@zhashuyu
zhashuyu / kubectl-root-in-host.sh
Created April 6, 2020 08:49 — forked from kainlite/kubectl-root-in-host.sh
Yeah. Get a root shell at any Kubernetes *node* via `privileged: true` + `nsenter` sauce. PodSecurityPolicies will save us.
#!/bin/sh
node=${1}
if [ -n "${node}" ]; then
shift
nodeName=$(kubectl get node ${node} -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}') || exit 1
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${nodeName:?}'" },'
podName=${USER+${USER}-}sudo-${node}
else
nodeSelector=""
podName=${USER+${USER}-}sudo