Skip to content

Instantly share code, notes, and snippets.

View mjtiempo's full-sized avatar

Mark John Tiempo mjtiempo

View GitHub Profile
@nickjacob
nickjacob / systemd-prblm.service
Last active March 17, 2023 16:11
execute arbitrary bash code/variable substitution in systemd units
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/echo "2 + 2 = ${MYVAR}"
@vdwijngaert
vdwijngaert / openvpn3_sso.sh
Last active November 25, 2022 02:42
Helper function to automate openvpn3 connections that need SSO capabilities
# Helper function to automate openvpn3 connections that need SSO capabilities.
# Add it to your ~/.bashrc file using following code (and make sure to edit $OPENVPN3_CONFIG_NAME):
# source /path/to/openvpn3_sso.sh
# If using zsh, you can also save this to the `$ZSH/custom/openvpn3_sso.zsh` file.
# You can automatically have this run by calling ovpn3_sso_connect in your ~/.bashrc or ~/.zshrc file.
# WARNING: This has currently only been tested on zsh and bash.
# (c) Koen Van den Wijngaert <koen@neok.be>