Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Wood awood

  • Red Hat
  • Raleigh, NC
View GitHub Profile
@awood
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)
break
fi
@awood
awood / reader.py
Last active Apr 4, 2016
ASN1 Reader that examines X509 certificates for extensions under OID 1.3.6.1.4.1.2312
View reader.py
#! /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
try:
@awood
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"`
LC_IDENTIFICATION
title "English locale for the USA"
source "Free Software Foundation, Inc."
View keybase.md

Keybase proof

I hereby claim:

  • I am awood on github.
  • I am awood (https://keybase.io/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
awood / tar_fixer.py
Created May 15, 2015
A Python class to give tarballs created by git-archive from tree references a consistent hash value.
View tar_fixer.py
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
import re
import struct
import sys
@awood
awood / awood.asc
Created Mar 13, 2015
My public key
View awood.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFT/V8wBEADFTEasiDcGrCBjVxtF06zZ7gRYcHA9/Cn92EOVNA/q9zoB3EEc
PtBYX1jA6GgdRiE2hcoDCwBx5ya6qz90JC3FHn8b+lQupLTG2EUNcyKNHQjc+i0N
JD8hYIhueKMEJPiPrvPLWkAFqofTZLAamdju41hCMXpFMOXQyfXgijmjRmaamH+7
xP5lyEt59umyRqftJUFew9hTOEjP+rWQaSlyN3Q9BEG9L0FlkFM2mv8z6O25t083
cNgI3sYN7mNK1a5IRilHzLJx8txSxSgjsPIFQcOJ+J0CZ+jXndHrM3fgwT4SLsQf
O9E0MJsgRQY7Ry2OHDwfiT5s7KffCnfypyY4kjErJ4v/gT9+F9UksKufnOpOLSF7
M/0w9IBtMy8wP+mmT6sp4s+z98EtyIQLwsmxrkPtcjMnKKUQuY73gX17FFEMS/K9
@awood
awood / logging.properties
Last active May 2, 2022
Non-rotating Tomcat logging.
View logging.properties
# 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: http://stackoverflow.com/questions/4511845
# My solution was slightly different though. I set "rotatable" to false, but instead of
# adding a "suffix" option in /etc/tomcat/logging.properties, I just changed the "prefix" option to
# remove the period.
@awood
awood / eclipse_conf.md
Last active Jul 23, 2020
XML configuration for integrating Flake8 with the Eclipse GrepConsole plugin.
View eclipse_conf.md

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
awood / README.md
Last active Aug 29, 2015
Zsh function to run repoquery against mock configs
View README.md

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

fpath=( ~/.zfunc "${fpath[@]}" )
autoload -Uz mock-repoquery
@awood
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 http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height
.column-rules(@type) {
.container-@{type}-height {
display: table;
padding-left: 0px;
padding-right: 0px;
}
.row-@{type}-height {