Skip to content

Instantly share code, notes, and snippets.

View alainwolf's full-sized avatar

Alain Wolf alainwolf

View GitHub Profile
@alainwolf
alainwolf / nextcloud-update-check
Last active May 13, 2022 15:27
Nextcloud Core Update Checker and Apps Updater
#!/bin/env ash
# shellcheck shell=dash
#
# Check Nextcloud core for available updates.
# * Update all Nextcloud apps to their latest available versions.
# * Notify if core update is available or any apps have been updated.
# * Stay silent otherwise (for cron-jobs or scheduled tasks).
# * Runs on standard Linux (Ubuntu, etc.), as well as Synology NAS DSM (if you get your settings right).
# * Works with different instances with dedicated Linux user profiles.
#
@alainwolf
alainwolf / occ
Created January 18, 2022 21:26
Nextcloud Command-Line Interface
#!/bin/env sh
# shellcheck shell=dash
#
# Nextcloud Command-Line Interface
#
# See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html
#
# --------------------------------------------------
# Configuration Settings
#!/bin/env ash
# shellcheck shell=dash
#
# Nextcloud core and apps update checks
#
# Doesn't output anything, if everything is up to date.
# Usefull when executed by cron-jobs, to only receive a mail, if updates are
# available.
# See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html
#
#!/bin/env ash
# shellcheck shell=dash
#
# Nextcloud command-line upgrades for Synology DiskStation system environments.
# See https://docs.nextcloud.com/server/stable/admin_manual/maintenance/update.html#using-the-command-line-based-updater
#
# Its recommended to disable Nextcloud cron jobs beforehand manuallly
# synoschedtask --get owner=root type=daily state=enabled
# --------------------------------------------------
#!/bin/bash
#
# Create new domains (or sub-domains) in PowerDNS authoritative servers
# using pdnsutil
#
# Features:
# * DNSSEC (incl. delegation in parent zone, if on same server);
# * NSEC3;
# * CAA;
# * SPF, DKIM and DMARC;
@alainwolf
alainwolf / Synology_backup.sh
Last active January 11, 2023 16:05
Synology DiskStation configuration backup
#!/bin/ash
#
# Synology DiskStation configuration backup
# Must be run as root
# Tested on
# DSM 6.1.6-15266 Update 1 - MARVELL Armada XP MV78230 (DS214+)
#
# Author: Alain Wolf <[email protected]> - https://gist.github.com/alainwolf/
# Date/Version: 2018-04-22/1.5
#
@alainwolf
alainwolf / MikroTik_backup.sh
Last active January 15, 2024 19:55
Backup MikroTik RouterOS configuration file on a Synology DiskStation
#!/bin/ash
#
# MikroTik router configuration backup
# for Synology DiskStation
# Tested on
# DSM 6.1.6-15266 Update 1 - MARVELL Armada XP MV78230 (DS214+)
# MikroTik RouterOS 6.42 - RouterBoard 2011UiAS-2HnD
#
# Author: Alain Wolf <[email protected]> - https://gist.github.com/alainwolf/
# Date/Version: 2018-04-22/1.5
@alainwolf
alainwolf / pfsense-backup.sh
Last active August 28, 2023 05:08
Backup pfSense configuration files on a Synology DiskStation
#!/bin/ash
#
# Backup pfSense configuration files
# for Synology DiskStation
# Tested on
# DSM 6.1.6-15266 Update 1 - MARVELL Armada XP MV78230 (DS214+)
# pSense 2.4.3-RELEASE (amd64) - FreeBSD 11.1-RELEASE-p7
#
# Author: Alain Wolf <[email protected]> - https://gist.github.com/alainwolf/
# Date/Version: 2018-04-22/1.5
@alainwolf
alainwolf / cron_dehydrated_dyn.sh
Last active January 9, 2017 16:13
SSL Certficate for Servers on Dynamic IP Addresses
#!/bin/sh
#
# Cronjob for Let's Encrypt certifcate for hosts on dynamic IP.
#
# Uses letsencrypt/acme client implemented as a shell-script
# – just add water https://dehydrated.de
#
# Please don't use HSTS or HPKP headers on dynamic IPs as they
# will affect other customers using your IP in the future.
#

Keybase proof

I hereby claim:

  • I am alainwolf on github.
  • I am alainwolf (https://keybase.io/alainwolf) on keybase.
  • I have a public key ASARJe47ioLYD4i72vwgry6KBeCeJJwWyczwoSNFAOeZLQo

To claim this, I am signing this object: