Skip to content

Instantly share code, notes, and snippets.

View evertdespiegeleer's full-sized avatar

Evert De Spiegeleer evertdespiegeleer

View GitHub Profile
#!/bin/bash
# Script by Evert De Spiegeleer
# 29/09/2020
help_usage () {
echo "
--- usage ---
rasterizePdf <inputFile> <outputFile>
@evertdespiegeleer
evertdespiegeleer / devVmMonitor.60s.sh
Last active March 9, 2023 13:10
SwiftBar plugin to monitor and activate/deactivate a virtual machine on Azure.
#!/usr/bin/env bash
# azure cli and jq required
AZURE_VM_MACHINE_NAME="docker-runner"; # What the vm is called in azure
RESOURCE_GROUP="my-resource-group";
LABEL_VM_NAME='Dev server'; # What the machine should be called in the menubar
MACHINE_EMOJI='🤖';
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
@evertdespiegeleer
evertdespiegeleer / cloudflare-local-ip-updater.2h.mjs
Last active April 25, 2024 12:11
Basic Swiftbar script to keep one or more Cloudflare A records in sync with local IP
#!/usr/bin/env node
import { networkInterfaces } from 'node:os'
const zoneId = '<ZONE_ID>'
const apiToken = '<API_TOKEN>'
const recordSubstring = 'substring-of-the-name-of-your-record(s)'
const interfaceName = 'en0'
// Get local IP
const localIp = networkInterfaces()[interfaceName].find(