Skip to content

Instantly share code, notes, and snippets.

View Strykar's full-sized avatar
💭
What is Bash?

Avinash H. Duduskar Strykar

💭
What is Bash?
  • India
View GitHub Profile
@Strykar
Strykar / em120.txt
Last active November 18, 2024 17:57
Quectel EM120 LTE / WWAN (dual-stacked) working on a ThinkPad T14s Gen 2i
$ sudo mmcli -m 0
-----------------------------------
General | path: /org/freedesktop/ModemManager1/Modem/0
| device id: 33e891c0d14dbd6df46a45e20eb35cd46afa13d7
-----------------------------------
Hardware | manufacturer: quectel
| model: EM120R_GL
| firmware revision: EM120RGLAPR02A07M4G
| carrier config: ROW_Commercial
| carrier config revision: 08010809
@Strykar
Strykar / tpm_digest.sh
Last active October 2, 2024 01:48
Extract TPM digests, remove quotes and create an EFI signature list
#!/bin/bash
# https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot#Enrolling_Option_ROM_digests
digests=$(grep -o 'Digest: "[a-f0-9]\{64\}"' | sed 's/Digest: "//;s/"$//')
counter=1
: > OpROM.esl
for digest in ${digests}; do
output_file="OpROM${counter}.esl"
digest-to-efi-sig-list "${digest}" "$output_file"
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh=12
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev=06.10
S: Manufacturer=Linux 6.10.10-arch1-1 xhci-hcd
S: Product=xHCI Host Controller
S: SerialNumber=0000:0e:00.0
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms
[ 0.000000] Linux version 6.10.10-arch1-1 (linux@archlinux) (gcc (GCC) 14.2.1 20240910, GNU ld (GNU Binutils) 2.43.0) #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000
[ 0.000000] Command line: initrd=\initramfs-linux.img root=UUID=ae1bb2f4-ce00-4ec1-ab9c-47ebba1f9d19 rw fsck.mode=force fsck.repair=yes delayacct
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000009afefff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000009aff000-0x0000000009ffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000000a000000-0x000000000a1fffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000a200000-0x000000000a20ffff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000000a210000-0x000000000affffff] usable
@Strykar
Strykar / i225_reset.py
Last active July 25, 2024 11:12
Python script to loop over the journal and reset the onboard Intel I225-V (rev 03) when it barfs with "igc: Failed to read reg 0xc030!"
#!/usr/bin/env python3
import pyudev
import re
from systemd import journal
def get_pci_id():
context = pyudev.Context()
pci_pattern = re.compile(r'^[0-9a-f]{4}:[0-9a-f]{2}:[0-9a-f]{2}\.[0-9].*Ethernet controller: Intel Corporation.*I225-V.*rev 03$', re.IGNORECASE)
[
{
"id": 0,
"type": "PipeWire:Interface:Core",
"version": 4,
"permissions": [ "r", "x", "m" ],
"info": {
"cookie": 4278053126,
"user-name": "strykar",
"host-name": "r912",
Thread 1 (Thread 0x7ffff637ed40 (LWP 130894) "qbittorrent-nox"):
#0 QObjectPrivate::addConnection (this=<optimized out>, signal=3, c=0x555555fd2c80) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:312
cd = 0x6e006500720072
connectionList = <optimized out>
rd = <optimized out>
#1 0x00007ffff6d9470e in QObjectPrivate::connectImpl (sender=sender@entry=0x5555560dd7f0, signal_index=<optimized out>, receiver=receiver@entry=0x555555f01ac0, slot=<optimized out>, slotObjRaw=slotObjRaw@entry=0x7fffcc000f00, type=<optimized out>, types=<optimized out>, senderMetaObject=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/tools/qscopedpointer.h:110
slotObj = std::unique_ptr<QtPrivate::QSlotObjectBase> = {get() = 0x0}
s = 0x5555560dd7f0
r = 0x555555f01ac0
@Strykar
Strykar / gist:888cd5efc073b5e92901a4ac9aec41a2
Created January 1, 2024 11:49
AuthnTrend ATKeyPro on Linux
$ sudo dmesg (snipped)
[ 7662.206806] usb 2-1.8.2: New USB device found, idVendor=31bb, idProduct=0622, bcdDevice= 1.00
[ 7662.206814] usb 2-1.8.2: New USB device strings: Mfr=2, Product=30, SerialNumber=xx
[ 7662.206818] usb 2-1.8.2: Product: ATKey.Pro-01xxxxxx
[ 7662.206821] usb 2-1.8.2: Manufacturer: AuthenTrend Technology Inc.
[ 7662.206824] usb 2-1.8.2: SerialNumber: 41544B45-0xxx-xxxx-xxxx-000001xxxxx
[ 7662.209307] hid-generic 0003:31BB:0622.0006: hiddev97,hidraw5: USB HID v2.00 Device [AuthenTrend Technology Inc. ATKey.Pro-01xxxxxx] on usb-0000:00:1d.0-1.8.2/input0
[ 7662.211121] hid-generic 0003:31BB:0622.0007: hiddev98,hidraw6: USB HID v2.00 Device [AuthenTrend Technology Inc. ATKey.Pro-01xxxxxx] on usb-0000:00:1d.0-1.8.2/input1
$ lsusb
@Strykar
Strykar / infnoise_openssl.txt
Created December 5, 2023 16:34
Infnoise OpenSSL engine test
$ openssl engine
Infnoise engine loaded.
(dynamic) Dynamic engine loading support
(infnoise) RNG engine using the infnoise TRNG
$ time openssl genrsa 4096
Infnoise engine loaded.
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDQ6O8HFWoBtXei
NnSP4WRFC1HAvI56ikf8KsrxQroP4XAmNiZ5R5fzl7H++Yb9UzZEAsMHszgKw29J
@Strykar
Strykar / infnoise_info.txt
Last active December 5, 2023 16:37
Leetronics Infnoise info
$ lsusb
Bus 002 Device 013: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
$ dmesg
[ 2624.100019] usb 2-1.8.1: new full-speed USB device number 13 using ehci-pci
[ 2624.206780] usb 2-1.8.1: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
[ 2624.206786] usb 2-1.8.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2624.206788] usb 2-1.8.1: Product: Infinite Noise TRNG
[ 2624.206789] usb 2-1.8.1: Manufacturer: 13-37.org
[ 2624.206790] usb 2-1.8.1: SerialNumber: 1337-EXXXXXXB