Skip to content

Instantly share code, notes, and snippets.

View supersonictw's full-sized avatar
🦋

不知火 Shiranui supersonictw

🦋
View GitHub Profile
#! /bin/sh
# /etc/init.d/noip2.sh
# Supplied by no-ip.com
# Modified for Debian GNU/Linux by Eivind L. Rygge <[email protected]>
# corrected 1-17-2004 by Alex Docauer <[email protected]>
# . /etc/rc.d/init.d/functions # uncomment/modify for your killproc
DAEMON=/usr/local/bin/noip2
#!/bin/sh
# app-update.sh - Update application from git
# # SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
set -e
APP_NAME="$(basename $PWD)"
if [ -z "$APP_NAME" ]; then
echo "APP_NAME is empty."
exit 1
#!/usr/bin/env zsh
# to_use.zsh - Zsh script to link configuration files based on hostname
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
# Interrupt on errors
setopt ERR_EXIT
# Use custom hostname if provided, else default to system hostname
HOSTNAME="${HOSTNAME:-$(hostname)}"
@supersonictw
supersonictw / rproxy.sh
Last active November 20, 2025 06:41
Quickly add a reverse proxy via the Caddy Admin API
#!/bin/bash
# rproxy.sh - Quickly add a reverse proxy via the Caddy Admin API
# Usage: rproxy <UPSTREAM_ADDR> <LISTEN_ADDR>
# Example: rproxy localhost:3000 :8080
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
# 0. Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "Error: This script requires 'jq'. Please install jq first." >&2
exit 1
@supersonictw
supersonictw / go-avahi-cname.service
Created November 4, 2025 05:24
Lightweight mDNS publisher of subdomains for your machine. https://github.com/grishy/go-avahi-cname
[Install]
WantedBy=multi-user.target
[Unit]
Description=Lightweight mDNS publisher of subdomains for your machine
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
# Generated by Powerlevel10k configuration wizard on 2021-12-23 at 14:41 CST.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 54401.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 12h time,
# 1 line, compact, many icons, fluent, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
#!/bin/sh
# acpitz-patch.sh
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
tee /lib/systemd/system/acpitz-patch.service <<EOF
[Unit]
Description=acpitz patch for thermal
[Service]
ExecStart=/bin/sh -c 'echo disabled > /sys/class/thermal/thermal_zone1/mode'
#!/bin/sh
# cron-exec - Execute a command from cron, capture output and exit status, log to target
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
LOG_TARGET="/dev/fd/1" # Log output destination
TASK_DATETIME="$(date -R)" # Current date/time in RFC-2822 format
TASK_CMD="$@" # Command to execute, passed as arguments
# Execute the command, capture both stdout and stderr
{
"mtu": 1450,
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
},
"default-network-opts": {
"bridge": {
"com.docker.network.driver.mtu": "1450"
services:
desktop:
image: dorowu/ubuntu-desktop-lxde-vnc:latest
container_name: desktop
ports:
- "6080:80"
- "5900:5900"
environment:
- VNC_PASSWORD=${VNC_PASSWORD}
volumes: