Skip to content

Instantly share code, notes, and snippets.

View sjlongland's full-sized avatar

Stuart Longland sjlongland

View GitHub Profile
@sjlongland
sjlongland / config-6.5.7-vk4msl-sb-57160-gc476bbdaa3d7
Created October 21, 2023 07:12
StarBook VI Kernel configuration for AMD Ryzen 7 laptop with AMI UEFI boot firmware
View config-6.5.7-vk4msl-sb-57160-gc476bbdaa3d7
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.5.7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo Hardened 13.2.1_p20230826 p7) 13.2.1 20230826"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=130201
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24000
@sjlongland
sjlongland / socat-scrape.log
Created October 19, 2023 00:30
AX.25 connected-mode traffic between two Linux hosts
View socat-scrape.log
2023-10-19 10:29:38,098 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX25SetAsyncBalancedModeFrame]
header.destination = VK4MSL-4*
header.source = VK4MSL-5
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 63 (0x3f)
body.pf = True (0x1)
body.modifier = 47 (0x2f)
@sjlongland
sjlongland / mastodon-v4.2.0-5k.patch
Created September 29, 2023 23:54
Mastodon 4.2.0 5000-character post limit patch
View mastodon-v4.2.0-5k.patch
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx
index 9222b2dc8..962310a28 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.jsx
+++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx
@@ -100,7 +100,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
- return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 5000 || (isOnlyWhitespace && !anyMedia));
@sjlongland
sjlongland / case01-setuppy-inline-license.txt
Created August 20, 2023 02:52
License output for setuptools with different projects
View case01-setuppy-inline-license.txt
+ tail -n +0 setup.py
import setuptools
setuptools.setup(
name="mypackage",
version="1.2.3",
license="""Mock License 1.0
This is a dummy license text to check how setuptools represents
it in the metadata so it can be exposed to pyproject.toml."""
View gist:8c920b7dfb943e8d006af4dc367603cf
# Manually typed from https://theblower.au/@DropBear/110647780217493876
Discussion over vote on Voice
A VOICE that can't be deleted.
When Assistant Minister for Indigenous Australians Malarndirri McCarthy said
that we will need to "call out the misinformation and disinformation" on the
Voice to Parliament. I got to work doing just that. I was seeing a lot of
it.
@sjlongland
sjlongland / dumpmeta.py
Last active June 27, 2023 03:07
Mucking around with `distutils` command packages
View dumpmeta.py
#!/usr/bin/env python3
from distutils.cmd import Command
import json
def to_json(v):
if (v is None) or isinstance(v, (bool, int, str)):
return v
elif isinstance(v, list):
@sjlongland
sjlongland / fail2ban-subnet-scrape.py
Last active May 21, 2023 03:12
fail2ban-subnet scraper
View fail2ban-subnet-scrape.py
#!/usr/bin/env python3
"""
Automatically coalesce IPs from fail2ban into subnets and flag them for
banning.
"""
# © 2023 Stuart Longland <me@vk4msl.com>
# SPDX-License-Identifier: BSD-2-Clause
@sjlongland
sjlongland / teststn.log
Last active April 3, 2023 09:30
Quick and dirty test of aioax25 connected mode
View teststn.log
2023-04-02 17:06:44,073 aioax25.kiss[kiss.py: 385] DEBUG OPEN new port 0
2023-04-02 17:06:44,074 aioax25.interface[router.py: 56] DEBUG Binding callsign 'VK4MSL' (regex False) SSID 4 to <bound method AX25Station._on_receive of <aioax25.station.AX25Station object at 0x7f26b28c19f0>>
2023-04-02 17:06:44,074 aioax25.kiss[kiss.py: 396] DEBUG Opening device
2023-04-02 17:06:44,074 aioax25.kiss[kiss.py: 435] DEBUG Awaiting KISS transport
2023-04-02 17:06:44,074 asyncmain[teststn.py: 59] INFO Waiting for connections
2023-04-02 17:06:44,074 aioax25.kiss[kiss.py: 488] DEBUG Delegating to KISS serial device '/dev/ax0'
2023-04-02 17:06:44,074 aioax25.kiss[kiss.py: 420] DEBUG Constructing protocol object
2023-04-02 17:06:44,075 aioax25.kiss.protocol[kiss.py: 689] DEBUG Announcing connection: SerialTransport(<_UnixSelectorEventLoop running=True closed=False debug=False>, <aioax25.kiss.KISSProtocol object at 0x7f26b28c1f60>, Serial<id=0x7f26b28c1570, open=True>(port='/dev/ax0', baudrate=9600, bytesize=8, parity='N', stop
@sjlongland
sjlongland / comparenacl.py
Created March 14, 2023 01:02
Re-format the NACL change output from Terraform to make changes easier to spot.
View comparenacl.py
import re
import argparse
PROTOCOLS = {
"1": "icmp",
"6": "tcp",
"17": "udp",
}
ap = argparse.ArgumentParser()
@sjlongland
sjlongland / example-chirp-output.csv
Last active April 21, 2023 11:29
Python script to sort WIA Repeater Data entries by geographic location
View example-chirp-output.csv
Location Name Frequency Duplex Offset Tone rToneFreq cToneFreq DtcsCode DtcsPolarity RxDtcsCode CrossMode Mode TStep Skip Comment URCALL RPT1CALL RPT2CALL DVCODE
0 8CAWest Gap 2 146.95 - 0.6 Tone 91.5 91.5 23 NN 23 Tone->Tone FM 25.0 0
1 8ITWest Gap U 438.525 - 5.0 Tone 91.5 91.5 23 NN 23 Tone->Tone FM 25.0 0
2 6AAMt Barker 2 146.825 - 0.6 88.5 88.5 23 NN 23 Tone->Tone FM 25.0 0
3 6AAMt Barker U 439.95 - 5.0 88.5 88.5 23 NN 23 Tone->Tone FM 25.0 0
4 6ALMt Clarence U 439.95 - 5.0 88.5 88.5 23 NN 23 Tone->Tone FM 25.0 0
5 6AWFairfield 2 147.0 - 0.6 88.5 88.5 23 NN 23 Tone->Tone FM 25.0 0
6 6MJManjimup 2 147.15 + 0.6 88.5 88.5 23 NN 23 Tone->Tone FM 25.0 0
7 6AKKalgoorlie 2 147.0 - 0.6 88.5 88.5 23 NN 23 Tone->Tone FM 25.0 0
8 6RRKalgoorlie 2 147.05 + 0.6 88.5 88.5 23 NN 23 Tone->Tone DMR 25.0 0