Skip to content

Instantly share code, notes, and snippets.

View techfish-11's full-sized avatar

techfish techfish-11

View GitHub Profile
@techfish-11
techfish-11 / v4-v6.txt
Last active January 10, 2026 16:46
IPv4とIPv6の違い(超初心者向け)
v4は地球。
昔は地球(インターネット)を使う人が少なかったので、
一人ひとりが贅沢に自分専用の住所を持てていた。
しかし人が増え、住所が足りなくなったため、
1つの住所を複数人で共有するようになった。
そのため、住所は配布先に申請しないともらえない。
一方v6はマイクラ。
地球での反省を活かし、最初からほぼ無限の住所を使える設計になっている。
場所がほぼ無限なので、基本的に1人が1つの住所を使う。
@techfish-11
techfish-11 / dhcp-static.sh
Created December 19, 2025 10:26
DHCPでもらっていたIPをそのまま固定するシェルスクリプト
#!/bin/bash
set -e
echo "[*] Detecting interface (IPv4 default)..."
IFACE=$(ip -4 route show default | awk '{print $5}' | head -n1)
echo "[*] Detecting current IPv4 (non-secondary)..."
ADDR=$(ip -4 addr show "$IFACE" \
| awk '/inet / && $0 !~ /secondary/ {print $2}' \
| head -n1)
@techfish-11
techfish-11 / install.sh
Last active September 7, 2025 18:54
俺用WordPressインストールスクリプト
#!/bin/bash
# WordPress日本語版 + Nginx + MySQL/MariaDBをUbuntu Serverにプロダクションレディでセットアップするスクリプト
set -e
apt update && apt install curl
# --- 設定値(必要に応じて編集) ---
DB_NAME="wordpress"
DB_USER="wpuser"