Skip to content

Instantly share code, notes, and snippets.

View w1ndy's full-sized avatar

Di Weng w1ndy

View GitHub Profile
@w1ndy
w1ndy / 00-installer-config.yaml.template
Created September 12, 2022 09:53
Delegate IPv6 PD from Remote Router
# This is the network config written by 'subiquity'
network:
ethernets:
enp2s0:
accept-ra: no
addresses:
- 192.168.1.2/24
- $IPV6_ADDR
gateway4: 192.168.1.1
gateway6: fe80::8ede:f9ff:feb7:2dbc
@w1ndy
w1ndy / vite-bootstrap.sh
Last active July 6, 2022 03:53
Bootstrap vite + vue-ts projects with eslint, prettier, windicss, and fontawesome
#!/bin/bash
# USAGE: bash <(curl -sL https://gist.githubusercontent.com/w1ndy/1c484c8bfafa06b5b42cca0591b026fb/raw/vite-bootstrap.sh) <PROJECT_NAME>
set -e
if [ -z "$1" ]
then
echo "No project name supplied"
exit 1
fi
@w1ndy
w1ndy / README.md
Last active February 5, 2024 13:17
Autostart clash in tun mode on AX3600

Prerequisite

  1. Download and put the clash premium core under /etc/clash
  2. Modify your config.yaml based on config.yaml.example

Installation Guide

Please consult the following script:

@w1ndy
w1ndy / blocklist.txt
Created June 10, 2021 19:03
Google Chinese Search Result Block List
|example.com:t|example.com:t|005i.com:t|01-123.com:t|01-800.cn:t|024ksm.com:t|025pc.cn:t|029jiakang.com:t|054wan.com:t|0551.us:t|069.net:t|079.254560.top:t|086wl.com:t|0937673.info:t|100860.com:t|103.hk:t|10615.com.cn:t|1141.net:t|114saige.com:t|123.125.114.18:t|1233win.com:t|125135.com:t|14oo.cc:t|151.com.tw:t|15300.cn:t|1587555.com:t|15meili.com:t|163081.com:t|1666yl.com:t|16885518.com:t|173-fc.com:t|17xuexi.org:t|187801.com:t|19kaifu.com:t|1pyy.com:t|20122011.org:t|2996299.com:t|2a2d75.dcmir4f.com:t|30333.loan:t|32xyj.pw:t|360adsolutions.com:t|360du.net.cn:t|392623.com:t|3jwz.com:t|3li.cc:t|3ssq8z.bmspzs.pw:t|3v4.net:t|400839.com:t|4382.loan:t|4659866.com:t|4743.loan:t|4blc.com:t|4r8.nfjhn.com:t|520bdy.com:t|5467.com:t|55118885.com:t|567516.com:t|56weiyu.com:t|57c69d.bb6zz.com:t|57zhuan.cn:t|58pan.cn:t|59177.net:t|5azy.com:t|5eso.com:t|5pk.ah.2j0.iyu.y7.l99.m.7d6y.com:t|611fu.com:t|666so.cn:t|68suan.com:t|68xi.com:t|710dnuv.com:t|732722.com:t|75q.net:t|75yy.com:t|77tui.cn:t|793985.com:t|7dianying.com:t|7gt
@w1ndy
w1ndy / ipv6-router.sh
Created January 22, 2021 20:57
Enable IPv6 passthrough with ebtables and prohibit unwanted incoming connections with iptables
modprobe ip6table_mangle
ebtables -t broute -A BROUTING -p ! ipv6 -j DROP -i eth2.2
brctl addif br0 eth2.2
echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 --state NEW -j DROP
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p udp --dport 6881 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 5000 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 6443 --state NEW -j ACCEPT
ip6tables -I FORWARD 1 -m physdev -m state --physdev-in eth2.2 -p tcp --dport 8096 --state NEW -j ACCEPT
@w1ndy
w1ndy / k8s-iscsi-xfs-lvm-recover.sh
Last active December 4, 2020 19:53
Repair Failed ISCSI Drives (XFS on LVM) in A Kubernetes Cluster
# Shutdown the Kubernetes cluster first (on every node)
systemctl stop kubelet
# Stop all docker containers (on every node)
docker stop $(docker ps -aq)
# Unmount all ISCSI disks (on every node)
mount | grep iqn
umount --all-targets /dev/sdxx # replace sdxx with each disk
@w1ndy
w1ndy / Dockerfile.privoxy-gfwlist
Last active May 28, 2019 13:36
privoxy-gfwlist
FROM alpine AS build
WORKDIR /
RUN echo 'https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main' > /etc/apk/repositories \
&& echo 'https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/community' >> /etc/apk/repositories \
&& apk add bash ca-certificates curl perl \
&& curl -4sSkLO https://raw.github.com/zfl9/gfwlist2privoxy/master/gfwlist2privoxy \
&& bash gfwlist2privoxy 127.0.0.1:1080
FROM alpine
RUN apk --nocache add privoxy
@w1ndy
w1ndy / .hyper.js
Created May 13, 2019 11:35
Hyper Configuration
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@w1ndy
w1ndy / generate_selfsigned_cert.sh
Created March 12, 2019 11:26
Remove the ban on Netease Music with reverse proxy
#!/bin/bash
openssl genrsa -out private/nginx-selfsigned.key 2048
openssl req -new -out certs/nginx-selfsigned.csr -key private/nginx-selfsigned.key -config openssl.cnf
udo openssl x509 -req -days 3650 -in certs/nginx-selfsigned.csr -signkey private/nginx-selfsigned.key -out certs/nginx-selfsigned.crt -extensions v3_req -extfile openssl.cnf
@w1ndy
w1ndy / openresty.json
Last active March 2, 2019 08:29
Grafana Dashboards
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",