View http_dump.py
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 |
View filter_env.c
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 |
View compare_version.py
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): |
View pwm_ir_send.ino
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); |
View samsung-860-evo-kern.log
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) |
View samsung-860-evo-smart.log
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] |
View xclipshow.cpp
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
// source: http://unix.stackexchange.com/a/163115/1131 | |
// GS, 2016-01-27, simplify the code a little bit | |
#include <QApplication> | |
#include <QTimer> | |
#include <QClipboard> | |
#include <QMimeData> | |
#include <QDebug> | |
#include <string> | |
#include <iostream> |
View ptp-offset-ioctl.log
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) |
View enter_chroot.sh
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 |
View orphan.c
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
/* For illustrating how orphaned children aren't necessarily adopted | |
by PID 1. | |
See also: http://stackoverflow.com/questions/284325/how-to-make-child-process-die-after-parent-exits/36945270#36945270 | |
2016, Georg Sauthoff <mail@georg.so> | |
*/ | |
#include <unistd.h> |
NewerOlder