Skip to content

Instantly share code, notes, and snippets.


Alex Wood awood

  • Red Hat
  • Raleigh, NC
View GitHub Profile
awood / gradleup
Created Jun 3, 2019
Zsh function to find gradlew by going up through parent directories
View gradleup
#! /bin/zsh
gradleup() {
local curdir="$PWD"
while [[ "`pwd`" != "$HOME" && "`pwd`" != '/' ]]; do
if [[ -e gradlew ]]; then
local result=$(realpath ./gradlew)
awood /
Last active Apr 4, 2016
ASN1 Reader that examines X509 certificates for extensions under OID
#! /usr/bin/env python3
import sys
import base64
import binascii
import re
from pyasn1.type import univ, namedtype, tag, constraint, namedval
from pyasn1.codec.der import decoder
awood / en_24
Created Jul 2, 2015
Locale file for USA but using 24-hour time
View en_24
escape_char /
comment_char %
% Locale for English locale in the USA
% Compile this with `localedef -f UTF-8 -i en_24 en_24.UTF-8`
% Then set the system to use it with `localectl set-locale "LC_TIME=en_24.UTF-8"`
title "English locale for the USA"
source "Free Software Foundation, Inc."

Keybase proof

I hereby claim:

  • I am awood on github.
  • I am awood ( on keybase.
  • I have a public key whose fingerprint is 95BC 3319 CC7A DA09 7D9A F4C6 298D 1D54 9977 9B18

To claim this, I am signing this object:

awood /
Created May 15, 2015
A Python class to give tarballs created by git-archive from tree references a consistent hash value.
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
import re
import struct
import sys
awood / awood.asc
Created Mar 13, 2015
My public key
View awood.asc
Version: GnuPG v1
awood /
Last active May 2, 2022
Non-rotating Tomcat logging.
# In Fedora 20, Tomcat 7 has an annoying habit of creating log files that are named
# "catalina.YYYY-MM-DD.out" with the day's date filled in the file name. It is a pain in
# the neck to have to remember the date every time I want to look at the log file and
# tab completion doesn't help because it will only complete as far as the most common
# string which in the case of the date is usually the year.
# StackOverflow to the rescue:
# My solution was slightly different though. I set "rotatable" to false, but instead of
# adding a "suffix" option in /etc/tomcat/, I just changed the "prefix" option to
# remove the period.
awood /
Last active Jul 23, 2020
XML configuration for integrating Flake8 with the Eclipse GrepConsole plugin.

In the Eclipse External Tool Configuration window, I set Flake8 up as follows:

  • Location: /usr/bin/flake8
  • Working Directory: empty
  • Arguments: --format="%(code)s %(text)s [%(path)s:%(row)d:%(col)d]" ${project_loc}

With this Flake8 format, the information about the error is printed first and the location second.

I could not figure out a way to get Eclipse to print a proper relative directory (Even using ${resource_path} printed a leading slash). Nor could I figure out how to get GrepConsole's base directory setting to read from an Eclipse variable. The result with the default Flake 8 format was that in order for everything to work, I had to use absolute path names which crowded all the useful information out of the immediately visible portion of the console. With the custom format, the interesting stuff comes first and the dross is at the end.

awood /
Last active Aug 29, 2015
Zsh function to run repoquery against mock configs

Drop mock-repoquery in the ~/.zfunc directory and add the following to your ~/.zshrc:

fpath=( ~/.zfunc "${fpath[@]}" )
autoload -Uz mock-repoquery
awood / responsive-columns.less
Created Apr 24, 2014
A simple LESS style sheet that you can use in Bootstrap 3 to create columns of uniform height.
View responsive-columns.less
// Courtesy of
.column-rules(@type) {
.container-@{type}-height {
display: table;
padding-left: 0px;
padding-right: 0px;
.row-@{type}-height {