Skip to content

Instantly share code, notes, and snippets.

@holly
holly / ghkey.sh
Created November 22, 2026 15:02
ssh authorized_keys from github
#!/usr/bin/env bash
set -eo pipefail
USER=$1
if [[ -z "$USER" ]]; then
echo "Usage: $0 <USER>"
exit 1
fi
@holly
holly / rir-country.py
Created October 15, 2026 14:19
RIR delegated-extended から国別の CIDR リストを生成する
#!/usr/bin/env python
"""rir_country.py - RIR delegated-extended ファイルから国別CIDRリストを生成する
usage:
rir_country.py [-4] [-6] [-o PATH] [--min N]
[--cache-dir DIR] [--max-age H] [--max-stale H] [--no-cache]
CC [CC ...]
CC 国コード(ISO 3166-1 alpha-2、複数可、必須)。ALL ですべての国
-4 IPv4 を出力
@holly
holly / wg_manage.sh
Last active June 20, 2026 15:30
Manage WireGuard clients: add / remove / show. Handles server-side wg0.conf editing, client conf generation, and optional /etc/hosts-dnsmasq registration.
#!/usr/bin/env bash
#
# wg-client-manage.sh
# Manage WireGuard clients: add / remove / show.
# Handles server-side wg0.conf editing, client conf generation,
# and optional /etc/hosts-dnsmasq registration.
#
set -euo pipefail
# ====================== Environment-specific settings (verify before use) ======================
@holly
holly / eza_install.sh
Created March 27, 2026 13:20
eza install
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
set -C
REPO="eza-community/eza"
BIN_NAME="eza"
INSTALL_DIR="$HOME/.local/bin"
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
set -C
# Configuration
REPO="LuaLS/lua-language-server"
BIN_NAME="lua-language-server"
@holly
holly / shfmt_install.sh
Last active November 22, 2026 15:02
shfmt install
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
set -C
# 設定
REPO="mvdan/sh"
API_URL="https://api.github.com/repos/${REPO}/releases/latest"
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
set -C
DOWNLOAD_URL="https://bitwarden.com/download/?app=cli&platform=linux"
INSTALL_DIR="$HOME/.local/bin"
INSTALL_PATH="${INSTALL_DIR}/bw"
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
set -C
ARCH=$(uname -m)
GITHUB_API_URL="https://api.github.com/repos/fish-shell/fish-shell/releases/latest"
FISH_VERSION=$(curl -sfL $GITHUB_API_URL | jq -r ".tag_name")
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
set -C
ARCH=$(uname -m)
LOCAL_DIR=/usr/local
DOWNLOAD_URL="https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-${ARCH}.tar.gz"
@holly
holly / tools_install.py
Last active March 1, 2026 16:30
Automatic installation script for ripgrep, bat, fd, glow, duf, eza, shellcheck, lua-language-server (using standard modules only)
#!/usr/bin/env python3
"""
Automatic installation script for ripgrep, bat, fd, glow, duf, eza, shellcheck, lua-language-server (using standard modules only)
Fetches the latest versions from GitHub API, compares with existing versions, and updates them.
Also automatically installs fish shell completion files.
"""
import os
import sys
import json