Skip to content

Instantly share code, notes, and snippets.

View SuperSandro2000's full-sized avatar
Factorio - "><script src=></script>

Sandro SuperSandro2000

Factorio - "><script src=></script>
View GitHub Profile
SuperSandro2000 /
Created March 30, 2021 10:56
Upgrade nix installed with nix-installer to unstable
  1. systemctl disable --now nix-daemon.service nix-daemon.socket
  2. nix-env -p /nix/var/nix/profiles/default/ --install nix-2.4pre20210317_8a5203d
  3. rm /etc/profile.d/ /etc/profile.d/
  4. ln -s /nix/var/nix/profiles/default/etc/profile.d/ /etc/profile.d/
  5. ln -s /nix/var/nix/profiles/default/etc/profile.d/ /etc/profile.d/
  6. systemctl link /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.{service,socket}

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p ripgrep
#!/usr/bin/env bash
# vim: set filetype=bash:
set -eou pipefail
if [[ $# != 1 ]]; then
echo "Usage: $0 038342z429cavdp2q3mjczlprw83nca030mjlipjppr43bzg9db0"
exit 0
SuperSandro2000 /
Last active November 12, 2023 23:13
prepare commit message for nixpkgs. put into .git/hooks/prepare-commit-msg
#!/usr/bin/env bash
# shellcheck disable=SC2034
COMMIT_MSG_FILE=$1 # file which contains the commmit message
# shellcheck disable=SC2034
COMMIT_SOURCE=$2 # eg commit
# shellcheck disable=SC2034
SHA1=$3 # eg head
perl -i -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"