Skip to content

Instantly share code, notes, and snippets.

@mattconnell
mattconnell / wallabag-import.php
Created March 16, 2023 01:26
A standalone, API-based Wallabag JSON importer
<?php
// Digest exported wallabag JSON and re-import it,
// since the built-in importer is broken.
// CONFIGURATION //
// Secrets file, for your API keys
define('WALLABAG_SECRETS', 'wallabag-secrets.php');
@mattconnell
mattconnell / keybase.md
Created September 30, 2018 07:45
Keybase proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@mattconnell
mattconnell / to-mp3.sh
Last active May 6, 2018 00:30
Dumb shell script to sweep a directory for files of a certain extension and run them through ffmpeg to create mp3s. Used along with youtube-dl to bulk harvest music from various sources.
#!/bin/bash
set -e
### Setup
# List of formats to convert.
SOURCEFORMATS="m4a ogg opus"
# Desired outcome format
@mattconnell
mattconnell / docker-adb.sh
Created March 6, 2018 07:31
Simplify ADB/fastboot use with Docker
#!/bin/bash
# Setup
CONTAINER="sorccu/adb"
CONTAINERNAME="adbd"
HOSTDIR="$HOME/Downloads/"
CONTDIR="/mnt/"
# Fetch latest version first.
echo "Pulling latest version of ${CONTAINER}..."
@mattconnell
mattconnell / docker-unifi.sh
Created February 11, 2018 22:09
Ubiquiti unifi docker container script
#!/bin/sh
# Pull the latest version because we always want it.
echo "Attempting to pull latest container version..."
docker pull jacobalberty/unifi:latest
# Run the container.
echo "Starting container..."
docker run \
--rm \
@mattconnell
mattconnell / borg.sh
Last active March 20, 2018 03:31
Borg backup bash script for rsync.net
#!/bin/sh
### Setup ###
REPO_SERVER="rsync.net"
REPO_NAME="detroit"
REPO_PATH="${REPO_SERVER}:${REPO_NAME}"
# Get the date+timestamp
CURDATE="$(date -I)-$(date +%s)"
#!/bin/bash
echo "Converting all wav files to liblame-encoded mp3s."
for i in *.wav ; do
echo -n "Processing file $i... "
ffmpeg -loglevel error -i "$i" -acodec mp3 "${i//\.wav/}".mp3
echo "Done."
done
@mattconnell
mattconnell / qr.py
Created October 12, 2017 02:57
Quick and dirty QR code generation
#!/usr/bin/python
from sys import argv
import pyqrcode
print( pyqrcode.create(argv[1]).terminal() )