This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
import re | |
split_version_re = re.compile('[.+-]') | |
class LooseVersion: | |
def __init__(self, s): | |
self.vs = split_version_re.split(s) | |
self.n = max(len(x) for x in self.vs) | |
def cmp(self, other, op): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# SPDX-FileCopyrightText: © 2022 Georg Sauthoff <mail@gms.tf> | |
# SPDX-License-Identifier: BSL-1.0 | |
import argparse | |
import http.server | |
import json | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2022, Georg Sauthoff <mail@gms.tf> | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("Ready."); | |
cli(); // atomic section | |
// set Arduino Pin 3 low | |
PORTD &= ~ _BV(PORTD3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: exception Emask 0x10 SAct 0xffffffff SErr 0x440100 action 0x6 frozen | |
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: irq_stat 0x08000000, interface fatal error | |
Dec 20 21:24:24 sos.lru.li kernel: ata3: SError: { UnrecovData CommWake Handshk } | |
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: failed command: READ FPDMA QUEUED | |
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: cmd 60/00:00:00:50:42/01:00:13:00:00/40 tag 0 ncq dma 131072 in | |
res 40/00:08:00:51:cf/00:00:0f:00:00/40 Emask 0x10 (ATA bus error) | |
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: status: { DRDY } | |
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: failed command: WRITE FPDMA QUEUED | |
Dec 20 21:24:24 sos.lru.li kernel: ata3.00: cmd 61/00:08:00:51:cf/01:00:0f:00:00/40 tag 1 ncq dma 131072 out | |
res 40/00:08:00:51:cf/00:00:0f:00:00/40 Emask 0x10 (ATA bus error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.8.18-300.fc33.x86_64] (local build) | |
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | |
=== START OF INFORMATION SECTION === | |
Model Family: Samsung based SSDs | |
Device Model: Samsung SSD 860 EVO 250GB | |
Serial Number: [..] | |
LU WWN Device Id: [..] | |
Firmware Version: RVT04B6Q | |
User Capacity: 250,059,350,016 bytes [250 GB] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I218-V rev 4, e1000e, Core i5 Haswell, CentOS 7 | |
ptp-clock-offset /dev/ptp0 | |
## Testing PTP_SYS_OFFSET ioct (1128283397) | |
PTP_SYS_OFFSET no 1: -710924824 ns, delay: 6734 ns | |
PTP_SYS_OFFSET no 2: -710922059 ns, delay: 3873 ns | |
PTP_SYS_OFFSET no 3: -710922092 ns, delay: 3889 ns | |
PTP_SYS_OFFSET no 4: -710922078 ns, delay: 3888 ns | |
PTP_SYS_OFFSET no 5: -710922096 ns, delay: 3939 ns | |
## Testing PTP_SYS_OFFSET_EXTENDED ioctl (3300932873) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assuming /mnt/root/{root,home} are mounts of anothers system root+home filesystems | |
cd /mnt/root/root | |
mount --bind /proc proc | |
mount --bind /sys sys | |
mount --bind /dev dev | |
cp /etc/resolv.conf etc/ | |
cd /mnt/root | |
mount --bind home root/home | |
chroot root /usr/bin/zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Demonstrate how to remove an environment variable from /proc/$pid/environ, | |
under Linux. | |
This pseudo file is accessible by other processes with sufficient privileges | |
(i.e. same user or root) and exposes the original environment vector. | |
Removing sensitive variables from it can be part of a defense in depth | |
strategy (i.e. to make it harder for a casual attacker to access it). | |
*/ | |
/** {{{ MIT No Attribution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* futex_demo.c | |
Usage: futex_demo [nloops] | |
(Default: 5) | |
Demonstrate the use of futexes in a program where parent and child | |
use a pair of futexes located inside a shared anonymous mapping to | |
synchronize access to a shared resource: the terminal. The two | |
processes each write 'num-loops' messages to the terminal and employ | |
a synchronization protocol that ensures that they alternate in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Demonstrate how to overwrite the original value of | |
an environment variable in the original environment vector | |
that is easily observable from other processes | |
(with sufficient permissions, i.e. same user or root). | |
*/ | |
/** {{{ MIT No Attribution | |
Copyright 2019 Georg Sauthoff <mail@georg.so> |
NewerOlder