Skip to content

Instantly share code, notes, and snippets.

@flisk
flisk / zswapstat.pl
Last active December 26, 2021 16:56
convenience script for reporting zswap statistics
#!/usr/bin/env perl
# zswapstat -- convenience script for reporting zswap statistics
# see also: https://www.kernel.org/doc/html/latest/vm/zswap.html
use strict;
use warnings;
use constant ZSWAP_DEBUG_DIR => "/sys/kernel/debug/zswap";
sub read_file {
@flisk
flisk / remove-rsyslog.sh
Created July 27, 2021 09:02
Remove rsyslog and its log files from Debian systems not requiring rsyslog compatibility
#!/usr/bin/env bash
#
# remove-rsyslog -- remove rsyslog and its log files
#
# As of Debian 10, rsyslog exists mainly for backwards compatibility reasons,
# and it is not required for the base system to operate. If you do not require
# this backwards compatibility, you can use this script to remove rsyslog and
# all of its redundant log files from your system.
#
systemctl disable --now rsyslog.service
@flisk
flisk / nixup.sh
Last active June 27, 2022 11:46
macOS shell script to upgrade multi-user nix installs
#!/bin/sh
# see https://nixos.org/manual/nix/stable/installation/upgrading.html
set -eu
if [ "$(id -u)" != 0 ]; then
script="$(basename "$0")"
>&2 echo "$script: root required, re-executing through sudo"
exec sudo --login "$0"
fi