Skip to content

Instantly share code, notes, and snippets.

View timhughes's full-sized avatar

Tim Hughes timhughes

View GitHub Profile
@timhughes
timhughes / podman-docker-compat.md
Last active November 2, 2021 01:03
Docker service for Podman

Replacing docker with Podman

This is all done as a user.

Add insecure registry if you need to use something internal

cat <<EOF> ~/.config/containers/registries.conf
unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "registry.centos.org", "docker.io"]

[[registry]]

@timhughes
timhughes / goldfishweb.py
Last active April 15, 2021 16:24
Micropython basic webserver example
import re
import gc
import logging
import micropython
try:
import ujson as json
except ImportError:
import json
try:
@timhughes
timhughes / Makefile
Last active April 21, 2025 14:09
Python Makefile
#
# vim:ft=make
# Makefile
#
#
# For bash autocomplete add to `~/.bashrc`:
#
# complete -W "\`if [ -f Makefile ]; then grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'; elif [ -f makefile ]; then grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' makefile | sed 's/[^a-zA-Z0-9_-]*$//'; fi \`" make
.DEFAULT_GOAL := help
@timhughes
timhughes / kubernetes_one_liners.md
Last active August 28, 2020 11:59
Kubernetes One Liners
  • get everything in default namespace or remove --namespaced for absolutly everything
kubectl get $(kubectl api-resources --verbs=list --namespaced -o name | xargs |sed 's/ /,/g')
@timhughes
timhughes / firefox_nytimes_fix.md
Last active August 20, 2020 12:16
Fix New York Times website in Firefox
Get a kernel and the dtb files from
https://www.raspberrypi.org/downloads/raspberry-pi-os/
https://github.com/dhruvvyas90/qemu-rpi-kernel
sudo qemu-system-arm -kernel kernel-qemu-4.19.50-buster -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 console=ttyAMA0" -hda raspbian-buster-lite.qcow2 -dtb versatile-pb-buster.dtb -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
@timhughes
timhughes / pynetcat.py
Created June 18, 2020 18:13
oneliner python netcat style listening socket server for when nc is not available
python -uc "import sys, socket;from functools import partial; a = socket.create_server(('0.0.0.0', 8888)).accept(); [sys.stdout.buffer.write(bytes(i)) for i in iter(partial(a[0].recv, 1024), b'')]"
@timhughes
timhughes / bootstrap_cmdline.py
Created June 15, 2020 15:23 — forked from elmotec/bootstrap_cmdline.py
Minimal python program with logging and argparse.
#!/usr/bin/env python
# encoding: utf-8
"""Minimal python commad line."""
import sys
import argparse
import logging
@timhughes
timhughes / minio_sts_ldap.py
Created April 24, 2020 16:11
Minio STS LDAP authentication using python
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 Tim Hughes <thughes@thegoldfish.org>
#
# Distributed under terms of the MIT license.
"""