All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Register

Login

All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function peers::format_status() {
2 local name="${1:-}" public_key="${2:-}" is_blocked="${3:-false}"
3 local is_restricted="${4:-false}" handshake_ts="${5:-0}" last_ts="${6:-}"
4
5 local connected=false modifier="" color
6
7 if [[ "$is_blocked" == "true" ]]; then
8 local now attempt_ts diff
9 now=$(date +%s)
10 attempt_ts=$(json::iso_to_ts "$last_ts")

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 Firewall Drops:
2 TIME CLIENT DESTINATION PROTOCOL
3 ───────────────────────────────────────────────────────────────────────────
4 11/05/2026 00:58 guest-zephyr-test 10.0.0.37:47988 tcp
5 11/05/2026 00:58 guest-zephyr-test 10.0.0.3:47989 tcp
6 11/05/2026 00:58 guest-zephyr-test 10.0.0.12:47989 tcp
7 11/05/2026 00:58 guest-zephyr-test 10.0.0.198:47989 tcp
8 11/05/2026 00:58 guest-zephyr-test 10.0.0.2:47989 tcp
9 11/05/2026 00:59 guest-zephyr-test 10.0.0.3:47989 tcp
10 11/05/2026 00:59 guest-zephyr-test 10.0.0.37:47988 tcp

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 Firewall Drops:
2 TIME CLIENT DESTINATION PROTOCOL
3 ───────────────────────────────────────────────────────────────────────────
4 10/05/2026 21:32 guest-zephyr-test 10.0.0.103:53 udp (x2)
5 10/05/2026 21:33 guest-zephyr-test 10.0.0.103:53 udp
6 10/05/2026 21:34 guest-zephyr 10.0.0.103:53 udp (x3)
7 10/05/2026 21:35 guest-zephyr 10.0.0.103:53 udp
8 10/05/2026 21:36 guest-zephyr 10.0.0.103:53 udp
9 10/05/2026 21:37 guest-zephyr 10.0.0.103:53 udp (x2)
10 10/05/2026 21:40 guest-zephyr-test 10.0.0.2:47989 tcp (x6)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::inspect::_peer_info() {
2 local name="$1"
3 local ip type rule status endpoint last_seen tunnel public_key
4 local activity rx tx
5
6 ip=$(peers::get_ip "$name")
7 type=$(peers::get_type "$name")
8 rule=$(peers::get_meta "$name" "rule")
9 public_key=$(keys::public "$name" 2>/dev/null)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 def fw_events(file, filter_ip, filter_type, clients_dir, limit):
2 """Format firewall drop events with dedup and counts"""
3 import glob
4 proto_map = {1: 'icmp', 6: 'tcp', 17: 'udp'}
5
6 ip_to_name = {}
7 for conf in glob.glob(f"{clients_dir}/*.conf"):
8 name = os.path.basename(conf).replace('.conf', '')
9 try:
10 with open(conf) as f:

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 ────────────────────────────────────────────────
2 WireGuard Activity Log
3 ────────────────────────────────────────────────
4
5 Firewall Drops:
6 TIME CLIENT DESTINATION PROTOCOL
7 ───────────────────────────────────────────────────────────────────────────
8 11/05/2026 00:58 guest-zephyr-test 10.0.0.3:47989 tcp
9 11/05/2026 00:58 guest-zephyr-test 10.0.0.12:47989 tcp
10 11/05/2026 00:58 guest-zephyr-test 10.0.0.2:47989 tcp

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 FW_EVENTS_LOG="$(ctx::fw_events_log)"
4 WG_EVENTS_LOG="$(ctx::events_log)"
5
6 function cmd::logs::on_load() {
7 flag::register --name
8 flag::register --type
9 flag::register --since
10 flag::register --limit

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env python3
2 """
3 wgctl JSON helper — called by shell functions to read/write JSON files.
4 Usage: json_helper.py <command> <file> [key] [value]
5 """
6
7 import sys
8 import json
9 import os

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
2 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
3 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
4 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
5 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
6 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
7 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
8 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
9 09/05/2026 16:22 phone-helena 148.69.43.94 attempt
10 09/05/2026 16:22 phone-helena 148.69.43.94 attempt

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Rule File Parsing
5 # ============================================
6
7 function rule::exists() {
8 local name="$1"
9 [[ -f "$(ctx::rule::path "${name}.rule")" ]]
10 }
Newer Older

Powered by Opengist ⋅ Load: 118ms⋅

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