Skip to content

Instantly share code, notes, and snippets.

@turing85
turing85 / Dockerfile
Last active December 8, 2025 11:20
Multistage dockerfile to install software into an UBI micro image
ARG MICRODIR=/microdir
ARG PACKAGES_TO_INSTALL="java-17-openjdk-devel"
FROM registry.access.redhat.com/ubi8-micro@sha256:eb4245271537034f69ee336a4a2b31d3fbae4048ec1db53ff89de749c35cf537 AS BASE
FROM registry.access.redhat.com/ubi8@sha256:83c0e63f5efb64cba26be647e93bf036b8d88b774f0726936c1b956424b1abf6 AS BUILD
ARG MICRODIR
ARG PACKAGES_TO_INSTALL
RUN mkdir ${MICRODIR}
COPY --from=BASE / ${MICRODIR}
@smontanaro
smontanaro / dusort.sh
Created November 7, 2022 11:01
I got this du postprocessing script from "the net" in the dark ages (probably from Usenet in the 80s or 90s). I have no idea who the original author was. I've never modified it **at all**. It has always just worked.
#!/bin/sh
#
# sort a "du" listing by directory size
# usage: du | dusort
FILES=
TFORM=0
while test $# -ge 1; do
case $1 in
-t) TFORM=1; ;;
@mislav
mislav / config.json
Last active February 26, 2026 15:02
Experiment in using GitHub CLI to authenticate fetching docker images from GitHub Package Registry
// ~/docker/config.json
{
"credsStore": "desktop",
"credHelpers": {
"docker.pkg.github.com": "gh",
"ghcr.io": "gh"
}
}
@nicknisi
nicknisi / new-worktree.sh
Created January 27, 2022 12:44
Create a new worktree, install dependencies, and run an initial build
#!/usr/bin/env bash
# This script should help facilitate setting up a new worktree, including:
# - creating a new worktree
# - installing dependencies
# - creating a new branch
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
@yokawasa
yokawasa / ghcr.md
Last active July 30, 2026 12:38
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@refo
refo / Disable Microsoft AutoUpdate on MacOS.md
Last active June 23, 2026 21:11
Disable Microsoft AutoUpdate on MacOS (Office 365 updater)

Following commands disables Microsoft AutoUpdate launch agent from launching at boot and periodicaly checking for updates.

sudo defaults write /Library/LaunchAgents/com.microsoft.update.agent.plist Disabled -bool YES
sudo defaults write /Library/LaunchAgents/com.microsoft.update.agent.plist RunAtLoad -bool NO
sudo chflags schg /Library/LaunchAgents/com.microsoft.update.agent.plist

source: https://forums.macrumors.com/threads/how-to-get-rid-of-microsoft-autoupdate.2231809/?post=28384662#post-28384662

@joshuaspence
joshuaspence / cloud.cfg
Created May 5, 2021 00:36
Default cloud-init configuration
# The top level settings are used as module
# and system configuration.
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
- default
# If this is set, 'root' will not be able to ssh in and they
@magnetikonline
magnetikonline / README.md
Last active March 13, 2026 20:37
Enable GitHub Dependabot for Golang based repositories.

Dependabot for Golang based repositories

Minimal YAML configuration for enabling Dependabot within a Golang based repository.

Place dependabot.yaml at .github/dependabot.yaml within a target repository and you should be good to go.

Configuration dependabot-grouped.yaml implements package grouping, in this example all packages related to AWS Golang SDK with updates will be rolled up into a single Dependabot pull request.

Reference

@mvanga
mvanga / music_theory.py
Last active February 27, 2026 13:14
Basic Music Theory in ~200 Lines of Python
# The code for my article with the same name. You can find it at the URL below:
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python
# MIT License
#
# Copyright (c) 2021 Manohar Vanga
#
# 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
@andreswebs
andreswebs / golang-dockerfile-from-scratch.md
Created December 15, 2020 02:19
Example Dockerfile for a non-privileged Go application `FROM scratch`

Golang Dockerfile FROM scratch

FROM golang:alpine as builder
RUN \
  mkdir /build && \
  echo "app:x:10001:10001:app:/app:/bin/false" > /app-user && \
  echo "app:x:10001:" > /app-group
COPY src/* /build/
WORKDIR /build