Skip to content

Instantly share code, notes, and snippets.

View mattyclarkson's full-sized avatar

Matt Clarkson mattyclarkson

View GitHub Profile
@mattyclarkson
mattyclarkson / template.sh
Created November 29, 2019 18:09
POSIX sh boilerplate
#!/bin/sh
# # The MIT License (MIT)
#
# Copyright © 2019 **Tub Technology** _<licence@tub.technology>_
#
# 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,
@mattyclarkson
mattyclarkson / change-id.js
Created January 26, 2021 15:12
A husky hook to add `Change-Id` to commit messages
/*
"husky": {
"hooks": {
"commit-msg": "node change-id.js -E HUSKY_GIT_PARAMS"
}
},
*/
const [,, arg, key] = process.argv
@mattyclarkson
mattyclarkson / download.py
Created January 7, 2022 12:13
A Python download script for downloading, verifying and unpacking an archive.
#!/usr/bin/env python3
from __future__ import annotations
import hashlib
import tarfile
from inspect import signature
from logging import getLogger, Logger, basicConfig
from binascii import hexlify
@mattyclarkson
mattyclarkson / safe-directory.sh
Last active June 15, 2022 10:25
A shell script to add `safe.directory` to a `.gitconfig`
#!/bin/sh
# Usage: ./safe-directory.sh directory [.gitconfig] [dst]
#
# `git` will throw permission errors when a repository has been cloned with a
# user different to the runtime user. This script allows adding the cloned
# repository to the `safe.directory` configuration variable without the need
# for an installed `git` binary.
#
# This can be useful on CI runners, when the repository has been cloned as the
# `root` user but the build runs inside a container that has a user different
@mattyclarkson
mattyclarkson / 0001-autoconf-2.71-make-binaries-relocatable.patch
Created October 14, 2022 16:46
A patch for making autoconf 2.71 relocatable. It uses absolute paths in each of the binary scripts. This uses Perl `FindBin::Bin` to use relative paths.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Matt Clarkson <redacted@noware.com>
Date: Wed, 1 Jan 3000 00:00:00 +0000
Subject: [PATCH] refactor: make binaries relocatable
Uses the binary locations and relative paths to the
package data directory to avoid having absolute paths
baked into the binary scripts.
---
Makefile.in | 2 ++
@mattyclarkson
mattyclarkson / 0001-automake-1.16.5-relocatable
Created October 17, 2022 15:12
A patch to make Automake 1.16.5 relocatable which is especially useful for Conan packaging.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Matthew Clarkson <redacted@noware.com>
Date: Wed, 1 Jan 3000 00:00:00 +0000
Subject: [PATCH] Make scripts relocatable
---
Makefile.in | 2 ++
bin/aclocal.in | 7 ++++---
bin/automake.in | 3 ++-
lib/Automake/Config.in | 3 ++-