Skip to content

Instantly share code, notes, and snippets.

@HackingGate
HackingGate / AGENTS.md
Last active November 1, 2026 07:43
Multiple agents, cheaper sub-agents, and Git worktrees for Claude Code and Codex

Global agent preferences

  • Work in the main loop by default. Use sub-agents only for independent work that runs in parallel, broad read-only searches where only the conclusion matters, or a review that must not see your reasoning.
  • Split work by context, not by step: give each sub-agent a self-contained piece, and never split one chain of dependent steps across agents.
  • Use cheaper capable models for sub-agents and stronger models only when the task needs them; prefer a model pinned in an agent definition over a per-call choice.
  • Make repository edits in dedicated Git worktrees and task branches, with separate worktrees for concurrent writers.
  • Every tool, library, standard or project named in a reply carries its URL, where one exists.
@HackingGate
HackingGate / zellij.sh
Last active October 2, 2026 16:39
zellij setup: clipboard and scrollback options, lock toggle moved from Ctrl g to Ctrl b, other stock keybindings kept
#!/usr/bin/env bash
set -euo pipefail
echo "Starting zellij setup..."
# Detect OS/session and configure clipboard behavior
clip_cmd=""
copy_target="zellij OSC 52 host clipboard"
os_name="$(uname -s 2>/dev/null || true)"
is_wayland=0
@HackingGate
HackingGate / disable-wine-host-drives.sh
Last active September 27, 2026 03:05
Remove Wine/Proton host filesystem drive mappings and prevent new Z: mappings.
#!/usr/bin/env bash
# Remove Wine/Proton host filesystem mappings, then provide a game-root-only Z: drive.
#
# Usage:
# ./disable-wine-host-drives.sh
# ./disable-wine-host-drives.sh --home /home/someuser
#
# Optional:
# DRY_RUN=1 ./disable-wine-host-drives.sh
# WINE_GAME_ROOT=/games ./disable-wine-host-drives.sh
@HackingGate
HackingGate / tmux.sh
Last active September 6, 2026 03:05
Emacs-friendly tmux setup with clipboard copy, auto light/dark mode, and longer message display time
#!/usr/bin/env bash
set -euo pipefail
echo "Starting tmux and shell environment setup..."
# Detect OS/session and configure clipboard behavior
clip_cmd=""
copy_target="tmux OSC 52 host clipboard"
os_name="$(uname -s 2>/dev/null || true)"
is_wayland=0
@HackingGate
HackingGate / expand_rootfs.sh
Last active September 8, 2025 16:52
Expand Root Filesystem for NanoPi R6S OpenWrt
#!/bin/sh
# =============================================================================
# OpenWrt Root Filesystem Expander
#
# This script automates resizing the main data partition and filesystem
# on an OpenWrt device to use all available eMMC/SD card space.
#
# It now auto-detects the correct start sector and the correct device
# to target for filesystem resizing (e.g., /dev/loop0).
@HackingGate
HackingGate / setup_v6plus.sh
Created September 7, 2025 08:55
OpenWrt v6plus Setup Script
#!/bin/sh
# OpenWrt v6plus Setup Script
# Slightly modified from: https://qiita.com/site_u/items/24bc0823986784cfb96c
# This script automates the configuration of MAP-E for v6plus on OpenWrt.
echo "--- [Step 1/5] Configuring IPv6 network device ---"
# Add a new network device for IPv6
uci add network device >/dev/null 2>&1
uci set network.@device[-1].name='lan1'
#!/bin/bash
set -e
set -o pipefail
# --- System and Time Configuration ---
# Set system timezone to Tokyo, Japan
sudo timedatectl set-timezone Asia/Tokyo
# Configure hardware clock to use UTC (recommended for Linux)
sudo timedatectl set-local-rtc 0
@HackingGate
HackingGate / keybindings.json
Last active April 13, 2026 15:10
[deprecreated] Emacs-style keymap for VSCode with memory hints (mnemonics)
[
/* 0. UNBIND VS Code defaults that clash (→ new Emacs-style key) */
{ "key": "ctrl+f", "command": "-actions.find" }, // C-s/C-r = isearch-forward/backward
{ "key": "ctrl+s", "command": "-workbench.action.files.save" }, // C-x C-s = save-buffer
{ "key": "ctrl+v", "command": "-editor.action.clipboardPasteAction" }, // C-y = yank (paste)
{ "key": "ctrl+y", "command": "-redo" }, // C-/ = undo, C-? = redo
{ "key": "ctrl+p", "command": "-workbench.action.quickOpen" }, // C-x C-f = find-file
{ "key": "ctrl+n", "command": "-workbench.action.files.newUntitledFile" }, // C-x C-n = new-file
{ "key": "ctrl+a", "command": "-editor.action.selectAll" }, // C-x h = mark-whole-buffer
{ "key": "ctrl+e", "command": "-workbench.action.files.saveAs" }, // C-x C-w = write-file
@HackingGate
HackingGate / 00-base-system.sh
Last active November 7, 2026 04:05
My Fedora Desktop Setup
#!/usr/bin/env bash
set -euo pipefail
echo "Set timezone and RTC policy"
sudo timedatectl set-timezone Asia/Tokyo
sudo timedatectl set-local-rtc 0
timedatectl
echo "Update Fedora and install base packages"
sudo dnf upgrade --refresh -y
@HackingGate
HackingGate / enable-secureboot-shim.sh
Last active April 29, 2025 01:46
Script to install Ubuntu Secure Boot shim and optionally install and deploy rEFInd
#!/usr/bin/env bash
set -euo pipefail
# Script to install Ubuntu Secure Boot shim and optionally install and deploy rEFInd
# Usage: share this on GitHub Gist, then run:
# curl -sL <gist-url> | bash
# 1. Update package lists
echo "Updating package lists..."
sudo apt update