Skip to content

Instantly share code, notes, and snippets.

@wernerjoss
wernerjoss / wgtoggle.sh
Created December 11, 2023 17:09
toggle wireguard interface status, if connected: disconnect, and vice versa
#!/bin/bash
# toggle wireguard interface status, if connected: disconnect, and vice versa
# wernerjoss 11.11.23
wgclient="orion" # default
while getopts ":c:v:" opt; do
case $opt in
c)
wgclient="$OPTARG"
@wernerjoss
wernerjoss / caldavexplore.sh
Last active July 16, 2020 06:35
Determine User's Calendar URLs on a CalDav Server
#!/bin/bash
# Display User's Calendar URLs on a CalDav Server
# derived from:
# https://blog.sleeplessbeastie.eu/2018/06/18/how-to-display-upcoming-events-in-nextcloud-calendar-using-shell-script/
# needs curl and xmlstarlet to be installed
# CalDav server and path
dav_server="https://cloud.example.org"
dav_path="/remote.php/dav/"
@wernerjoss
wernerjoss / bulkmail.py
Last active March 16, 2020 18:22
send bulk email to all recipients from RecListFileName
#!/usr/bin/env python3
#....ported to python3 02/2020
# ....bulkmail.py: send bulk email to recipients in RecListFileName
# ....Werner Joss, 2017,2018,2020
# ....License: GPL
# ....Message is from MsgFileName, preceeded by 'Hallo <Name>,\n'
# ....RecListFileName must contain one Recipient per line in the form 'Vorname Name <email>' note: surrounding <> for email Adress is required !
# ....Default Subject may be overridden in MsgFile (line starting with 'Subject:'
# ....this can send messages with utf-8 encoding, not just ascii (as bulkmail_asc.py) 30.04.17