Skip to content

Instantly share code, notes, and snippets.

View supersonictw's full-sized avatar
🦋

不知火 Shiranui supersonictw

🦋
View GitHub Profile
@supersonictw
supersonictw / cloudflared-openrc.conf
Last active February 1, 2026 05:29
CloudFlared OpenRC for Alpine Linux wget -O - https://ncurl.xyz/s/rbRXZzVDR | 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 / ollama-export.sh
Last active January 29, 2026 06:22
Ollama Model Export Script
#!/bin/bash
# Ollama Model Export Script
# Usage: bash ollama-export.sh vicuna:7b
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/o_o6DVqIR)
# https://gist.github.com/supersonictw/f6cf5e599377132fe5e180b3d495c553
# Interrupt if any error occurred
set -e
# Declare
@supersonictw
supersonictw / nginx.conf
Last active January 14, 2026 00:58
Easy OpenAI reverse proxy gateway
# nginx.conf - Easy OpenAI reverse proxy gateway
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/o_o6DVqIR)
limit_req_zone $binary_remote_addr zone=ai_trial:1m rate=5r/s;
server {
# TODO: your server conf
location /ai/openai/ {
include proxy_params;
#!/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
@supersonictw
supersonictw / install-irustic.sh
Last active January 8, 2026 02:35
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"
#! /bin/sh
# /etc/init.d/noip2.sh
# Supplied by no-ip.com
# Modified for Debian GNU/Linux by Eivind L. Rygge <eivind@rygge.org>
# corrected 1-17-2004 by Alex Docauer <alex@docauer.net>
# . /etc/rc.d/init.d/functions # uncomment/modify for your killproc
DAEMON=/usr/local/bin/noip2
@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
#!/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)}"
#!/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
# tmate_session.sh
# SPDX-License-Identifier: MIT (https://ncurl.xyz/s/Kkn2DQsNR)
tmate -S /tmp/tmate.sock new-session -d
tmate -S /tmp/tmate.sock wait tmate-ready
tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' > tmate_session.txt