Skip to content

Instantly share code, notes, and snippets.

View yankay's full-sized avatar
🦆
I love nature

Kay Yan yankay

🦆
I love nature
  • DaoCloud
  • Shanghai.China
  • 11:33 (UTC +08:00)
  • LinkedIn in/yankay
View GitHub Profile
@yankay
yankay / gist:cfc063a0fa257879b2fce6d2b07603cc
Created April 22, 2024 09:40
快速运行 VNC 桌面
参考:https://github.com/fcwu/docker-ubuntu-vnc-desktop
docker run -p 6080:80 -p 5900:5900 -v /dev/shm:/dev/shm -v /tmp:/tmp release-ci.daocloud.io/docker.m.daocloud.io/dorowu/ubuntu-desktop-lxde-vnc
@yankay
yankay / gist:af169e0e0259c1c2dd6d5129e394ccf4
Created February 27, 2024 04:53
快速安装 kubectl kubeadm
export KUBE_VERSION="1.28.0"
export FILE_MIRROR="https://files.m.daocloud.io"
cd /tmp
curl -LO "$FILE_MIRROR/dl.k8s.io/release/v$KUBE_VERSION/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin
curl -LO "$FILE_MIRROR/dl.k8s.io/release/v$KUBE_VERSION/bin/linux/amd64/kubeadm"
cd /tmp
export LAZYGIT_VERSION=$(curl -s https://api.github.com/repos/jesseduffield/lazygit/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' )
export LAZYGIT_VERSION=${LAZYGIT_VERSION:1:100}
wget https://files.m.daocloud.io/github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz
tar -zxvf lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz
chmod +x lazygit
mv lazygit /usr/local/bin/lazygit
lazygit -v
cd /tmp
export NERDCTL_VERSION=$(curl -s https://api.github.com/repos/containerd/nerdctl/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' )
export NERDCTL_VERSION=${NERDCTL_VERSION:1:100}
wget https://files.m.daocloud.io/github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-${NERDCTL_VERSION}-linux-amd64.tar.gz
tar -zxvf nerdctl-${NERDCTL_VERSION}-linux-amd64.tar.gz
chmod +x nerdctl
mv nerdctl /usr/local/bin/nerdctl
nerdctl version
export http_proxy="http://xxxx:10809"
export https_proxy="http://xxxx:10809"
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
@yankay
yankay / gist:35fa88f347764ab344cdc31ff14563a3
Created August 15, 2023 06:03
快速启动 kubectl-node-shell
curl -LO https://files.m.daocloud.io/github.com/kvaps/kubectl-node-shell/raw/v1.7.0/kubectl-node_shell
chmod +x ./kubectl-node_shell
mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell
@yankay
yankay / tf-distributed-mnist.py
Created July 20, 2023 07:06
tf-distributed-mnist.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import gzip
import numpy as np
import tensorflow as tf
from tensorflow import keras
print('TensorFlow version: {}'.format(tf.__version__))
dataset_path = "/root/data/"
@yankay
yankay / gist:9aa11090a5dc8dfabf52c047501956f9
Last active March 28, 2023 08:50
快速 用 kube-bench 做 CIS-Benchmark
wget "https://ghproxy.com/raw.githubusercontent.com/aquasecurity/kube-bench/main/job-master.yaml"
kubectl apply -f job-master.yaml
kubectl get pods
kubectl logs kube-bench-master-zvplg
@yankay
yankay / gist:e0deda7aca5f891d9237351c4510bb35
Created March 17, 2023 08:21
一键安装 istio ( istioctl)
export ISTIO_VERSION="1.17.1"
wget "https://files.m.daocloud.io/github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux-amd64.tar.gz"
tar -zxvf istio-${ISTIO_VERSION}-linux-amd64.tar.gz
cd istio-${ISTIO_VERSION}/
@yankay
yankay / gist:52ec6efe6d49631e5f673a22eb5b1ca5
Last active March 14, 2023 09:14
公司内网 containerd 加速
修改配置 `vi /etc/containerd/config.toml`
```
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
# docker
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["https://release-ci.daocloud.io/v2/docker.m.daocloud.io"]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.m.daocloud.io"]
endpoint = ["https://release-ci.daocloud.io/v2/docker.m.daocloud.io"]