Skip to content

Instantly share code, notes, and snippets.

View txbm's full-sized avatar

Peter M. Elias txbm

  • Austin, TX
View GitHub Profile
@txbm
txbm / pem-chain-to-pfx
Created December 25, 2021 04:07
openssl scripts
#!/usr/bin/env bash
_out_ext=${1#*.}
_out_ext=${_out_ext%%.*}
_out="${1%%.*}-chain.${_out_ext}.pfx"
_crtfile=combined.crt.pem
# _cmd="openssl pkcs12 -export -keypbe NONE -certpbe NONE -nomaciter -passout pass: -out ${_out} -inkey ${2} -in ${1} -certfile ${_crtfile}"
_cmd="openssl pkcs12 -export -passout pass: -out ${_out} -inkey ${2} -in ${1} -certfile ${_crtfile}"
import io.micronaut.data.annotation.MappedEntity;
import io.micronaut.data.annotation.Id;
import io.micronaut.data.annotation.GeneratedValue;
@MappedEntity(value = "hellos")
public class HelloEntity {
@Id
@GeneratedValue
private Long id;
@txbm
txbm / noderdkafka-consumer-state.js
Last active February 1, 2018 19:27
noderdkafka state test harness
'use strict';
const kafka = require('node-rdkafka');
const { CODES: { ERRORS: {
ERR__ASSIGN_PARTITIONS,
ERR__REVOKE_PARTITIONS
}}} = kafka;
const clientId = 'pelias-test-client';
const groupId = 'pelias-test-cg';
@txbm
txbm / uber_walker.py
Last active December 26, 2015 12:09
The Uber Grapher. This is a demonstration of one way to recursively traverse an arbitrary nested data structure that contains primitive types as well as inter-connected objects. I found that combining the two into a single solution had some subtle "gotchas", so I figured I'd release it just in case. Do keep in mind that the algorithm requires so…
# The MIT License (MIT)
# Copyright (c) 2013 Peter M. Elias
# 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
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: