Skip to content

Instantly share code, notes, and snippets.

View kth5's full-sized avatar

Alexander Baldeck kth5

View GitHub Profile
@kth5
kth5 / nginx.conf - server block
Last active March 28, 2024 12:05
Nexus OSS & npm audit with nginx
Have private npm registry and proxying through registry.npmjs.org with Nexus? Still want to be able to transparently `npm audit`?
This might help.
```
server {
listen 443 ssl http2;
server_name nginx.some.domain;
@kth5
kth5 / milkv-pioneer-fan-control.md
Created January 9, 2024 08:29
Milk-V Pioneer fan control

DRAFT status

This is very much a draft still as I go along. Everything in here is subhect to change heavily, could be wrong and your mileage may vary greatly.

Everything here assumes native build on Arch POWER riscv64.

This is probably broken in some way but works for me.

#!/bin/bash
@kth5
kth5 / sophgo_pioneer_fw_building.md
Last active January 9, 2024 12:53
Sopho 2042 / Milk-V Pioneer firmware build intructions

DRAFT status

This is very much a draft still as I go along. Everything in here is subhect to change heavily, could be wrong and your mileage may vary greatly.

Everything here assumes native building on Arch POWER.

Prerequisites

This gets a compatible GCC 13.2.1+patches & Binutils 2.41+patches along with newlib 4.1.0.

@kth5
kth5 / gist:728ef3fc3661c2066d22287eb56adc6e
Last active December 11, 2022 00:07
Simple script to find binaries and shared objects missing direct linked libraries (readelf vs ldd) with pacman support
#!/bin/bash
SOLIBS=$(find /usr/lib -maxdepth 1 -type f -name "*.so.*")
BINS=$(find /usr/bin -maxdepth 1 -type f)
for file in ${SOLIBS[@]} ${BINS[@]}; do
sobump=0
for solib in $(readelf -d ${file} 2>&1 | grep NEEDED | awk '{print $5}' | sed -e 's@\[@@g' -e 's@\]@@g' | sort -u); do
if [ ! -f /usr/lib/${solib} -a ! -f /usr/lib/*/${solib} ]; then
pkg=$(pacman -Qqo ${file})
@kth5
kth5 / Graylog AMQ Input Content Pack
Last active April 28, 2022 09:48
Graylog - Application controlled timestamp with override allowed enabled (tested w/ Graylog >=3.1.4)
{
"v": 1,
"id": "7a8b396e-e9b9-40c1-97ea-a60ebbb58e62",
"rev": 1,
"name": "Graylog - Custom Timestamp ",
"summary": "Application controlled timestamp",
"description": "This allows the application to log a time that Graylog will then reflect in its native timestamp field. This is great for sorting and the like.\n\nThe advantage of doing it this way is that we can leave the override enabled on the extractor should the actual timestamp in the message not be parseable, yet preserve the timestamp provided should it become necessary. Just swicth from Cut to Copy.",
"vendor": "kth5",
"url": "https://github.com/kth5",
"parameters": [],