Skip to content

Instantly share code, notes, and snippets.

View chabala's full-sized avatar
👹
at large

Greg Chabala chabala

👹
at large
View GitHub Profile
@chabala
chabala / docker-architecture-check.md
Created April 22, 2023 22:31
Check Docker detected system architecture

Check system arch:

$ arch
armv7l

Check docker info:

$ docker info 2>/dev/null |grep 'OSType:\|Arch'
 OSType: linux
 Architecture: armv7l
@chabala
chabala / java-ee-application-server.md
Created September 26, 2022 02:11
java-ee-application-server

what if your application server ... was just an embedded jetty

Wrap your head around that.

@chabala
chabala / code.py
Last active February 25, 2022 18:16 — forked from anecdata/code.py
Test code for WIZnet W5100S-EVB-Pico
import board
import busio
import digitalio
import time
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
import adafruit_wiznet5k.adafruit_wiznet5k_socket as socket
import adafruit_requests as requests
SPI0_SCK = board.GP18
SPI0_TX = board.GP19
@chabala
chabala / using-google-takeout.md
Last active April 21, 2024 06:49
Merge and extract tgz files from Google Takeout

Recently found some clowny gist was the top result for 'google takeout multiple tgz', where it was using two bash scripts to extract all the tgz files and then merge them together. Don't do that. Use brace expansion, cat the TGZs, and extract:

$ cat takeout-20201023T123551Z-{001..011}.tgz | tar xzivf -

You don't even need to use brace expansion. Globbing will order the files numerically:

$ cat takeout-20201023T123551Z-*.tgz | tar xzivf -
@chabala
chabala / add-album-art.sh
Last active November 18, 2017 23:04
add album art to audio files
#!/usr/bin/env bash
set -o errexit
set -o nounset
if ! [ -x "$(command -v eyeD3)" ]; then
sudo apt install eyed3
fi
audio="${1}"
image="${2}"
eyeD3 --add-image "${image}:FRONT_COVER" "${audio}"

Keybase proof

I hereby claim:

  • I am chabala on github.
  • I am chabala (https://keybase.io/chabala) on keybase.
  • I have a public key ASBf93uOopbg3PFANShXf0dB2Axuv7jqwTV4S1eI8Dv6Xwo

To claim this, I am signing this object:

@chabala
chabala / surround.xml
Created March 17, 2017 19:34
IntelliJ IDEA Live Templates for working with ScalaTest
<templateSet group="surround">
<template name="desc" value="describe(&quot;$END$&quot;) {&#10; $SELECTION$&#10;}&#10;" description="Surround with describe block" toReformat="true" toShortenFQNames="true">
<context>
<option name="SCALA_STRING" value="false" />
<option name="SCALA_COMMENT" value="false" />
<option name="SCALA_XML" value="false" />
<option name="SCALA" value="true" />
</context>
</template>
<template name="it" value="it(&quot;should $END$&quot;) {&#10; $SELECTION$&#10;}&#10;" description="Surround with it block" toReformat="true" toShortenFQNames="true">
@chabala
chabala / InstallCert.java
Created February 22, 2017 21:31
Useful for dealing with SSL certificates
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@chabala
chabala / clearMergedNotifications.sh
Last active October 24, 2016 22:10
Clear notifications for merged PRs on GitHub
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o xtrace
#requires curl and jq
auth="Authorization: token YOUR_SECRET_OAuth_TOKEN"
declare -i pages
@chabala
chabala / oracle.sh
Created July 7, 2016 14:57
/etc/profile.d/oracle.sh
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export TNS_ADMIN=$ORACLE_HOME/network/admin