Skip to content

Instantly share code, notes, and snippets.

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

kev piyoki

🧬
Linux DNA.
  • /dev/null
View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGaDp4IBEACte8Wp103v4cusgL5eaIPVVXi2wm996RargsCJ4RnBkOF3PuG0
USwT+DlmtNgTpVGCf4EWsOdKlyc8aMriR06+HFSXa2Pv0jVkQzV9D2Ga88o5yTce
glyLkcpljgRkPHIuLhZuS1IpLYiucoq03pDQwztFrNQ71eE9bdYkreE7A+xxlFTC
zBWSahFBjlLM4gwuCxx9oxsn6Iwakg1eFiJRVKNBgWGiJOYz7czQ7VlFIw1B1YNF
TQ9xkuUpqXw2T/TzFIS3/c6eZqNW+BGkRUug13rUZV39D96UBotZ75EiH2s3iVbD
P1+WpM1YM8+c3fXMFQvlmoHpEdWyzuNxDsNux0mj4Rxdzmh1JpuE+HJkgTbshO08
gK9XM52g73CqieT1pRThlO/kZWHcbVgHPuG6HC/kbwYTYe7NJXlFUG0ZnCLWLLwU
MR205Cfs+7veajqvjJLGd4y2Pizr05WD+kNrDnWRqEH+/4ye0a4Lb6Hqg/D8ZlO7

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
@piyoki
piyoki / 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)"
@piyoki
piyoki / 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": [
@piyoki
piyoki / 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
@piyoki
piyoki / 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.
@piyoki
piyoki / k0s-cilium-bootstrap.md
Last active December 10, 2023 07:25
Steps to bootstrap a k0s cluster with Cilium as the CNI solution
@piyoki
piyoki / 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"