Skip to content

Instantly share code, notes, and snippets.

View jflemer-ndp's full-sized avatar

James E. Flemer jflemer-ndp

  • NDP, LLC.
  • Boulder, CO
View GitHub Profile
@jflemer-ndp
jflemer-ndp / git-rpm-changelog.sh
Last active February 3, 2024 02:08
generate a rpm spec compatible changelog from git history
#!/bin/bash
merge_commit() {
git show --no-patch --format='%P' "$@" | head -1 | grep -q ' '
}
commit_meta() {
git show --no-patch --format="* %cd %aN <%ae> - %H" --date=local "$@" | \
head -1 | \
sed -E 's/^(\* [a-z0-9 ]{9,10}) \d{2}:\d{2}:\d{2}/\1/i'
@jflemer-ndp
jflemer-ndp / rpmgpgsign.sh
Created September 24, 2020 18:45
Wrapper for non-interactive signing of RPMs
#!/bin/bash
##############################################################################
# Wrapper for non-interactive signing of RPMs.
#
# _NOTE: This uses environment variables for sensitive information (the GPG
# passphrase), so should not be used on an untrusted or shared host._
#
# Prep
# ----
@jflemer-ndp
jflemer-ndp / unload-nouveau.sh
Created October 20, 2019 22:56
Unload the nouveau driver
#!/bin/sh
#
# Try very hard to unload Nouveau driver. Tested on RHEL 7.7 in a
# systemd context. Run this before trying to install the NVIDIA
# driver.
#
# Inspired by https://gist.github.com/davispuh/84674924dff1db3e7844
#
# ---
#
@jflemer-ndp
jflemer-ndp / doxy-filter-proto.pl
Created July 12, 2021 15:34
Doxygen filter for Google Protocol Buffers (protobuf, GPB)
#!/usr/bin/env perl
##############################################################################
#
# Copyright 2021, NDP LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
@jflemer-ndp
jflemer-ndp / Doxyfile
Created May 22, 2021 05:04
Reverse engineering / external code exploration starting point with Doxygen
# ########################################################################## #
# ################################## NOTE ################################## #
# ########################################################################## #
# ########################################################################## #
# #
# This Doxyfile is a good starting place for reverse engineering an #
# external code base. You probably do not want to use this for actual #
# product or API document generation. #
# #
# ########################################################################## #
#!/bin/sh
##############################################################################
# Generate a version string based on tags in the current git repo.
#
# Usage
# -----
#
# git-version.sh VERSION
#
@jflemer-ndp
jflemer-ndp / checkheader.sh
Last active October 5, 2020 16:19
Check a c/c++ header by itself
#!/bin/sh
##############################################################################
# Test a C/C++ header file for standalone validity. This will help show if
# there are missing/implicit headers etc.
#
# Usage
# -----
# checkheader.sh foo.h ...
#
@jflemer-ndp
jflemer-ndp / poise-python_maintainer.eml
Last active April 16, 2020 16:00
Open source let down
Subject: Re: poise-python maintainer
To: James Flemer <james.flemer@ndpgroup.com>
From: Noah Kantrowitz <noah@coderanger.net>
Date: Fri, 12 Jul 2019 12:21:21 -0700
To put it more bluntly: 1) I don't believe you can maintain it 2) I have
no reason to trust you.
It has nothing to do with being an open-source proponent, it's about
responsibility to end users. Sometimes to best thing to do is let things
#!/bin/bash
# test each redhat subscription key against a given (repo) url
if [ -z "$1" ]; then
echo "usage: $0 <url>"
echo ""
echo "example:"
echo " $0 'https://cdn.redhat.com/content/dist/rhel/server/7/\$releasever/\$basearch/os/repodata/repomd.xml'"
exit 1
@jflemer-ndp
jflemer-ndp / createpypirepo.py
Last active July 13, 2019 06:43
Make a PEP503 simple python pypi repo
#!/usr/bin/env python
# Copyright 2019, NDP LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#