Skip to content

Instantly share code, notes, and snippets.

View frostschutz's full-sized avatar

Andreas Klauer frostschutz

  • Heidelberg, Germany
View GitHub Profile
@frostschutz
frostschutz / dmesg.txt
Created February 24, 2020 23:16
LVM RAID5 gen I/O failure and wild capacity change event
[44747.505134] device-mapper: raid: Loading target version 1.15.0
[44772.918083] device-mapper: raid: Device 1 specified for rebuild; clearing superblock
[44772.918086] device-mapper: raid: Superblocks created for new raid set
[44772.922200] md/raid1:mdX: active with 1 out of 2 mirrors
[44775.150317] mdX: bitmap file is out of date, doing full recovery
[44775.203299] md: recovery of RAID array mdX
[44785.658799] md: mdX: recovery done.
[44796.572343] md/raid:mdX: device dm-97 operational as raid disk 0
[44796.572345] md/raid:mdX: device dm-99 operational as raid disk 1
[44796.573124] md/raid:mdX: raid level 5 active with 2 out of 2 devices, algorithm 2
@frostschutz
frostschutz / input-event-codes.sh
Created July 20, 2019 18:32
Kobo input-event-test
#!/bin/bash
#
# parse input-event-codes.h and build "number -> name" mapping
#
parse_prefix() {
prev=-1
grep -F "#define ${1}_" /usr/include/linux/input-event-codes.h |
while read define name value comment
@frostschutz
frostschutz / hdparm.txt
Created June 2, 2017 10:54
Testing TRIM using the yes-Method described here https://unix.stackexchange.com/a/85880/30851
# hdparm -i /dev/sda
/dev/sda:
Model=TS256GSSD340, FwRev=SVN263, SerialNo=20140429B42802022053
Config={ Fixed }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=500118192
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
@frostschutz
frostschutz / archlinux-initcpio-keygen-hook.sh
Last active January 12, 2019 12:59
ArchLinux self-decrypting server keygen hook
HOOKS="... keygen encrypt ..."
# /etc/initcpio/hooks/keygen
LUKS="/dev/sdxy"
run_hook() {
# Produce key without newlines.
echo -n $(
(