Skip to content

Instantly share code, notes, and snippets.

View andy5995's full-sized avatar

Andy Alt andy5995

View GitHub Profile
@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
# remove ' man' from Makefile.am if the line begins with SUBDIRS
sed -i '/^SUBDIRS/s/\ man//' Makefile.am
@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)))
@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 / menucd
Last active January 31, 2023 20:00
moved to https://github.com/andy5995/menucd
@andy5995
andy5995 / gist:e011c493d4839620e70e2aab77f7f0c1
Created January 14, 2023 17:09
Docker: remove dangling images
docker images -q -f dangling=true | xargs docker rmi
/**
* mkdir_with_parents()
*
* Check for the existence of a dir, and create it if not found.
* Also creates parent directories.
*/
int mkdir_with_parents (const char *dir, mode_t mode)
{
if (exists (dir))
return 0;
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by kmod configure 26, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --prefix=/home/andy/Downloads/tmp/kmod-26/tmp/kmod/test
## --------- ##
## Platform. ##
make --no-print-directory install-exec-hook
if test "/home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib" != "/home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib"; then \
/bin/mkdir -p /home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib && \
so_img_name=$(readlink /home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib/libkmod.so) && \
so_img_rel_target_prefix=$(echo /home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
ln -sf $so_img_rel_target_prefix/home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib/$so_img_name /home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib/libkmod.so && \
mv /home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib/libkmod.so.* /home/andy/Downloads/tmp/kmod-26/tmp/kmod/test/lib; \
fi
/bin/mkdir -p '/usr/share/bash-completion/completions'
/usr/bin/install -c -m 644 shell-completion/bash/kmod '/usr/share/bash-completion/completions'
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of