Skip to content

Instantly share code, notes, and snippets.

View kierdavis's full-sized avatar

Kier Davis kierdavis

View GitHub Profile
[root@emam-ossdev-firedancer17 ~]# journalctl --since 2023-11-29 --until 2023-12-02 | grep 'NMI received' | wc -l
4933
[root@emam-ossdev-firedancer17 ~]# journalctl --since '2023-11-30 19:27:00' | head -20
-- Logs begin at Wed 2023-10-18 12:05:58 UTC, end at Tue 2023-12-12 11:01:01 UTC. --
Nov 30 19:27:13 emam-ossdev-firedancer17 kernel: Uhhuh. NMI received for unknown reason 2d on CPU 1.
Nov 30 19:27:13 emam-ossdev-firedancer17 kernel: Do you have a strange power saving mode enabled?
Nov 30 19:27:13 emam-ossdev-firedancer17 kernel: Dazed and confused, but trying to continue
Nov 30 19:27:18 emam-ossdev-firedancer17 kernel: Uhhuh. NMI received for unknown reason 2d on CPU 7.
Nov 30 19:27:18 emam-ossdev-firedancer17 kernel: Do you have a strange power saving mode enabled?
@kierdavis
kierdavis / gist:46de4150b21a8e683969e51d291f8571
Created November 22, 2023 13:44
server_selector_data.json
[
{
"server_id": "NY-14SKJ4",
"role": "development",
"is_healthy": true
},
{
"server_id": "NY-NXIBIT",
"role": "trading",
"is_healthy": true
[
{
"server_id": "HK-7HOG7W",
"role": "trading",
"is_healthy": true
},
{
"server_id": "CH-6CCY6U",
"role": "trading",
"is_healthy": false
2022-07-18T04:43:37.746-0500 [INFO] Terraform version: 1.1.7
2022-07-18T04:43:37.746-0500 [INFO] Go runtime version: go1.17.8
2022-07-18T04:43:37.746-0500 [INFO] CLI args: []string{"terraform", "import", "-no-color", "cloudflare_list.test", "0123456789abcdeffedcba9876543210/nonexistent"}
2022-07-18T04:43:37.746-0500 [DEBUG] Attempting to open CLI config file: /home/kdavis/.terraformrc
2022-07-18T04:43:37.746-0500 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-07-18T04:43:37.746-0500 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-07-18T04:43:37.746-0500 [DEBUG] ignoring non-existing provider search directory /home/kdavis/.terraform.d/plugins
2022-07-18T04:43:37.746-0500 [DEBUG] ignoring non-existing provider search directory /home/kdavis/.local/share/terraform/plugins
2022-07-18T04:43:37.746-0500 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-07-18T04:43:37.746-0500 [DEBUG] ignoring non-existing provider sear
@kierdavis
kierdavis / vector.toml
Created May 6, 2022 14:43
Vector config for parsing auditd logs
[sources.audit_raw]
type = "file"
include = [ "/var/log/audit/audit.log" ]
read_from = "beginning"
[transforms.audit_parsed]
type = "remap"
inputs = ["audit_raw"]
source = '''
# The format is deceptively complex - it looks like key-value pairs but there's actually a few layers of nesting.
# module.equinix_host["<MYHOSTNAME>"].metal_device.host[0] must be replaced
-/+ resource "metal_device" "host" {
~ access_private_ipv4 = "<MYIPADDR>" -> (known after apply)
~ access_public_ipv4 = "<MYIPADDR>" -> (known after apply)
~ access_public_ipv6 = "<MYIPADDR>" -> (known after apply)
~ created = "2022-04-19T23:40:41Z" -> (known after apply)
~ deployed_facility = "am6" -> (known after apply)
+ deployed_hardware_reservation_id = (known after apply) - facilities = [
- "am6",
] -> null
[sources.journal]
type = "journald"
[sinks.out]
type = "http"
uri = "https://localhost/"
inputs = ["journal"]
encoding.codec = "ndjson"
# Removing this line makes the panic go away:
encoding.only_fields = ["message", "timestamp", "host", "systemd_unit", "file"]
# Pull logs from journald
[sources.journal]
type = "journald"
# Rename "_SYSTEMD_UNIT" field from journald logs to "systemd_unit"
[transforms.journal_tidy]
type = "remap"
inputs = ["journal"]
source = '''
.systemd_unit = del(._SYSTEMD_UNIT)
$ python --version
Python 3.11.0a1
$ CGITB_FORMAT=html python repro_cgitb_not_emitting_headers_in_text_mode.py | head
<!--: spam
Content-Type: text/html
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
import cgitb
import os
format = os.environ.get("CGITB_FORMAT", "text")
cgitb.enable(format=format, display=0)
raise Exception("oh no")