Все Новый

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

Зарегистрирован 2 months ago

Свежие сверху по дате создания
Свежие снизу по дате создания
Свежие сверху по дате обновления
Свежие снизу по дате обновления
Все фрагменты 570

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 wc -l /etc/wireguard/wgctl/core/lib/events.py
2 head -30 /etc/wireguard/wgctl/core/lib/events.py
3 673 /etc/wireguard/wgctl/core/lib/events.py
4 """
5 events.py — WireGuard and firewall event processing.
6 """
7
8 import os
9 import json
10 import sys

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::test::run_cmd() {
2 local desc="$1" expected="${2:-}"
3 shift 2
4
5 local tmp exit_code
6 tmp=$(mktemp)
7
8 set +e
9 timeout 30 "$WGCTL_BINARY" "$@" > "$tmp" 2>&1
10 exit_code=$?

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::unblock::run() {
2 local name="" identity="" type=""
3 local ips=() subnets=() ports=() services=()
4 local all=false quiet=false force=false
5 local reason=""
6
7 while [[ $# -gt 0 ]]; do
8 case "$1" in
9 --name) name="$2"; shift 2 ;;
10 --identity) identity="$2"; shift 2 ;;

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::block::run() {
2 local name="" identity="" type="" block_name=""
3 local ips=() subnets=() ports=() services=()
4 local quiet=false force=false
5 local reason=""
6
7 while [[ $# -gt 0 ]]; do
8 case "$1" in
9 --name) name="$2"; shift 2 ;;
10 --identity) identity="$2"; shift 2 ;;

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::block::run() {
2 local name="" identity="" type="" block_name=""
3 local ips=() subnets=() ports=() services=()
4 local quiet=false force=false
5
6 while [[ $# -gt 0 ]]; do
7 case "$1" in
8 --name) name="$2"; shift 2 ;;
9 --identity) identity="$2"; shift 2 ;;
10 --type) type="$2"; shift 2 ;;

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 /etc/wireguard/wgctl/commands/block.command.sh:7:function cmd::block::on_load() {
2 /etc/wireguard/wgctl/commands/block.command.sh:25:function cmd::block::help() {
3 /etc/wireguard/wgctl/commands/block.command.sh:60:function cmd::block::run() {
4 /etc/wireguard/wgctl/commands/block.command.sh:219:function cmd::block::_block_identity() {
5 /etc/wireguard/wgctl/commands/block.command.sh:254:function cmd::block::_get_endpoint() {
6 /etc/wireguard/wgctl/commands/block.command.sh:264:function cmd::block::_block_all() {
7 /etc/wireguard/wgctl/commands/unblock.command.sh:7:function cmd::unblock::on_load() {
8 /etc/wireguard/wgctl/commands/unblock.command.sh:25:function cmd::unblock::help() {
9 /etc/wireguard/wgctl/commands/unblock.command.sh:58:function cmd::unblock::run() {
10 /etc/wireguard/wgctl/commands/unblock.command.sh:190:function cmd::unblock::_unblock_identity() {

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::test::unit_json_output() {
2 test::section "Unit: JSON output"
3
4 command::_load_mixins 2>/dev/null || true
5
6 # json::envelope produces valid structure
7 local result
8 result=$(echo '{"peers":[]}' | json::envelope "list" "0")
9 cmd::test::assert "envelope ok field" "$(echo "$result" | grep -o '"ok":true')" '"ok":true'
10 cmd::test::assert "envelope command field" "$(echo "$result" | grep -o '"command":"list"')" '"command":"list"'

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 sed -n '/^function cmd::test::section_peer_cmd/,/^}/p' \
2 /etc/wireguard/wgctl/commands/test/integration.sh
3 function cmd::test::section_peer_cmd() {
4 test::section "Peer command"
5
6 "$WGCTL_BINARY" remove --name phone-testunit --force > /dev/null 2>&1 || true
7 "$WGCTL_BINARY" add --name testunit --type phone > /dev/null 2>&1
8
9 # update-dns
10 cmd::test::run_cmd "peer update-dns --name" "Updated DNS" peer update-dns --name phone-testunit

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 root@wireguard:/etc/wireguard/wgctl# grep -n "^function cmd::test::section_\|^function cmd::test::_destructive_" /etc/wireguard/wgctl/commands/test/integration.sh /etc/wireguard/wgctl/commands/test/destructive.sh | head -20
2 /etc/wireguard/wgctl/commands/test/integration.sh:143:function cmd::test::section_list() {
3 /etc/wireguard/wgctl/commands/test/integration.sh:160:function cmd::test::section_inspect() {
4 /etc/wireguard/wgctl/commands/test/integration.sh:172:function cmd::test::section_config() {
5 /etc/wireguard/wgctl/commands/test/integration.sh:179:function cmd::test::section_rules() {
6 /etc/wireguard/wgctl/commands/test/integration.sh:193:function cmd::test::section_groups() {
7 /etc/wireguard/wgctl/commands/test/integration.sh:203:function cmd::test::section_audit() {
8 /etc/wireguard/wgctl/commands/test/integration.sh:210:function cmd::test::section_logs() {
9 /etc/wireguard/wgctl/commands/test/integration.sh:227:function cmd::test::section_fw() {
10 /etc/wireguard/wgctl/commands/test/integration.sh:238:function cmd::test::section_net() {

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 function cmd::export::_full() {
2 local no_config="${1:-false}" no_peers="${2:-false}"
3
4 local sections=()
5
6 # Config
7 if ! $no_config; then
8 local config_json="{}"
9 [[ -f "$(ctx::config_file)" ]] && config_json=$(cmd::export::_compact_json "$(ctx::config_file)")
10 sections+=("\"config\":${config_json}")
Новее Позже

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

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