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
| # Install keybase and pinentry-mac | |
| brew update | |
| brew install keybase pinentry-mac | |
| # Create a Keybase.io account and key | |
| keybase signup | |
| # Or if you have an account | |
| keybase login |
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
| # Used as reference: https://gist.github.com/maxrimue/ca69ee78081645e1ef62 | |
| platform::semver_compare() { | |
| normalize_ver() { | |
| echo "${${1//./ }//v/}" | |
| } | |
| compare_ver() { | |
| [[ $1 -lt $2 ]] && echo -1 && return | |
| [[ $1 -gt $2 ]] && echo 1 && return |
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 | |
| # /volume1/UDMBackup is the path to the NFS share on the Synology | |
| # /nfs/UDMBackup is the mount point on the local Linux server where the script runs | |
| # /opt/scripts/UDM_pass is a text file containing the root account password on the UDM | |
| # I run this script on an Ubuntu VM for ease of maintenance and save the backups on a Synology using NFS | |
| LOGFILE="/opt/scripts/udmpro-backup.log" | |
| BKUPSCRIPT="sshpass -f /opt/scripts/UDM_pass scp -o StrictHostKeyChecking=no -r root@<<UDM PRO IP ADDRESS>>:/mnt/data/unifi-os/unifi/data/backup/autobackup/* /nfs/UDMBackup" | |
| mount <<SYNOLOGY IP ADDRESS>>:/volume1/UDMBackup /nfs/UDMBackup |
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
| /** | |
| * In this case this function convert an objest to url query params | |
| */ | |
| const object2UrlParameters = (objectValues:object): string => { | |
| let returnedParams:string = '' | |
| Object.getOwnPropertyNames(objectValues).forEach((paramName) => { | |
| let key = paramName as keyof object //Avoiding Index Signature | |
| let value = objectValues[key] | |
| returnedParams = `${returnedParams}&${paramName}=${value}` |
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 -S deno run --allow-env --allow-net | |
| import { parse } from "https://deno.land/[email protected]/flags/mod.ts"; | |
| import { red, green } from "https://deno.land/[email protected]/fmt/colors.ts"; | |
| const enum PullRequestState { | |
| open = "open", | |
| close = "close" | |
| } | |
| const enum HttpMethod { |
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 | |
| #shellcheck disable=SC2016 | |
| set -euo pipefail | |
| if [[ -z "${DOTLY_PATH:-}" ]] || ! output::empty_line > /dev/null 2>&1; then | |
| red='\033[0;31m' | |
| green='\033[0;32m' | |
| bold_blue='\033[1m\033[34m' | |
| normal='\033[0m' |
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 | |
| #shellcheck disable=SC2034 | |
| # | |
| # CONFIG | |
| # | |
| # IP or HOSTNAME to ping | |
| # IP o host al que hacer ping | |
| # HOST="192.168.33.1" |
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 | |
| # DOMAINS | |
| DOMAINS="example.com,*.example.com" | |
| # DNS Provider | |
| CERT_DNS="dns_namecheap" # For more: https://github.com/acmesh-official/acme.sh/wiki/dnsapi | |
| NAMECHEAP_API_KEY='' | |
| NAMECHEAP_USERNAME='' | |
| NAMECHEAP_SOURCEIP='' |
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 | |
| #shellcheck disable=SC2206,SC2207 | |
| ipv4_netmask() { | |
| local IFS='.' netmask=() rest_bits tmp_netmask=0 | |
| local -r bits="${1:-0}" | |
| if [[ $bits -lt 0 || $bits -gt 32 ]]; then | |
| echo "Error: IPv4 netmask should be between 0 and 32" 1>&2 | |
| return 1 |
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
| # Vacuum-extended-config | |
| # Version: 1.0.0 | |
| # Author: Gabriel Trabanco Llano <[email protected]> | |
| # https://github.com/gtrabanco https://keybase.io/gtrabanco | |
| # LICENSE: UNLICENSED. Do whatever you want with this stuff but attribution will be | |
| # very welcome from my ego. | |
| # Versión en español: https://gist.github.com/gtrabanco/476bc119448319a1db510f6948361f47 | |
| # You can add this file entirely but need to change <valetudo_or_ha_ip> and <valetudo_port> manually. |