Все Новый

user:thomas фрагментов создано пользователем

title:mygist фрагментов с указанным заголовком

description:sync gists with given description

filename:myfile.txt фрагменты содержащие файлы с указанным именем

extension:yml фрагменты, содержащие файлы с указанным расширением

language:go фрагменты, содержащие файлы с указанным языком

topic:homelab фрагменты с заданной темой

all:systemctl search all fields

Регистрация

Войти

Все Новый Регистрация Войти

Все фрагменты

Свежие сверху по дате создания
Свежие снизу по дате создания
Свежие сверху по дате обновления
Свежие снизу по дате обновления

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 function peers::create_client_config() {
2 local name="$1"
3 local type="$2"
4 local ip="$3"
5 local allowed_ips="${4:-$(config::allowed_ips_for "split")}"
6
7 local conf
8 conf="$(ctx::clients)/${name}.conf"
9
10 if [[ -f "$conf" ]]; then

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 # ======================================================
2 # Hardcoded Fallbacks
3 # Mirror of policies.json built-in policies.
4 # Used when policies.json lookup fails.
5 # ======================================================
6
7 declare -gA _POLICY_TUNNEL_MODE=(
8 [default]="split"
9 [guest]="split"
10 [trusted]="split"

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 def _block_read(file):
2 try:
3 with open(file) as f:
4 content = f.read().strip()
5 if not content:
6 return None # empty file = no block data
7 try:
8 return json.loads(content)
9 except json.JSONDecodeError:
10 # Old format — migrate

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 sed -n '/local drop_word/,/^}/p' \
2 /etc/wireguard/wgctl/commands/activity.command.sh | head -50
3 local drop_word="drops"
4 [[ "$drops" -eq 1 ]] && drop_word="drop"
5 printf " \033[1m%s\033[0m \033[2m↓\033[0m%s \033[2m↑\033[0m%s %${w_drops}s %s\n" \
6 "$name_pad" "$rx_pad" "$tx_pad" "$drops" "$drop_word"
7 ;;
8
9 service)
10 $skip_peer && continue

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 sed -n '/^ local w_peer/,/^function cmd::/p' \
2 /etc/wireguard/wgctl/commands/activity.command.sh | head -60
3 local w_peer=16 w_drops=1
4 while IFS='|' read -r type rest; do
5 case "$type" in
6 peer)
7 local name drops
8 name=$(echo "$rest" | cut -d'|' -f1)
9 drops=$(echo "$rest" | cut -d'|' -f4)
10 (( ${#name} > w_peer )) && w_peer=${#name}

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 function cmd::activity::on_load() {
2 load_module net
3
4 flag::register --peer
5 flag::register --service
6 flag::register --ip
7 flag::register --hours
8 flag::register --type
9 flag::register --dropped
10 }

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 global _hs_last_logged
2
3 _hs_last_logged = load_hs_cache()
4
5 pubkey_to_name = build_pubkey_to_name()
6 log.info(f"Handshake poller started — {len(pubkey_to_name)} peers, "
7 f"session threshold {WG_HANDSHAKE_CHECK_SEC}s")
8
9 while True:
10 try:

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 25/05 14:00 phone-helena-2 → pihole/tcp
2 WireGuard Events
3 ──────────────────────────────────────────
4 25/05 13:28 phone-helena handshake
5 25/05 13:29 phone-nuno handshake
6 25/05 13:33 desktop-zephyr handshake
7 25/05 13:34 phone-helena handshake
8 25/05 13:35 phone-nuno handshake
9 25/05 13:40 phone-nuno handshake
10 25/05 13:41 phone-helena handshake

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 function cmd::logs::follow() {
2 local filter_ip="${1:-}" filter_name="${2:-}" filter_type="${3:-}"
3 local fw_only="${4:-false}" wg_only="${5:-false}"
4
5 log::section "WireGuard Live Log (Ctrl+C to stop)"
6 printf "\n"
7
8 local watch_args=()
9 [[ -n "$filter_name" ]] && watch_args+=(--name "$filter_name")
10 [[ -n "$filter_type" ]] && watch_args+=(--type "$filter_type")

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 5 months ago
1 function cmd::watch::_poll_handshakes() {
2 local filter_name="${1:-}" filter_type="${2:-}" filter_peers="${3:-}"
3 local w_client="${4:-20}" w_dest="${5:-18}"
4
5 while IFS= read -r line; do
6 local public_key ts
7 public_key=$(echo "$line" | awk '{print $1}')
8 ts=$(echo "$line" | awk '{print $2}')
9 [[ -z "$ts" || "$ts" == "0" ]] && continue
Новее Позже

Работает на Opengist ⋅ Load: 98ms⋅

Русский
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ KrilHub