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 | |
zoneID="your_zone_ID" | |
ID="your_ID" | |
APIToken="your_API_token" | |
name="your_domain" | |
DIRECTORY=/data/logs | |
log="$DIRECTORY/updateIP.log" | |
echo $log |
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 | |
if [ -z "$1" ]; then | |
echo "Specify which directory you want to check." | |
i exit | |
else | |
echo "Checking \$1 ... " | |
fi | |
sudo find "$1" -type f -size +6M -exec ls -lh {} \; |
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 | |
#v 1.0.2 | |
URL=$1 | |
# Function to get the description for the certificate result | |
get_certificate_description() { | |
case $certificate_result in | |
0) echo "The certificate verification was successful." ;; | |
1) echo "The certificate could not be found." ;; |
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 | |
# V 1.0 | |
# Copyright Michael Bierman | |
# https://gist.github.com/mbierman/85c9672d212bdda09d9d4f5d27574d1f | |
mount_point=/mnt/usb-stick/ | |
mounted=$(mount -l | grep -c "/mnt/usb-stick") | |
if [ "$1" = "u" ] && [ "$mounted" -eq "1" ] ; then | |
read -p "Want to Unmount the drive. Please press 'Y' to continue or any key to stop: " -n1 now |
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 | |
# Script that checks the battery level of connected Magic Keyboard, Magic Trackpad, and Magic Mouse and displays a notification if it is below a threshold (default 15%). | |
# Optionally set threshold as a parameter. ex: ./check_kb_battery.sh 10 | |
COMPARE=${1:-15} | |
check_battery_level() { | |
device_name=$1 | |
battery_level=$2 |
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 | |
diskusage=$(df -H | grep -vE '^Filesystem|mmcblk0p3' | awk '{ print $6 }') | |
name=$(printf "$(redis-cli get groupName)") | |
log=/data/logs/fwcheckspace.log | |
mydate=$(date +"%a %b %d %H:%M %P") | |
dir=$(dirname "$0") | |
IFTTTKEY="$(cat $dir/IFTTT.data | grep IFTTTKEY | cut -f2 -d "=" )" | |
IFTTTrigger="FWGReboot" | |
IMAGE="https://avatars2.githubusercontent.com/u/21322342?s=200&v=4" | |
URL="firewalla://" # opens the firewalla app on iOS |
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/sh | |
# v 1.2 | |
# https://gist.github.com/mbierman/dd45821b53d5d22147cef217f0c0fe95 | |
# Variables | |
docker="/.dockerenv" | |
dir=$(dirname "$0") | |
IFTTTKEY="$(cat $dir/rebootdata.txt | grep IFTTTKEY | cut -f2 -d "=" )" | |
IFTTTTrigger="$(cat $dir/rebootdata.txt | grep IFTTTTrigger | cut -f2 -d "=" )" |
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 | |
# Michael Bierman | |
# v1.0 | |
# https://gist.github.com/mbierman/a84c8ad4b2b4617ccc8d16f66df10197 | |
version=$(cat ~/firewalla/net2/config.json | jq '.version') | |
version=${version:=Not Found} | |
OS=$(lsb_release -r | cut -f2) |
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 | |
# v 1.0.1 | |
# https://gist.github.com/mbierman/f81b591fd27638b9f4221e9525229eca | |
echo -e "How many minutes before now?" | |
read minutes | |
# min=$(date -v-${minutes}M +%s) | |
minutes=${minutes:=0} | |
echo -e "You entered $minutes minutes\n\n" |
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 | |
# v 1.0.2 | |
# https://gist.github.com/mbierman/03b2a962ac04963ef5bbc8354d0ed5d1 | |
# 2022 mbierman | |
sleep="${1:-5}" | |
regex="^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$" | |
getmac () { | |
rnd=$(openssl rand -hex 6 | sed 's/\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)/\1:\2:\3:\4:\5:\6/') |
NewerOlder