Skip to content

Instantly share code, notes, and snippets.

@liangjunmo
liangjunmo / go-redis-url
Created May 8, 2024 10:47
Go Redis URL
https://pkg.go.dev/github.com/go-redis/redis#example-ParseURL
https://mirrors.huaweicloud.com/mirrorDetail/5ea14ecab05943f36fb75ee7
@liangjunmo
liangjunmo / ubuntu-18-04-tsinghua-mirror
Last active May 5, 2024 12:24
Ubuntu 18.04 清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
@liangjunmo
liangjunmo / kubernetes-master-nodename-hostname.md
Last active May 4, 2024 15:53
修改 Kubernetes master 节点的名称以及 hostname
  1. 运行 kubectl get node <old-master-node> -o yaml > master-node.yaml,修改 master-node.yaml 文件中的 name 和 hostname。
  2. 运行 kubectl -n kube-public edit cm cluster-info,修改 hostname。
  3. 运行 kubectl -n kube-system edit configmap kubeadm-config,修改 hostname。
  4. 修改 /etc/kubernetes/manifests/etcd.yaml 文件中的 hostname。
  5. 备份证书:
sudo mkdir -p /etc/kubernetes.old/pki
sudo cp -r /etc/kubernetes/pki/* /etc/kubernetes.old/pki/
sudo cp -r /etc/kubernetes/*.conf /etc/kubernetes.old/
@liangjunmo
liangjunmo / linux-ssh-root-login
Created May 4, 2024 13:57
Linux SSH root login
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/v2v_guide/preparation_before_the_p2v_migration-enable_root_login_over_ssh
@liangjunmo
liangjunmo / linux-openssl
Created April 27, 2024 07:51
Linux openssl 命令
https://fafucoder.github.io/2021/03/09/linux-openssl/
@liangjunmo
liangjunmo / mysql-varchar
Created April 26, 2024 13:17
MySQL varchar
https://www.sobyte.net/post/2022-08/mysql-varchar/
@liangjunmo
liangjunmo / linux-read-write-test.md
Created April 26, 2024 13:17
Linux 测试读写速度
// 测试写
time dd if=/dev/zero of=/tmp/test bs=1024k count=10240
// 测试读
time dd if=/tmp/test of=/dev/null bs=1024k
// 测试读写 
time dd if=/tmp/test of=/var/test bs=1024k
@liangjunmo
liangjunmo / jekyll-seo-variables
Created April 26, 2024 13:13
Jekyll seo variables
https://github.com/jekyll/jekyll-seo-tag/blob/master/lib/jekyll-seo-tag/drop.rb