Skip to content

Instantly share code, notes, and snippets.

View andy5995's full-sized avatar

Andy Alt andy5995

View GitHub Profile
@andy5995
andy5995 / ci.yml
Created February 3, 2023 06:33
GitHub Actions Matrix example using containers
# From https://github.com/altendky/alqtendpy/blob/b375b1d9189f125828fdabbf2d329e5b1d04ff21/.github/workflows/ci.yml
name: CI
on:
push:
branches:
- master
tags:
- v*
@andy5995
andy5995 / gist:89a53cde95a50b93ffce3cd1f57fc357
Created February 4, 2023 05:38
Check for supported compiler flags in a Makefile
Minor adaptation of example at https://stackoverflow.com/a/61634784/6838037
CHECK_CC_FLAGS := -Wall -Wextra -I. --std=gnu89 -fPIC -flto=auto
define check_cc_flag
$(shell echo 'int main() { return 0; }' | $(CC) $(1) -xc - 2>/dev/null && echo $(1))
endef
HAVE_FLAGS += $(foreach flag,$(CHECK_CC_FLAGS),$(call check_cc_flag,$(flag)))
# remove ' man' from Makefile.am if the line begins with SUBDIRS
sed -i '/^SUBDIRS/s/\ man//' Makefile.am
@andy5995
andy5995 / Dockerfile
Created February 27, 2023 03:40 — forked from lmorchard/Dockerfile
Dockerfile extending bbsio/synchronet to add DOSEMU
FROM bbsio/synchronet:latest
ARG DOSEMU_DEB_URL=http://ftp.us.debian.org/debian/pool/contrib/d/dosemu/dosemu_1.4.0.7+20130105+b028d3f-2+b1_amd64.deb
ARG DOSEMU_DEB=dosemu_1.4.0.7+20130105+b028d3f-2+b1_amd64.deb
RUN apt-get update \
&& apt-get install -y rsh-redone-client locales locales-all \
mtools dosfstools dos2unix ser2net socat
ENV USER=root LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8
@andy5995
andy5995 / gist:fcbb02ec5785fefb6104f94a6911625f
Created May 29, 2025 08:07
Change prompt to show git branch
# ~/.bashrc
show_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if ${use_color} ; then
...
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '