This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl https://map.aachen.freifunk.net/data/meshviewer.json | jq -r '.nodes[] | select(.is_online == true) | select(.firmware.release == "v2023.2.3-6")| .hostname as $h | .node_id as $n | .addresses[] | "allow \(.); # \($h) https://map.aachen.freifunk.net/#/en/map/\($n)"' | grep 2a03:2260:3006:.11 | |
| # 1. replace last grep number with a chosen domain number | |
| # 2. paste a few of the nodes into the nginx config | |
| # 3. sudo service nginx reload | |
| # 4. monitor the successful upgrade of the nodes | |
| # 5. repeat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| curl https://map.aachen.freifunk.net/data/meshviewer.json | jq -r '.nodes[].addresses[]' | grep 2a03:2260:3006:1 > ips.txt | |
| IPS_FILE="ips.txt" | |
| USER="root" | |
| # myself | |
| COMMAND="pretty-hostname" | |
| # search fore someones pubkey in the authorized keys | |
| COMMAND="grep -q 'AAAAB3Nxxx' /etc/dropbear/authorized_keys && pretty-hostname" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # === Configuration === | |
| API_KEY=${1:-"YOUR API KEY"} | |
| INTERFACE=${2:-"eth0"} | |
| IONOS_API_URL="https://ipv4.api.hosting.ionos.com/dns/v1/dyndns" | |
| # === Get global IPv6 address of the interface === | |
| IPV6_ADDR=$(ip -6 addr show dev "$INTERFACE" scope global | grep -oP '(?<=inet6\s)[0-9a-f:]+(?=/)' | head -n1) | |
| IPV4_ADDR=$(curl -s ipv4.icanhazip.com) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo apt-get install build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves bison linux-headers-amd64 | |
| tar xavf /usr/src/linux-source-$(uname -r | cut -d. -f1,2).tar.xz | |
| cd linux-source-$(uname -r | cut -d. -f1,2) | |
| # apply patch | |
| wget -O wireguard.patch https://git.zx2c4.com/wireguard-linux/patch/?id=db9ae3b6b43c79b1ba87eea849fd65efa05b4b2e | |
| patch -p1 < wireguard.patch | |
| #rm wireguard.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| When a hardware replacement is completed on a system, use the below procedure to clear existing alerts, and the events that generated the alert from the system. | |
| 1. sudo systemctl stop nvsm #stop nvsm services | |
| 2. sudo rm /var/lib/nvsm/sqlite/nvsm.db #remove the nvsm alert data base | |
| 3. sudo ipmitool sel clear # clear the SEL current logs | |
| 4. sudo rm /var/log/bmc_sel_archive_for_BMC_*.log #clear any archived SEL logs that can have the error | |
| 5. sudo systemctl start nvsm #start nvsm services |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # SET ENV VARIABLES FOR YOUR USE CASE | |
| # export RESTIC_PASSWORD= | |
| # export RESTIC_REPOSITORY=sftp:host:/mnt/folder | |
| # Each element is the exclusion path | |
| excludes=( | |
| "$HOME/.local" # Local configuration and application files | |
| "$HOME/.cache" # Temporary cache files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| ollama: | |
| image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest} | |
| container_name: ollama | |
| volumes: | |
| - ./ollama:/root/.ollama | |
| ports: | |
| - "11434:11434/tcp" | |
| restart: unless-stopped | |
| tty: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # backup script which backs up a whole linux installation doing incremental backups using rsync | |
| # Check for root priviliges | |
| if [[ $EUID -ne 0 ]]; then | |
| printf "Please run as root:\nsudo %s\n" "${0}" | |
| exit 1 | |
| fi | |
| set -o errexit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| #################################################################### | |
| ### ____ _____ ____ ___ _ _ _ ___ _ _ _ __ __ ### | |
| ### | _ \| ____| __ )_ _| / \ | \ | | / _ \| \ | | | \ \ / / ### | |
| ### | | | | _| | _ \| | / _ \ | \| | | | | | \| | | \ V / ### | |
| ### | |_| | |___| |_) | | / ___ \| |\ | | |_| | |\ | |___| | ### | |
| ### |____/|_____|____/___/_/ \_\_| \_| \___/|_| \_|_____|_| ### | |
| #################################################################### | |
| ####### _ _ ___ _ _ ____ _ _ _ _ _____ _ _ ######## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/lua | |
| -- SPDX-FileCopyrightText: Florian Maurer | |
| -- SPDX-License-Identifier: MIT | |
| local jsonc = require("jsonc") | |
| local function truncate_hostname(hostname, max_length) | |
| -- If the hostname is already within the maximum length, return it as is | |
| if #hostname <= max_length then | |
| return hostname |
NewerOlder