Skip to content

Instantly share code, notes, and snippets.

View ties's full-sized avatar

Ties de Kock ties

  • The Netherlands
View GitHub Profile
#
# Lenovo Throttle Fix configuration for my HP Zbook Studio G5
# (undervolt settings are motherboard dependent and will likely not
# apply to your system.)
#
# Fixes the 15W/35W throttling issue in Linux :)
#
[GENERAL]
# Enable or disable the script execution
Enabled: True
@ties
ties / routinator-grafana-prometheus-dashboard.json
Created January 12, 2020 16:25
Routinator dashboard for Grafana with Prometheus as datasource
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@ties
ties / gist:1424374
Created December 2, 2011 18:51
pcap/dpkt example that dumps (some) http request headers
#!/usr/bin/env python
import dpkt, pcap, socket
from ipaddr import IPv4Address, IPv6Address
import syslog
class HTTPRequest():
def __init__(self, host, uri, ip = None, user_agent = None):
self.uri = uri
self.user_agent = user_agent
self.host = host
import argparse
import itertools
import json
import logging
import os
import random
import time
from typing import Dict, List, Optional, Union
version: '3'
#
# Config for powerdns is saved in /opt/powerdns/
#
# Take pdns.conf from https://raw.githubusercontent.com/psi-4ward/docker-powerdns/master/pdns.conf
# and create /opt/powerdns/pdns/conf.d/api.conf with
#
# api=yes
# api-key=6d238bb754ffe84d9b1fdc967cb16a546ea7a32cdd2438497912137440bd0c75
# webserver-address=0.0.0.0
import argparse
import logging
import os
import requests
import sys
import urllib.parse
from typing import Optional
import pyotp
@ties
ties / rpki-client.sh
Created May 14, 2021 08:52
rpki-client: run looped
#!/bin/ksh
export BASE=${HOME}
echo "Removing cache and output directory..."
rm -rf ${BASE}/data/rpki-client/cache/*
rm -rf ${BASE}/data/rpki-client/output/*
echo "Running rpki-client"
exec /usr/sbin/rpki-client -vv -t /etc/rpki/ripe.tal -d ${BASE}/data/rpki-client/cache/ ${BASE}/data/rpki-client/output/
@ties
ties / run-intellij-remotely-in-flatpak.md
Last active April 26, 2021 09:50
IntelliJ community idea flatpak over remote X11

Run IntelliJ community edition flatpak over remote X11

Make sure you run XQuartz if you are using a mac and that DISPLAY is set on the host machine.

$ export DISPLAY=:0

And SSH to the target machine with forwarding enabled (ssh -Y [host]) Inspect the environment by running:

$ flatpak run --filesystem=~/.xauth com.jetbrains.IntelliJ-IDEA-Community --command=sh -c "export DISPLAY=$DISPLAY"
@ties
ties / docker-compose.yml
Last active April 9, 2021 19:27
Time machine with docker and samba, even on big sur. Three parts: docker-compose file, time machine config snippet (for in docker volume), and avahi service
# ...
samba:
image: dperson/samba
restart: unless-stopped
command: >-
-u "user;badpass"
-u "timemachine_rmbp;${TIMEMACHINE_RMBP_PASSWORD}"
-s "data;/media/data;yes;yes;yes;all"
ports:
- 139:139