Skip to content

Instantly share code, notes, and snippets.

View msterhuj's full-sized avatar
💾
findings

Gabin L msterhuj

💾
findings
View GitHub Profile
@msterhuj
msterhuj / radius_calculation.py
Created January 23, 2024 16:23
calculate the number of block to reduce based on days and required size
start_day = 5
finish_day = 10
start_radius = 6100
finish_radius = 250
def calculate_radius(day):
blocks_to_reduce_per_day = (start_radius - finish_radius) / (finish_day - start_day)
if day < start_day:
return start_radius
reduse = start_radius - blocks_to_reduce_per_day * (day - start_day)
@msterhuj
msterhuj / grok_mikrotik_firewall_topic.md
Last active November 8, 2024 14:16
GROK MikroTik topic Firewall syslog

Befor add a prefix to your firewall filter

/ip firewall filter add chain=forward action=drop log=yes log-prefix="DROP"

And create a pipline with this grok on the field message

%{WORD:firewall.network.action} %{WORD:firewall.network.chain}: in:%{DATA:firewall.network.in_interface} out:%{DATA:firewall.network.out_interface}, connection-state:%{DATA:firewall.network.connection_state} src-mac %{MAC:firewall.source.mac}, proto %{DATA:firewall.network.protocol}, %{IPV4:firewall.source.ip}(?::%{NUMBER:firewall.source.port})?->%{IPV4:firewall.destination.ip}(?::%{NUMBER:firewall.destination.port})?, len %{NUMBER:firewall.network.bytes}
@msterhuj
msterhuj / install_openstack_exporter.sh
Created November 13, 2024 22:09
easy install openstack exporter
cd /tmp
wget https://github.com/openstack-exporter/openstack-exporter/releases/download/v1.7.0/openstack-exporter_1.7.0_linux_amd64.tar.gz
tar -xvf openstack-exporter_1.7.0_linux_amd64.tar.gz
mv openstack-exporter /usr/bin/
mkdir -p /etc/openstack-exporter
groupadd openstack-exporter
useradd -r -g openstack-exporter -d /etc/openstack-exporter -s /sbin/nologin openstack-exporter
chown -Rv openstack-exporter:openstack-exporter /etc/openstack-exporter
@msterhuj
msterhuj / Laboinfra_Root_CA_2024.pem
Created November 15, 2024 17:39
LaboInfra CA Pub
-----BEGIN CERTIFICATE-----
MIIGYzCCBEugAwIBAgIUaLkxUZlr4d5eJNWR/Go/FWTjoXgwDQYJKoZIhvcNAQEL
BQAwYDELMAkGA1UEBhMCRlIxDDAKBgNVBAgTA0lERjEOMAwGA1UEBxMFUGFyaXMx
EjAQBgNVBAoTCUxhYm9pbmZyYTEfMB0GA1UEAxMWTGFib2luZnJhIFJvb3QgQ0Eg
MjAyNDAeFw0yNDA0MjExODE1MzhaFw0zNDA0MTkxODE1NTlaMGAxCzAJBgNVBAYT
AkZSMQwwCgYDVQQIEwNJREYxDjAMBgNVBAcTBVBhcmlzMRIwEAYDVQQKEwlMYWJv
aW5mcmExHzAdBgNVBAMTFkxhYm9pbmZyYSBSb290IENBIDIwMjQwggIiMA0GCSqG
SIb3DQEBAQUAA4ICDwAwggIKAoICAQDAKlTOA2UDbyfAtU+LEElJThKzsQ2MZYN8
00efjWwtWn5FFDgd8o/mGIrK+jWsINOPQfW7Dhrr1NGqtOl3GYdwC65d3GtHU19R
AwWEESHevkX5Dd65620u3XrHZUjKa6qlNFj/QIex9IXT2ce4iv+f4I+hXxjPlmUw
@msterhuj
msterhuj / compose.yml
Created April 9, 2025 08:01
Ollama with nvidia gpu and openwebui with ssl
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock