Skip to content

Instantly share code, notes, and snippets.

@m9aertner
m9aertner / pgxscat.py
Created May 22, 2022 22:12
Script to concatenate segments from two or more GPX files.
#!/usr/bin/env python
"""
Script to concatenate segments from two or more GPX files.
First file should be a "template", with a <trk> but no <trkseg>.
Subsequent files (one or more) should carry the segments.
Requires lxml for XML parsing. Pretty-print does not work 100%,
pipe through xmllint --format - for pretty-printed result.
"""
@m9aertner
m9aertner / gist:dc772104605ab17767394c0c55b48551
Created August 28, 2021 00:30
TeensyLC : output integer to 8x7-segment MAX7219 LED display, with no leading zeroes
// TeensyLC MAX7219 7-Segment Sample.
// https://www.pjrc.com/teensy/td_libs_LedControl.html
#include <Arduino.h>
#include <LedControl.h>
/*
* Inputs: DIN pin, CLK pin, LOAD pin, number of digits
*
* Note: one MAX7219 chip drives 8x8 LEDs. With a 7-segment
@m9aertner
m9aertner / ec-codebase.sh
Created March 18, 2021 18:56
Quick script that applies editorconfig-checker to our code base, with per-file good/bad output, one per line
#!/bin/bash
#
# Checking files for .editorconfig compliance
#
# For use with https://github.com/editorconfig-checker/editorconfig-checker
#
# Default output shows non-compliant files on stderr
# Verbose output also shows compliant files, on stdout.
# Quiet mode suppresses output of non-compliant file names, but still checks and counts.
# File can come from the command line, via stdin (say "-"), from a files list (--files)
@m9aertner
m9aertner / veracode-api-access-curl.markdown
Created June 8, 2018 16:54
Using curl and openssl to access the Veracode API endpoint

Using curl and openssl to access the Veracode API endpoint

You can make requests to the Veracode service by sending an HMAC signature in the HTTP authorization header.

The mechanism is discussed on "Understanding API Access" https://help.veracode.com/reader/lsoDk5r2cv~YrwLQSI7lfw/H0S3580tt9sPFz3IgSMvnA with a Java program as illustration. For an API wrapper in GO, see https://github.com/brian1917/vcodeHMAC.

For illustration and plain shell scripting on the command line, it's possible to compute the Authorization header using openssl. Here's how: