Skip to content

Instantly share code, notes, and snippets.

@AJDurant
AJDurant / Update-AUPackages.md
Last active October 19, 2025 01:43
Update-AUPackages Report #powershell #chocolatey
@AJDurant
AJDurant / get_logs.sh
Created May 10, 2019 13:28
Get all boot logs from journalctl and put them into a given dir by boot time
#!/bin/bash -ue
LOGDIR=$1
# The code point $'\342\200\224' is for the em dash
rm $LOGDIR/*.log
journalctl --list-boots --utc | awk -F $'\342\200\224' '{print $1}' | awk '{print $1, $4"_"$5"_"$6}' | xargs -n2 bash -x -c "journalctl --no-pager -b\$1 > $LOGDIR/\$2.log" bash
<?php
$dir = "/music/records/";
$trackduration = array();
$db = pg_connect('<redacted>');
$result = pg_query($db, "SELECT trackid, recordid FROM rec_track WHERE duration is NULL AND digitised is TRUE");
while ($row = pg_fetch_assoc($result)) {
@AJDurant
AJDurant / audioVisual.sh
Created February 26, 2016 16:37
turn an audio file into a video with analysis
ffmpeg -i audio -filter_complex \
"[0:a]avectorscope=zoom=2:s=960x777:r=60,pad=1920:1080[vs]; \
[0:a]showspectrum=mode=separate:color=intensity:scale=cbrt:s=960x777[ss]; \
[0:a]showwaves=s=1920x303:r=60:mode=line[sw]; \
[vs][ss]overlay=w[bg]; \
[bg][sw]overlay=0:H-h[out]" \
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a aac video.mp4
ffmpeg -i \\.\pipe\DeckLink.ts -vcodec copy -preset medium -r 25 -g 50 -b:v 4500k -crf 18 -acodec copy -bsf:a aac_adtstoasc -ar 48000 -af aresample=44100 -threads 6 -b:a 128k -bufsize 4500k -f flv "rtmp://a.rtmp.youtube.com/live2/$KEY"
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
//Submitted
$data =
if (empty($data['id'])) {
//create new
} else {
//submit edit
@AJDurant
AJDurant / postmkvirtualenv.sh
Last active December 20, 2015 14:09 — forked from jaysw/postmkvirtualenv.sh
Updated for cygwin use
#!/usr/bin/env bash
# file: ~/.virtualenvs/postmkvirtualenv
# This hook is run after a new virtualenv is activated.
# setup python interpretor and sitepackages
# for Sublime Text's SublimeCodeIntel plugin.
# codeintel looks in the root of any folder opened via `subl foldername`
# for foldername/.codeintel/config
# it also looks in ~/.codeintel/config
@AJDurant
AJDurant / mojo_manager.py
Created April 17, 2013 21:27
edited mojo_manager for per app templates in the mojo tornado framework
#!/usr/bin/env python
import optparse
import os, sys
import shutil
import Mojo
project_files = [
'__init__.py',