Skip to content

Instantly share code, notes, and snippets.

View jason9075's full-sized avatar
🚼
Being a Dad

Jason Kuan jason9075

🚼
Being a Dad
View GitHub Profile
@jason9075
jason9075 / nvim-init.service
Last active June 26, 2023 15:21
nvim startuptime init shell
[Unit]
Description=Nvim Init Start
[Service]
ExecStart=/home/jason9075/nvim-startup.sh
RemainAfterExit=true
Type=oneshot
[Install]
WantedBy=default.target
@jason9075
jason9075 / rclone_gphotos_backup.sh
Created January 16, 2025 03:12
Daily rclone script
#!/bin/bash
#
# rclone_gphotos_backup.sh
# 取得當前日期 (格式: YYYY-MM-DD)
YEAR=$(date +'%Y')
MONTH=$(date +'%m')
YEAR_MONTH="${YEAR}-${MONTH}"
@jason9075
jason9075 / wg0.conf
Created January 30, 2025 07:54
Wireguard Config
# sudo vim /etc/wireguard/wg0.conf
# replace <key> and <eth0>
# sudo wg show
[Interface]
PrivateKey = <key>
Address = 10.22.0.0/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o <eth0> -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o <eth0> -j MASQUERADE
@jason9075
jason9075 / steam-run.sh
Created August 12, 2025 04:31
Test for steam-run in NixOS
#!/usr/bin/env bash
set -euo pipefail
# ===== 可調參數 ===============================================================
: "${HELLO_VER:=2.10-3}"
: "${DEB_URL_I386:=https://ftp.debian.org/debian/pool/main/h/hello/hello_${HELLO_VER}_i386.deb}"
DEMO_DIR="${HOME}/.cache/steamrun-demo-hello32"
BIN_NAME="hello32"
# ==============================================================================
@jason9075
jason9075 / global-hooks.js
Created February 7, 2026 08:55
put this file in ~/.config/opencode/plugins
import fs from 'fs';
export const NixDevelopPlugin = async ({ directory, client }) => {
return {
"tool.execute.before": async (input, output) => {
if (input.tool === "bash") {
const flakePath = `${directory}/flake.nix`;
if (fs.existsSync(flakePath)) {
const originalCommand = output.args.command;
@jason9075
jason9075 / config.toml
Created July 20, 2026 01:42
codex-config
model = ...
model_reasoning_effort = "high"
personality = "pragmatic"
sandbox_mode = "danger-full-access"
approval_policy = "never"
approvals_reviewer = "user"
...
[tui]