This file contains 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 | |
# | |
# https://gist.github.com/jtmoon79/c951f81f621bb87ddb60836245aca4ff | |
# | |
# Script to generate a site-to-site Wireguard IPv4 VPN tunnel | |
# configuration files, and commands for systemd services. | |
# This script only covers a narrow scope of possible networking arrangements. | |
# It may not perfectly fit the user's needs, but it may provide the user with | |
# a working example that they can modify for their needs. | |
# |
This file contains 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 | |
allocated_threshold="95" # Don't run balance if less than this much is allocated (percentage) | |
fs="/" | |
# The limit (in chunks) is set to be: | |
# 75% of unused allocated data (in GiB), rounded up to nearest integer | |
# This may need to be adjusted depending on the setup | |
balance_awk_formula='{printf("-dlimit=%d\n",($1 - $2) * 0.75 + 1)}' |
This file contains 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
/* | |
* Copyright (c) 2023 Russell Harmon | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
This file contains 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 | |
# | |
# Do a ping and output results as CSV. | |
# | |
# [email protected] | |
# 2011-12-23 | |
# | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 [--add-timestamp] <ping host>" |