Skip to content

Instantly share code, notes, and snippets.

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

kev yqlbu

🧬
Linux DNA.
View GitHub Profile
@yqlbu
yqlbu / 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
View 301-redirect-edge-function.md

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
View ddosify-config.json
{
"load_type": "linear",
"iteration_count": 10000,
"duration": 10,
"debug": false,
"output": "stdout",
"env": {
"TARGET_ENDPOINT": "http://10.0.0.229/staging/echo"
},
"steps": [
@yqlbu
yqlbu / 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)
View actions_blacklist-update.conf
[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
@yqlbu
yqlbu / btrfs-nixos-install.sh
Created June 2, 2023 08:54 — forked from nasirhm/btrfs-nixos-install.sh
nixos install (boot + btrfs root + LUKS setup)
View btrfs-nixos-install.sh
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.
@yqlbu
yqlbu / k0s-cilium-bootstrap.md
Last active December 10, 2023 07:25
Steps to bootstrap a k0s cluster with Cilium as the CNI solution
View k0s-cilium-bootstrap.md
@yqlbu
yqlbu / k0s-bootstrap.sh
Last active February 28, 2023 15:11
k0s-bootstrap.sh
View k0s-bootstrap.sh
#!/bin/sh
set -e
if [ -n "${DEBUG}" ]; then
set -x
fi
_k0s_latest() {
curl -sSLf "https://docs.k0sproject.io/stable.txt"
@yqlbu
yqlbu / shadowrocket-dns-leak-config
Created February 25, 2023 02:34
hadowrocket config, deal with DNS leak
View shadowrocket-dns-leak-config
# 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
@yqlbu
yqlbu / auto-artifact-export.yml
Last active January 20, 2024 05:30
mosdns-v5 config template
View auto-artifact-export.yml
---
- name: Update dat files
hosts: all
become: yes
vars:
- base_path: /etc/mosdns
- restart_daemon: yes
- daemon_service_name: mosdns
- clean_up_after: yes
@yqlbu
yqlbu / qnap_emby_nvidia.md
Last active January 30, 2024 15:57
Some hacks around using NVIDIA GPU for Emby Container with QNAP
View qnap_emby_nvidia.md

Hacks

Some hacks around using NVIDIA GPU for Emby Container with QNAP

Make sure you have NVIDIA driver installed already

Check NVIDIA Driver Path

find /share/ -name "NVIDIA_GPU_DRV"