Skip to content

Instantly share code, notes, and snippets.

View j2L4e's full-sized avatar

Jan Lohage j2L4e

  • Bielefeld, Germany
  • 08:48 (UTC +02:00)
View GitHub Profile
@j2L4e
j2L4e / 90-mkinitcpio-install.hook.patch
Created December 11, 2022 17:52 — forked from heri16/90-mkinitcpio-install.hook.patch
Enable Linux Secure Boot with TPM 2.0 (Manjaro / Archlinux) - rEFInd
--- /usr/share/libalpm/hooks/90-mkinitcpio-install.hook 2020-03-05 12:45:41.000000000 +0800
+++ /etc/pacman.d/hooks/90-mkinitcpio-install.hook 2020-06-13 23:08:32.861202141 +0800
@@ -8,5 +8,7 @@
[Action]
Description = Updating linux initcpios...
When = PostTransaction
-Exec = /usr/share/libalpm/scripts/mkinitcpio-install
+Exec = /usr/local/share/libalpm/scripts/mkinitcpio-install
+Depends = sbsigntools
+Depends = x11-ssh-askpass
@j2L4e
j2L4e / random_ip.sh
Last active November 15, 2022 13:38
get a random ip within a provided subnet
#!/usr/bin/env bash
# https://gist.github.com/jjarmoc/1299906
function atoi {
#Returns the integer representation of an IP arg, passed in ascii dotted-decimal notation (x.x.x.x)
IP=$1; IPNUM=0
for (( i=0 ; i<4 ; ++i )); do
((IPNUM+=${IP%%.*}*$((256**$((3-${i}))))))
IP=${IP#*.}
done
@j2L4e
j2L4e / pulseaudio-next-sink.sh
Last active September 30, 2022 10:30
Set pulseaudio default sink to the next available sink and move all existing sink-inputs to the new default. Wraps around once the last input is reached.
#!/bin/sh
# Set pulseaudio default sink to the next available sink and move all existing sink-inputs to the new default.
# Wraps around once the last available sink is reached.
#
# (C) 2022, @j2L4e
# MIT License
currentline=$(pactl list short sinks | grep -n "$(pactl get-default-sink)" | cut -d: -f 1)
lastline=$(pactl list short sinks | wc -l)