Skip to content

Instantly share code, notes, and snippets.

View miooochi's full-sized avatar
🧬
Linux DNA.

kev miooochi

🧬
Linux DNA.
  • /dev/null
View GitHub Profile

Fedora Hacks

Configure source

sudo sed -e 's|^metalink=|#metalink=|g' \
         -e 's|^#baseurl=http://download.example/pub/fedora/linux|baseurl=https://mirrors.ustc.edu.cn/fedora|g' \
         -i.bak \
         /etc/yum.repos.d/fedora.repo \
 /etc/yum.repos.d/fedora-updates.repo
@miooochi
miooochi / gpg.sh
Created March 10, 2024 03:58
Script to setup gnupg
#!/bin/sh
KEY_NAME="sa-slchris.asc"
LOCAL_KEYSERVER="http://192.168.56.109:9001"
KEY="5BB4DC20DCA50A499219935036F2D646E2E89820" # Key fingerprint
GPG_DIR="/etc/portage/gnupg"
PASS="$(openssl rand -base64 32)"
@miooochi
miooochi / 301-redirect-edge-function.md
Last active January 26, 2024 12:13
A JavaScript program for a 301 redirect with path mapping, suitable for deployment as a Cloud Function on AWS

Proposal

exports.handler = async (event) => {
  const request = event.Records[0].cf.request;
  const requestUri = request.uri;

  // Path mapping logic:
  const pathMappings = {
 "/": "/featuretoggle/uk", // Redirect root path to /featuretoggle/uk
{
"load_type": "linear",
"iteration_count": 10000,
"duration": 10,
"debug": false,
"output": "stdout",
"env": {
"TARGET_ENDPOINT": "http://10.0.0.229/staging/echo"
},
"steps": [
@miooochi
miooochi / actions_blacklist-update.conf
Last active September 1, 2023 14:43 — forked from PiDroid-B/actions_blacklist-update.conf
OPNsense Custom script and Cron (example : unbound blacklist update)
[reload]
command:/bin/sh /usr/local/etc/unbound/blacklist-update.sh
parameter:
type:script_output
message: Unbound Blacklist Update
description: Centralized Blacklist Update for Unbound DNS Service
@miooochi
miooochi / btrfs-nixos-install.sh
Created June 2, 2023 08:54 — forked from nasirhm/btrfs-nixos-install.sh
nixos install (boot + btrfs root + LUKS setup)
mkfs.vfat -n BOOT /dev/sda3
mkfs.btrfs -L root /dev/sda1
cryptsetup luksFormat /dev/sda1
# Enter the Password.
cryptsetup luksOpen /dev/sda1 enc-pv
# After Opening the Disk, Open Gparted and Format /dev/sda1 to btrfs for the btrfs logic block.
@miooochi
miooochi / k0s-cilium-bootstrap.md
Last active December 10, 2023 07:25
Steps to bootstrap a k0s cluster with Cilium as the CNI solution
@miooochi
miooochi / k0s-bootstrap.sh
Last active February 28, 2023 15:11
k0s-bootstrap.sh
#!/bin/sh
set -e
if [ -n "${DEBUG}" ]; then
set -x
fi
_k0s_latest() {
curl -sSLf "https://docs.k0sproject.io/stable.txt"
@miooochi
miooochi / shadowrocket-dns-leak-config
Created February 25, 2023 02:34
hadowrocket config, deal with DNS leak
# Shadowrocket配置文件,解决DNS泄露
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com
tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 255.255.255.255/32, 239.255.255.250/32
dns-server = system
ipv6 = false
prefer-ipv6 = false
dns-fallback-system = false