Skip to content

Instantly share code, notes, and snippets.

View futuretea's full-sized avatar
🎯
Focusing

Hang Yu futuretea

🎯
Focusing
View GitHub Profile
@niusmallnan
niusmallnan / mini-k3s-default.sh
Last active May 23, 2023 03:39
setup minik3s for the single host
#!/bin/bash
cat > /etc/default/k3s <<EOF
GOGC=10
EOF
chmod 600 /etc/default/k3s
K3S_CHANNEL=v1.26
# --disable-helm-controller
curl -sfL https://get.k3s.io | \
@superseb
superseb / rke2-commands.md
Last active June 20, 2024 06:58
RKE2 commands

RKE2 commands

  • Updated on May 29 to accommodate etcd container not having /bin/sh available anymore.

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@lilydjwg
lilydjwg / gh-check
Last active March 18, 2024 04:43
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@humiaozuzu
humiaozuzu / convention.md
Last active May 29, 2019 05:13
Ansible best practice

Ansible best practice

通用规则

  • YAML 使用 2 空格+.yml后缀
  • Jinja 变量前后需要使用空格 {{ var }}
  • YAML 中引用变量时需要用双引号
  • 环境变量全大写,其他变量全小写
  • 所有变量前需要加上 role name 作为前缀,比如 nginx_xxx
  • role 命名使用短横线
@mdonkers
mdonkers / server.py
Last active June 10, 2024 18:44
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer