Skip to content

Instantly share code, notes, and snippets.

View jacklund's full-sized avatar

Jack Lund jacklund

View GitHub Profile
<a rel="me" href="https://freeradical.zone/@jacklund">Mastodon</a>
@jacklund
jacklund / openpgp.md
Created November 11, 2022 21:18
OpenPGP proof

openpgp4fpr:B437D0E4933942C741352022EED46888FC3D2C07

@jacklund
jacklund / packer.log
Created January 17, 2022 23:53
Packer log
2022/01/17 17:38:40 [INFO] Packer version: 1.7.8 [go1.17.2 linux amd64] [38/5280]
2022/01/17 17:38:40 [TRACE] discovering plugins in /usr/bin
2022/01/17 17:38:40 [TRACE] discovering plugins in /root/.config/packer/plugins
2022/01/17 17:38:40 [TRACE] discovering plugins in .
2022/01/17 17:38:40 [DEBUG] Discovered plugin: arm = /home/jack/git/rpi-k8s/build/packer-builder-arm
2022/01/17 17:38:40 [INFO] using external builders: [arm]
2022/01/17 17:38:40 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/01/17 17:38:40 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/01/17 17:38:40 [WARN] Config file doesn
@jacklund
jacklund / aws-get-logs
Created April 23, 2017 05:08
Script to get logs from an AWS instance
#! /bin/bash
set -o errexit
set -o nounset
usage() {
echo "Usage: $0 REGION INSTANCE-ID"
}
if [ $# -lt 2 ]; then
@jacklund
jacklund / .travis.yml
Created February 22, 2017 03:45
Add this to .travis.yml to get kcov to work with Rust and Coveralls
after_success: |
sudo add-apt-repository -y ppa:kubuntu-ppa/backports &&
sudo apt-get update &&
sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev binutils-dev libiberty-dev &&
wget https://github.com/SimonKagstrom/kcov/archive/v33.tar.gz &&
tar xzf v33.tar.gz && mkdir kcov-33/build && cd kcov-33/build && cmake .. && make &&
sudo make install && cd ../.. &&
kcov --verify --coveralls-id=$TRAVIS_JOB_ID --exclude-pattern=/.cargo target/kcov $(find target/debug -maxdepth 1 -executable -name macaroon-\*)

Keybase proof

I hereby claim:

  • I am jacklund on github.
  • I am jacklund (https://keybase.io/jacklund) on keybase.
  • I have a public key whose fingerprint is 3363 DAAB 400C 9E6C B2A1 27F8 E916 6C59 DF4B 0DA8

To claim this, I am signing this object:

@jacklund
jacklund / getWirelessInterface.java
Created May 21, 2013 02:40
Getting the wireless interface in Android
WifiManager wifiManager = (WifiManager)(getContext().getSystemService(Context.WIFI_SERVICE));
if (wifiManager.isWifiEnabled()) {
String wifiInterface = Utils.getProp("wifi.interface");
}
@jacklund
jacklund / web.xml
Last active December 17, 2015 13:29
web.xml for doing RESTEasy
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>MyApp</display-name>
<listener>
<listener-class>
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
</listener-class>
@jacklund
jacklund / gist:5565462
Created May 13, 2013 00:18
Prune out subdirectories from a repository using Git
# Get a list of the directories I'm not interested in
$ excludes=`echo $* | tr " " "|"`
$ files=`ls | egrep -v $excludes | tr "\\n" " "`
# Disconnect from remote for safety
$ git remote rm origin
# Get rid of all tags that don't fit my pattern
$ git tag -l | grep -v $pattern | xargs git tag -d
# Prune the directories I'm not interested in
$ git filter-branch --tag-name-filter cat --prune-empty \
--tree-filter "rm -rf ${files}" -- --all
@jacklund
jacklund / git_convert_subdir.sh
Last active December 17, 2015 02:38
Moving subdirectories in a git repository to be their own repositories
$ git clone repo-url
$ cd repo
$ git filter-branch --prune-empty --subdirectory-filter subdir-name master
$ git remote rm origin
$ git remote add new-repo-url
$ git push -u origin --all --tags