Skip to content

Instantly share code, notes, and snippets.

View burghardt's full-sized avatar

Krzysztof Burghardt burghardt

View GitHub Profile
@burghardt
burghardt / test_wcsnrtombs.c
Created March 31, 2023 08:45
Test case for musl libc wcsnrtombs() vulnerability (CVE-2020-28928)
/*
* CVE-2020-28928 test case for musl libc wcsnrtombs() vulnerability
*
* Copyright (c) 2023 Krzysztof Burghardt
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@burghardt
burghardt / script_template.bash
Created March 24, 2023 11:53
GNU BASH script header template with more reasonable defaults for writing robust scripts
#!/usr/bin/env bash
set -x
set -euCo pipefail
IFS=$'\n\t'
@burghardt
burghardt / hosts2openwrt.py
Created March 3, 2019 23:29
Converts Un*x's /etc/ethers & /etc/hosts to OpenWRT's /etc/config/dhcp
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Converts /etc/ethers & /etc/hosts to OpenWRT's /etc/config/dhcp
#
# Copyright (C) 2019 Krzysztof Burghardt <krzysztof@burghardt.pl>
# License: CC-BY
#
ENTRY = """config host
@burghardt
burghardt / keybase.md
Created September 22, 2016 22:03
Keybase proof

Keybase proof

I hereby claim:

  • I am burghardt on github.
  • I am burghardt (https://keybase.io/burghardt) on keybase.
  • I have a public key whose fingerprint is 87E6 910B 80F0 4A13 16A5 63CE F1C3 AABC DB43 AF42

To claim this, I am signing this object:

@burghardt
burghardt / IdeaBankClient.py
Created October 7, 2014 06:16
IdeaBank overnight deposit automation
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2014, Krzysztof Burghardt <krzysztof@burghardt.pl>
# I, the copyright holder of this work, hereby publish it under
# the following licenses: GFDL, CC-BY-SA, GPL, 2BSD
import re
import sys
import cgi
import StringIO