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

nuno

Joined 4 months ago

Recently created
Least recently created
Recently updated
Least recently updated
All gists 582

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Date Formats
5 # ============================================
6
7 FMT_DATE_ISO="%Y-%m-%d" # 2026-05-10
8 FMT_DATE_EU="%d/%m/%Y" # 10/05/2026
9 FMT_DATE_EU_DASH="%d-%m-%Y" # 10-05-2026
10 FMT_DATETIME_ISO="%Y-%m-%d %H:%M" # 2026-05-10 22:39

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2 # policy.command.sh — manage policies
3 #
4 # Subcommands:
5 # wgctl policy list
6 # wgctl policy show --name <name>
7 # wgctl policy add --name <name> [--tunnel-mode split|full]
8 # [--default-rule <rule>] [--strict-rule] [--no-auto-apply]
9 # [--desc <desc>]
10 # wgctl policy rm --name <name>

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2 # subnet.command.sh — manage the subnet map (subnets.json)
3 #
4 # Subcommands:
5 # wgctl subnet list
6 # wgctl subnet show --name <name>
7 # wgctl subnet add --name <name> --subnet <cidr> [--type <type>]
8 # [--tunnel-mode split|full] [--desc <desc>]
9 # [--group <parent>]
10 # wgctl subnet rm --name <name>

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2 # ui/identity.module.sh — rendering for identity data
3 # All functions pure rendering — no writes, no state changes.
4
5 function ui::identity::header() {
6 printf " %-20s %-7s %s\n" "IDENTITY" "PEERS" "DEVICE TYPES"
7 ui::divider 54
8 }
9
10 function ui::identity::row() {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2 # identity.module.sh — identity file management and peer-name inference
3
4 # ===========================================================================
5 # Path helpers
6 # ===========================================================================
7
8 function identity::path() {
9 local name="${1:-}"
10 echo "$(ctx::identities)/${name}.identity"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Client Config
5 # ============================================
6
7 function peers::create_client_config() {
8 local name="$1"
9 local type="$2"
10 local ip="$3"

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::identity::_device_status() {
2 local peer_name="${1:-}"
3 local peer_ip
4 peer_ip=$(peers::get_ip "$peer_name" 2>/dev/null) || return 0
5 [[ -z "$peer_ip" ]] && return 0
6
7 local is_blocked is_restricted pubkey handshake_ts
8 is_blocked=$(peers::is_blocked "$peer_name")
9 is_restricted=$(peers::is_restricted "$peer_name")
10 pubkey=$(cat "$(ctx::clients)/${peer_name}.pub" 2>/dev/null) || pubkey=""

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 function cmd::identity::_show() {
2 local name=""
3 while [[ $# -gt 0 ]]; do
4 case "$1" in
5 --name) name="$2"; shift 2 ;;
6 --help) cmd::identity::help; return ;;
7 *) log::error "Unknown flag: $1"; return 1 ;;
8 esac
9 done

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 function cmd::inspect::on_load() {
4 flag::register --name
5 flag::register --type
6 flag::register --config
7 flag::register --qr
8 }
9
10 function cmd::inspect::help() {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Lifecycle
5 # ============================================
6
7 function cmd::rule::on_load() {
8 flag::register --name
9 flag::register --desc
10 flag::register --group
Newer Older

Powered by Opengist ⋅ Load: 108ms⋅

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