System Scripts

2012-03-10 20:16 UTC
  • Xyne

About

All scripts that are somehow system-related.

If there is no description for a script below, check the script itself for comments.

Rsync-based Bash Backup Function

backup_function.sh contains a function named backup that you can use in your backup scripts. It will maintain a working copy of a directory at another location and it will also create snapshot archives of modifed and deleted files so that you can retrieve old data if necessary.

See the comments in the file for usage information along with an example of how to purge snapshot archives older than a month.

GPG Batch Script

gpg-batch_sign prompts the user for a passphrase on stdin and then uses it to batch-sign files. I wrote it because I don't always need or want gpg-agent running, and also because pinentry-curses does not work with su (or didn't when I wrote this).

Subnet Launcher Function

launch_subnet.sh contains a function named launch_subnet that will automate several aspect of subnet management such as opening the required ports and starting the DHCP server. The file should be sourced from another bash script that sets the required variables before calling the function.

The file also contains a function named print_launch_subnet_usage that will list and describe the variables expected by the launch_subnet function.

For more information read my notes about configuring a subnet with DHCP and DNS. There you will also find example scripts and configuration files for

  • dhcpd
  • named
  • hostapd

List Apps by MIME-type

list_apps_by_mimetype.py is a Python script that uses the Mimeo module to... *drumroll* list applications by MIME-type. It was written as a quick example in response to a question on the forum.

merge-passwd

Interactively merge serveral passwd-like files (e.g. /etc/passwd, /etc/group). This is mainly intended for merging .pacnew files but should be useful in other cases.

Help Message

usage: merge-passwd [-h] [-o <path>] [-c] [-g] <path> [<path> ...]

Merge changes in password files.

positional arguments:
  <path>                The files to merge. Multiple may be given. If only one
                        is given, a matching .pacnew file must exist.

optional arguments:
  -h, --help            show this help message and exit
  -o <path>, --output <path>
                        The output file. This may be one of the input files,
                        but it is recommended to use a different file and
                        check the output before overwriting system files.
  -c, --confirm         Confirm before writing output file.
  -g, --group           Treat files as group files.

netctl-checklist

A simple dialogue that lets you simultaneously enable or disable multiple networks via netctl.

Screenshot

screenshot

screenshot

Urxvt Quake-like Terminal

urxvtq creates a quake-like togglable urxvt terminal. The script only requires xdotool and urxvtdc.

urxvtdc is a simple convenience script that will start up the urxvt daemon if necessary when invoking a client.

Contact
echo xyne.archlinux.ca | sed 's/\./@/'
Feeds
Blog News
Validation
XHTML 1.0 Strict CSS level 3 Atom 1.0