This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Safely source sh-based config files with `bwrap` | |
# | |
# This function allows script developers to safely include sh-based config | |
# files, especially if the config file isn't owned by the running user. Most | |
# notably this function allows one to source config files owned by unprivileged | |
# users as root, without practically giving said unprivileged user root access. | |
# The file is sourced within an unprivileged bwrap container with read-only | |
# access to /usr and nothing else. The sh-based config file can thus do | |
# anything a sourced Bash file normally could (e.g. do complex calculations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# nm-systemd-dispatcher.sh | |
# Starts/stops a Systemd unit when a connection's status changes to up/down. | |
# | |
# Install this script to `/etc/NetworkManager/dispatcher.d/60-systemd.sh` and | |
# add the following section to your NetworkManager connection config in | |
# `/etc/NetworkManager/system-connections/*.nmconnection`: | |
# [user] | |
# systemd.unit=myservice.service | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# mkarchiso-gnome | |
# Creates a live ISO of Arch Linux with GNOME | |
# | |
# This script was created to ease creating live ISOs of Arch Linux with GNOME | |
# installed. It's highly customized to my personal preferences, thus it's | |
# likely not very useful as-is for most people, but it could be a good | |
# starting point for others to create their own custom live ISO. | |
# | |
# More about `mkarchiso`: https://wiki.archlinux.org/title/Archiso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# systemd-calendar-run.sh | |
# Runs a command if a Systemd calendar specification is due | |
# | |
# This script checks whether a given Systemd calendar specification (pass the | |
# '--on-calendar SPEC' option) relative to either the current, or a given time | |
# (pass the '--base-time TIMESTAMP' option) yields a past elapse time and runs | |
# the given command (pass as arguments: 'COMMAND [ARGUMENT]'). Otherwise the | |
# script exits with return code 254. When an invalid option is given, the | |
# script exits with return code 255. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# rdiff-backup-to-borg | |
# Converts rdiff-backup backups to Borg Backup | |
# | |
# This script was created to ease switching from `rdiff-backup` to `borg`. It | |
# restores all increments of a rdiff-backup repository and backs it up using | |
# Borg Backup. | |
# | |
# More info about Borg Backup: <https://borgbackup.readthedocs.io> | |
# More info about rdiff-backup: <https://rdiff-backup.net/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# btrfs-snapshot-run | |
# Creates snapshots of a btrfs filesytem and runs a given command | |
# | |
# This script was created to ease backing up a btrfs filesystem. It expects | |
# Snapper's subvolume layout, with subvolumes directly below in the hierarchy | |
# of the top level subvolume (ID 5), all prefixed by '@'. Other subvolumes are | |
# being ignored. | |
# | |
# This script will create readonly snapshots for either all, or the provided |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# systemd-wait-unit-active.sh | |
# Waits until a systemd system or user unit is active. | |
# | |
# Notice: When using this script with user units you must ensure that `sudo` | |
# can call `systemctl` proberly. This often fails due to `systemctl` not | |
# finding the user's D-Bus socket. Ensure that the user runs a D-Bus daemon | |
# and that the '$XDG_RUNTIME_DIR' environment variable is defined. | |
# | |
# Copyright (C) 2021 Daniel Rudolf (<https://www.daniel-rudolf.de>) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# coverage-badge.sh - Creates a coverage.svg badge from a clover.xml. | |
# | |
# Copyright (C) 2021 Daniel Rudolf (<https://www.daniel-rudolf.de>) | |
# License: The MIT License <http://opensource.org/licenses/MIT> | |
# | |
# SPDX-License-Identifier: MIT | |
function print_usage { | |
echo "Usage:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Pico redirect plugin | |
* | |
* Adds a `Redirect` meta header to redirect to other URLs. The meta header | |
* supports URL substitution variables, namely %base_url%, %plugins_url%, | |
* %themes_url%, %assets_url% and %theme_url%. | |
* | |
* Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 6to4-daemon - Establishing an IPv6 tunnel using 6to4 | |
# Copyright (C) 2011 Daniel Rudolf <http://www.daniel-rudolf.de/> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
NewerOlder