Skip to content

Instantly share code, notes, and snippets.

View hydrz's full-sized avatar
🌌
Focusing

夜访萤火虫 hydrz

🌌
Focusing
View GitHub Profile
@hydrz
hydrz / zsh_terminal_proxy
Created November 11, 2019 10:52
终端走代理
# proxy list
alias proxy='export all_proxy=socks5://127.0.0.1:1080'
alias unproxy='unset all_proxy'
@hydrz
hydrz / k3s.sh
Created November 12, 2019 09:44
k3s安装脚本
#!/bin/sh
set -e
# Usage:
# curl ... | ENV_VAR=... sh -
# or
# ENV_VAR=... ./install.sh
#
# Example:
# Installing a server without traefik:
@hydrz
hydrz / 简易网关
Last active November 20, 2019 04:00
#!/bin/sh
# 开启转发
echo 'net.ipv4.ip_forward=1' >/usr/lib/sysctl.d/20-forward.conf
sysctl -p
# 指定外网 IP
# iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -j SNAT --to-source 192.168.0.1
# 内网段
@hydrz
hydrz / k8s-install.sh
Last active November 23, 2019 16:18
Kubernetes 安装脚本
#!/bin/sh
set -e
# docker 配置
: ${DOCKER_VERSION:="18.09"}
: ${DOCKER_CHANNEL:="stable"}
# k8s 配置
: ${TAINT_NODES:="false"}
: ${K8S_VERSION:="1.15"}
@hydrz
hydrz / app-install.sh
Created November 19, 2019 08:19
常用centos软件
#!/bin/sh
yum -y install wget openssl tar gawk grep sed \
bind-utils net-tools iproute iptables iptables-services \
git htop iftop iotop bash-completion vim
@hydrz
hydrz / ingress-lb.yaml
Last active November 25, 2019 14:59
k8s ingress port规范
spec:
clusterIP: 10.241.15.142
externalTrafficPolicy: Local
healthCheckNodePort: 31914
ports:
- name: http
nodePort: 30080
port: 80
protocol: TCP
targetPort: 80
@hydrz
hydrz / namespace-terminating.sh
Last active November 28, 2019 04:29
k8s管理脚本
#!/bin/sh
kubectl proxy
NS=annoying-namespace-to-delete
kubectl get namespace ${NS} -o json > tmp.json
curl -k -H “Content-Type: application/json” -X PUT –data-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/${NS}/finalize
@hydrz
hydrz / utility.erl
Last active December 3, 2019 10:04 — forked from binarytemple/utility.md
Erlang decompiler I found on the web, works for Elixir beam files too
%% Author: PCHAPIER
%% Created: 25 mai 2010
-module(utility).
%%
%% Include files
%%
%%
%% Exported Functions
@hydrz
hydrz / alpine.sh
Last active December 6, 2019 08:33
常用国内源镜像
#!/bin/sh
mv /etc/apk/repositories /etc/apk/repositories.backup
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# apk add --no-cache
@hydrz
hydrz / amap.text
Last active September 21, 2023 03:49
瓦片图说明
高德卫星 AmapSatellite
http://wprd04.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&style=6
高德地图 AmapTile
http://wprd04.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&style=7
高德路网含标注 AmapRoadMark
http://wprd04.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&scl=1&style=8
高德路网不含标注 AmapRoad