Все Новый

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 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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")

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::logs::show_fw_events() {
2 local filter_ip="${1:-}" filter_name="${2:-}" filter_type="${3:-}" \
3 limit="${4:-50}" net_file="${5:-}" collapse="${6:-1}" \
4 since="${7:-}" filter_dest_ip="${8:-}" filter_dest_port="${9:-}" \
5 sort_order="${10:-desc}" resolved_only="${11:-false}"
6
7 [[ ! -f "$FW_EVENTS_LOG" ]] && return 0
8
9 local data
10 data=$(json::fw_events \

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month 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")
Новее Позже

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

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