Skip to content

Instantly share code, notes, and snippets.

View SEJeff's full-sized avatar

Jeff Schroeder SEJeff

View GitHub Profile
@SEJeff
SEJeff / README.md
Last active November 2, 2026 18:16
CVE-2026-98432 check for MTCP processes that need to be restarted

Example run:

# ./check_vulnerable_procs.sh
systemctl  restart  alloy.service     #  listening  to  MTCP
systemctl  restart  k3s.service       #  listening  to  MTCP

If you want to see the full output, export or set at run time a variable named DEBUG:

@SEJeff
SEJeff / etc_limits.d_solana-limits.conf.j2
Created April 4, 2024 22:44
Some configs for running solana via systemd with ansible
$ cat roles/solana/templates/solana-limits.conf.j2
# {{ ansible_managed }}
# If the network gets real sad and requires a manual restart, it is
# possible solana-ledger-tool needs to run, but it requires 500k open
# files to run.
solana soft nofile 1000000
solana hard nofile 1000000
@SEJeff
SEJeff / geth.service
Created January 30, 2023 15:23
Ethereum systemd service for wormhole client node.
# /etc/systemd/system/geth.service
# Ansible managed
[Unit]
Description=geth node
After=network.target
[Service]
User=geth
Group=geth
@SEJeff
SEJeff / git-add-commit-msg-prefix.md
Created November 30, 2022 19:45
Git: Add prefix to a range of commit messages

Original Link

Imagine that you cloned an open source project to contribute something. You implemented a bugfix through a series of atomic commits on a private branch. Just when you’re about to create a Pull Request to submit your changes, you discover in the contributor’s guide that you’re supposed to prefix each commit with the bug tracking number.

Rewriting the commit message of the last commit is easy:

git commit --amend
$ curl -sq -XPOST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"nopenopenope","method":"system_chain","params":[]
}' http://localhost:9933  | jq . -C
{
  "jsonrpc": "2.0",
  "result": "Karura",
  "id": "nopenopenope"
}
@SEJeff
SEJeff / get_solana_clock.py
Created February 9, 2022 14:53
Getting the Solana Proof of History clock time via the Clock sysvar
#!/usr/bin/env python3
# Uses construct and is a bit nicer code
import pytz
import pprint
import datetime
from construct import Int64ul, Int64sl, Struct
import requests
import base64
def main():
@SEJeff
SEJeff / example-dump.py
Created January 22, 2022 07:24
Example for pyth-client-py
#!/usr/bin/env python3
from __future__ import annotations
import asyncio
import os
import signal
import sys
from typing import List, Any
from loguru import logger
2021/04/09 11:52:11 INFO fsmsupport.go:252 - *** Entering state SET_KERNELCONFIG after getting event: salt_finished (Src: SALT_COMPUTE_RUNNING)
fatal error: sync: RUnlock of unlocked RWMutex
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x11f6601]
goroutine 1 [running]:
runtime.throw(0x14ed190, 0x21)
/jump/software/rhel7/golang-1.16/src/runtime/panic.go:1117 +0x72 fp=0xc00001b478 sp=0xc00001b448 pc=0x4447f2
sync.throw(0x14ed190, 0x21)
/jump/software/rhel7/golang-1.16/src/runtime/panic.go:1103 +0x35 fp=0xc00001b498 sp=0xc00001b478 pc=0x4758b5
sync.(*RWMutex).rUnlockSlow(0xc0004fc5d8, 0xffffffff)
@SEJeff
SEJeff / foo.py
Last active March 11, 2021 20:18
Python question
def append_one(data=[]):
data.append(1)
return data
### What does this function return for
1. `append_one()`
2. `append_one(data=[2])`
3. `append_one()`
@SEJeff
SEJeff / accessories.md
Last active August 5, 2022 13:58
Sous Vide Stuff I've Made and Love