Skip to content

Instantly share code, notes, and snippets.

View awood's full-sized avatar

Alex Wood awood

  • Red Hat
  • Raleigh, NC
View GitHub Profile
@awood
awood / podman-intellij.md
Created April 19, 2023 17:29
Connecting Intellij to Podman

IntelliJ has support for working with Podman but there are some hoops you need to jump through first. The first obstacle is getting the podman API up and running continually. Normally the API is only up while needed and then shuts down. You can change this by creating a local systemd unit file that starts the API server for you when you log in. Here's the unit file:

[Unit]
Description=Podman API Service for IntelliJ
Documentation=man:podman-system-service(1)
StartLimitIntervalSec=0

[Service]
Type=exec
@awood
awood / gradleup
Created June 3, 2019 15:35
Zsh function to find gradlew by going up through parent directories
#! /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 April 4, 2016 19:44
ASN1 Reader that examines X509 certificates for extensions under OID 1.3.6.1.4.1.2312
#! /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 July 2, 2015 14:31
Locale file for USA but using 24-hour time
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."
@awood
awood / keybase.md
Created June 1, 2015 15:54
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 13:51
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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
import re
import struct
import sys
@awood
awood / awood.asc
Created March 13, 2015 13:55
My public key
-----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 09:54
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: 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 July 23, 2020 16:10
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
awood / README.md
Last active August 29, 2015 14:00
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