Skip to content

Instantly share code, notes, and snippets.

@xdel
xdel / srt-idx-updater.sh
Last active December 8, 2023 16:56
SRT subtitle index offset fix
#/bin/sh
# note: the script is unable to distinguish between bare number being found
# in closed captions and the index itself, may be previous line's
# cr/crlf shoulf be handled in a proper way
COUNT=$1
FILENAME=$2
sed -i -r 's/^([0-9]+)\r$/echo "$((\1+'$COUNT'))"/ge' $FILENAME
@xdel
xdel / tresor-aesni-4.4.patch
Created January 15, 2019 19:16
Port attempt of the TRESOR AES-NI for v4.4
diff --git a/Makefile b/Makefile
index 00ff2dd68ff1..a00489268b33 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 162
-EXTRAVERSION =
+EXTRAVERSION = -tresor0.5
@xdel
xdel / hp-lxbios.patch
Last active April 20, 2020 03:11
Quick patch for HP linux BIOS updater kernel module (remember to create /usr/tmp for HP userspace util)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,10 @@
#obj-m := mymod.o
obj-m := xwbios.o
-clean:
- rm -f *.o *.ko
+KDIR ?= /lib/modules/`uname -r`/build
+
@xdel
xdel / set_irq_affinity.sh
Last active July 17, 2023 16:56
Sets IRQ affinity on intel NICs, this version handles systems with >32 cores
# setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
# 2009-02-19 updated by Jesse Brandeburg
# 2012-12-21 fix for systems with >32 cores by Andrey K.
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
#char buf[IFNAMSIZ+6];
#