Skip to content

Instantly share code, notes, and snippets.

View Nepherte's full-sized avatar

Bart Verhoeven Nepherte

View GitHub Profile
@Nepherte
Nepherte / mullvad-dns-mobile.mobileconfig
Last active October 25, 2023 01:26
Apple iOS Profile for Mullvad Encryted DNS (HTTPS)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<!-- Use Mullvad Encrypted DNS (HTTPS) -->
<key>DNSSettings</key>
@Nepherte
Nepherte / mullvad-dns-desktop.mobileconfig
Last active December 6, 2023 06:34
Apple macOS Profile for Mullvad Encryted DNS (HTTPS)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<!-- Use Mullvad Encrypted DNS (HTTPS) -->
<key>DNSSettings</key>
@Nepherte
Nepherte / digital-ocean-dynamic-dns
Last active February 25, 2023 13:45
Daily cron script to update external ip address of home network.
#!/bin/sh
# Binary can be obtained from: https://github.com/anaganisk/digitalocean-dynamic-dns-ip
digitalocean-dynamic-dns /home/bart/.config/digital-ocean/dynamic-ip.json
@Nepherte
Nepherte / 50-sysinfo
Last active April 20, 2023 12:54
Message of the day: system info
#!/bin/bash
echo ""
echo " .~~. .~~. "
echo " '. \ ' ' / .' "
echo ""
echo " .~ .~~~..~. "
echo " : .~.'~'.~. : "
echo " ~ ( ) ( ) ~ "
echo " ( : '~'.~.'~' : )"
@Nepherte
Nepherte / gateway.nepherte.com.sh
Last active January 24, 2023 08:01
Let's Encrypt hook to deploy an SSL certificate to a UniFi USG.
#!/usr/bin/env bash
set -e
# Deploys the certicate.
function deploy_to_usg {
# The key to use to login to the UniFi USG.
local SSH_KEY="/root/.ssh/unifi-usg"
# The user and hostname of the UniFi USG.
local HOST="admin@gateway.nepherte.com"
@Nepherte
Nepherte / usg-import-ssl.sh
Created October 11, 2020 14:21
Script to import an SSL certificate into a UniFi USG.
#!/usr/bin/env bash
# Graceful shutdown of the http server.
kill -SIGINT $(cat /var/run/lighttpd.pid)
# Install certificate in the http server.
mv /home/admin/.certificate/server.pem /etc/lighttpd/server.pem
chown root:root /etc/lighttpd/server.pem; chmod 0400 /etc/lighttpd/server.pem
# Start http server with new certificate.
@Nepherte
Nepherte / ui.nepherte.com.sh
Last active April 3, 2024 02:30
Let's Encrypt hook to deploy an SSL certificate to a UniFi Controller.
#!/bin/sh
set -e
for domain in $RENEWED_DOMAINS; do
case $domain in
ui.nepherte.com)
/usr/local/bin/ui-import-ssl.sh
;;
esac
@Nepherte
Nepherte / ui-import-ssl.sh
Last active April 3, 2024 02:32
Script to import an SSL certificate into a UniFi Controller.
#!/usr/bin/env bash
# unifi_ssl_import.sh
# UniFi Controller SSL Certificate Import Script for Unix/Linux Systems
# by Steve Jenkins <http://www.stevejenkins.com/>
# Part of https://github.com/stevejenkins/ubnt-linux-utils/
# Incorporates ideas from https://source.sosdg.org/brielle/lets-encrypt-scripts
# Version 2.8
# Last Updated Jan 13, 2017
@Nepherte
Nepherte / osiris.nepherte.com.sh
Last active January 13, 2022 05:00
Let's Encrypt hook to deploy an SSL certificate onto a Synology NAS for nginx.
#!/usr/bin/env bash
set -e
function deploy_to_synology {
# The id of the certificate on the Synology NAS.
local CERT_ID="crFPXQ"
# The packages on the Synology NAS that use the certificate.
local CERT_PKGS="system 4b4b117d-07d1-49db-9b42-7e1281cf3326"
@Nepherte
Nepherte / auth.nepherte.com.sh
Last active January 13, 2022 04:59
Let's Encrypt hook to deploy an SSL certificate onto a Synology NAS for Radius and LDAP.
#!/usr/bin/env bash
set -e
function deploy_to_synology {
# The id of the certificate on the Synology NAS.
local CERT_ID="7RY4jQ"
# The packages on the Synology NAS that use the certificate.
local CERT_PKGS="radiusd slapd"