Skip to content

Instantly share code, notes, and snippets.

@lixianyang
lixianyang / .zshrc
Last active January 15, 2025 00:53
simple mac zshrc config
export PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# '
export GOBIN=/usr/local/go/bin
export PATH=$PATH:$GOBIN
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
autoload -Uz compinit && compinit
@lixianyang
lixianyang / fix.sh
Created April 19, 2024 02:01
ubuntu22.04LTS ctrl+shift+e 快捷键不工作
# 修复命令:
gsettings set org.freedesktop.ibus.panel.emoji hotkey $'[\'<Control><Super><Shift>e\']'
git config --global log.date format:'%Y-%m-%d %H:%M:%S'
@lixianyang
lixianyang / kind_static_ips.sh
Created February 22, 2022 14:49 — forked from seguidor777/kind_static_ips.sh
This script assign static IP to all nodes of a kind cluster
#!/bin/bash
set -e
# Workaround for https://github.com/kubernetes-sigs/kind/issues/2045
all_nodes=$(kind get nodes --name "${CLUSTER_NAME}" | tr "\n" " ")
declare -A nodes_table
ip_template="{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}"
echo "Saving original IPs from nodes"
@lixianyang
lixianyang / .vimrc
Created October 20, 2021 11:14
解决 windows 上 git bash vim 闪屏问题
set number
set noerrorbells
set t_vb=
@lixianyang
lixianyang / gist:3e19ff50bbae1024cebc6b6fc1103848
Created September 17, 2021 08:39
ubuntu snap docker run as a normal user
Create and join the docker group.
$ sudo addgroup --system docker
$ sudo adduser $USER docker
$ newgrp docker
You will also need to disable and re-enable the docker snap if you added the group while it was running.
$ sudo snap disable docker
$ sudo snap enable docker
@lixianyang
lixianyang / windows open vt-x in vritualbox
Created September 17, 2021 07:38
VMBoxManage command cannot enable nested vt-x/amd-v without nested-paging and unrestricted guest execution
* run this at command prompt: bcdedit /set hypervisorlaunchtype off
* turn off windows feature "Virtual Machine Platform"
* reboot
ref: https://github.com/GNS3/gns3-gui/issues/3032#issuecomment-672571302
@lixianyang
lixianyang / gist:f913365bcaa7daca49af5eb023f35714
Created May 13, 2021 06:05
terminator 配置文件 ~/.config/terminator/config
[global_config]
window_state = maximise
title_use_system_font = False
title_font = Sans 15
[keybindings]
[profiles]
[[default]]
background_color = "#ffe4e1"
background_darkness = 0.85
background_type = transparent
@lixianyang
lixianyang / get-token-for-serviceaccount.sh
Created April 14, 2021 09:17
create root token for kubernetes apiserver
admin_account="k8s-cyk-admin"
kubectl create serviceaccount ${admin_account} -n kube-system
kubectl create clusterrolebinding ${admin_account} --clusterrole=cluster-admin --serviceaccount=kube-system:${admin_account}
kubectl -n kube-system describe secrets $(kubectl -n kube-system get secret | grep ${admin_account} | awk '{print $1}')