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 ────────────────────────────────────────────────
2 wgctl — Live Monitor (Ctrl+C to stop)
3 ────────────────────────────────────────────────
4
5 09:56 phone-helena — handshake
6 12:04 laptop-nuno — handshake
7 14:45 desktop-zephyr — handshake
8 14:45 desktop-zephyr 86.120.152.74 handshake
9 14:44 phone-helena 148.69.46.73 → helena-wan handshake
10 12:20 laptop-nuno 94.63.0.129 → nuno-home handshake

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 ────────────────────────────────────────────────
2 wgctl — Live Monitor (Ctrl+C to stop)
3 ────────────────────────────────────────────────
4
5 08:18 phone-helena — handshake
6 12:04 laptop-nuno — handshake
7 14:37 phone-helena 148.69.46.73 handshake
8 12:20 laptop-nuno 94.63.0.129 handshake
9 06:22 phone-helena-2 148.69.203.225 handshake
10 05:15 desktop-zephyr 86.120.152.74 handshake

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 # ui::_render_endpoint_col
2 # Builds padded endpoint string: "raw_ip → resolved" or "raw_ip" or "-"
3 # Args: endpoint resolved w_endpoint
4 # Returns: padded colored string via stdout
5 function ui::_render_endpoint_col() {
6 local endpoint="${1:-}" resolved="${2:-}" w_endpoint="${3:-20}"
7 local colored visible_len pad_n
8
9 if [[ -n "$endpoint" ]]; then
10 if [[ -n "$resolved" ]]; then

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2 # modules/resolve.module.sh — IP/host resolution chain
3 # Chains: hosts.json exact match → services.json match → raw IP
4 # Depends on: hosts.module.sh, net.module.sh
5
6 declare -gA _RESOLVE_CACHE=()
7
8 # resolve::ip <ip> [port] [proto]
9 # Resolves an IP to a display name using the full resolution chain.
10 # Returns raw IP if no match found.

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1
2 local endpoint_display
3 endpoint_display=$(resolve::ip "${endpoint:-}")
4 [[ -z "$endpoint_display" ]] && endpoint_display="${endpoint:--}"
5
6 # Build row with ts prefix for sorting
7 local row
8 row=$(ui::watch::wg_row "$ts_fmt" "$client_name" "$endpoint_display" "handshake" \
9 "$w_client" "$w_dest")
10 rows+=("${ts}|${row}")

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function ui::watch::fw_row() {
2 local ts="${1:-}" client="${2:-}" dest_display="${3:-}" \
3 w_client="${4:-20}" w_dest="${5:-18}"
4
5 # "fw" is always 2 visible chars — no padding needed
6 local src="${_UI_WATCH_FW_COLOR}fw\033[0m"
7
8 local ts_pad client_pad dest_pad_n
9 ts_pad=$(printf "%-11s" "$ts")
10 client_pad=$(printf "%-${w_client}s" "$client")

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::identity::help() {
2 cat <<EOF
3 Usage: wgctl identity <subcommand> [options]
4
5 Manage peer identities.
6
7 Subcommands:
8 list List all identities
9 show --name <name> Show identity details and device status
10 add --name <name> Manually attach a peer to an identity

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Private helpers
5 # ============================================
6
7 function cmd::shell::_prompt() {
8 local user host dir
9 user=$(whoami)
10 host=$(hostname -s)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 WireGuard Events
2 ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
3 26/05 12:14 phone-helena 148.69.37.36 handshake ↑ 32m offline
4 26/05 12:04 laptop-nuno 94.63.0.129 → nuno-home handshake
5 26/05 11:42 phone-helena 148.69.37.36 handshake ↑ 9m
6 26/05 11:32 phone-helena 148.69.37.36 handshake ↑ 20m offline
7 26/05 11:11 phone-helena 148.69.37.36 handshake ↑ 33m offline
8 26/05 10:37 phone-helena 148.69.37.36 handshake ↑ 8m
9 26/05 10:29 phone-helena 148.69.37.36 handshake ↑ 5m
10 26/05 10:23 phone-helena 148.69.37.36 handshake ↑ 27m offline

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function ui::logs::fw_row() {
2 local ts="${1:-}" client="${2:-}" dest_ip="${3:-}" dest_port="${4:-}" \
3 proto="${5:-}" svc_name="${6:-}" count="${7:-1}" \
4 w_client="${8:-20}" w_dest="${9:-30}" \
5 src_endpoint="${10:-}" src_resolved="${11:-}" \
6 w_endpoint="${12:-0}" resolved_only="${13:-false}"
7
8 local ts_pad client_pad
9 ts_pad=$(printf "%-11s" "$ts")
10 client_pad=$(printf "%-${w_client}s" "$client")
Newer Older

Powered by Opengist ⋅ Load: 140ms⋅

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