Skip to content

Instantly share code, notes, and snippets.

View supersonictw's full-sized avatar
🦋

不知火 Shiranui supersonictw

🦋
View GitHub Profile
@supersonictw
supersonictw / install-irustic.sh
Last active July 30, 2025 05:33
Execute rustic and sends a notification upon successful completion.
#!/bin/sh
# irustic.sh - Execute rustic and sends a notification upon successful completion.
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
set -e
# rustic-rs/rustic
# https://github.com/rustic-rs/rustic
DIR_RUSTIC="/root/.config/rustic"
@supersonictw
supersonictw / ipam.sh
Last active August 5, 2025 03:53
Bare Metal to phpIPAM Synchronizer
#!/bin/bash
# ipam.sh
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
#================================================================
# Bare Metal to phpIPAM Synchronizer
#
# Purpose:
# This script runs on any bare metal server or standalone host.
# It detects its own hostname, IP, and MAC address, and reports
@supersonictw
supersonictw / ipam-pve.sh
Last active July 25, 2025 08:31
Proxmox VE (VM & CT) to phpIPAM Synchronizer
#!/bin/bash
# ipam-pve.sh
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
#================================================================
# Proxmox VE (VM & CT) to phpIPAM Synchronizer
#
# Features:
# - Periodically scans all running VMs and Containers (CT) on Proxmox VE.
# - Retrieves IP, hostname, and MAC address.
@supersonictw
supersonictw / generate-spa-nginx-routes.js
Last active July 18, 2025 03:03
Generating SPA routes for NGINX to respond status code 404 correctly.
// generate-spa-nginx-routes.js
// SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
// nginx.conf example:
//
// include routes_params;
// ...
// location / {
// try_files $uri $uri/ $routes =404;
// }
@supersonictw
supersonictw / cloudflared-openrc.conf
Last active February 7, 2025 18:35
CloudFlared OpenRC for Alpine Linux wget -O - https://ncurl.xyz/s/nUqux-KNg | sh
#!/sbin/openrc-run
# CloudFlared OpenRC for Alpine Linux
# https://github.com/cloudflare/cloudflared
# SPDX-License-Identifier: Apache-2.0
cloudflare_token="YOUR_TOKEN_HERE"
@supersonictw
supersonictw / wails-ci.yml
Last active January 20, 2025 08:48
Continuous Integration for Wails.io
# Continuous Integration for Wails.io
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/o_o6DVqIR)
name: Continuous Integration for Wails.io
on:
push:
branches:
- main
@supersonictw
supersonictw / daily_tasks.sh
Last active July 30, 2025 05:34
Execute daily tasks and sends a notification upon successful completion.
#!/bin/sh
# daily_tasks.sh - Execute daily tasks and sends a notification upon successful completion.
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/o_o6DVqIR)
# https://gist.github.com/supersonictw/ef01b51032cff6299246abe02de04099
# crontab -e
# 0 3 * * * sh /somewhere/daily_tasks.sh >/dev/null 2>&1 # execute silently at 3 a.m every day
NOTIFY() {
local DATE_NOW="$(date)"
#!/usr/bin/env node
"use strict";
const http = require("node:http");
const port = process.env.SERVER_PORT || "8000";
http.createServer((req, rsp) => {
rsp.writeHead(200,{
"Content-Type": "text/plain"
});
@supersonictw
supersonictw / install-nomad-openrc.sh
Last active December 1, 2024 13:40
Nomad OpenRC from Alpine Linux 3.17 wget -O - https://ncurl.xyz/s/HbaXC_7NR | sh -
#!/bin/sh
# install-nomad-openrc.sh
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/o_o6DVqIR)
wget -O "/etc/conf.d/nomad" "https://ncurl.xyz/s/ymx8l_nHg"
wget -O "/etc/init.d/nomad" "https://ncurl.xyz/s/G1Vsr_7NR"
chown root:root "/etc/conf.d/nomad" "/etc/init.d/nomad"
chmod +x "/etc/init.d/nomad"
@supersonictw
supersonictw / consul-openc.conf
Last active December 1, 2024 13:40
Consul OpenRC from Alpine Linux 3.17 wget -O - https://ncurl.xyz/s/9ksu-kVNR | sh -
# Consul OpenRC from Alpine Linux 3.17
# SPDX-License-Identifier: MPL-2.0
# https://pkgs.alpinelinux.org/package/v3.17/community/x86/consul-openrc
# /etc/conf.d/consul
# Consul startup
consul_opts="agent -config-dir=/etc/consul.d"