Skip to content

Instantly share code, notes, and snippets.

@Troftu
Troftu / audible_aaxc_to_m4b.sh
Created May 2, 2024 12:20
Shell script to batch convert aaxc files into m4b
#!/bin/bash
for file in *.aaxc; do
base_name="${file%.*}"
voucher_file="${base_name}.voucher"
m4b_file="${base_name}.m4b"
if [[ -f "$voucher_file" ]]; then
audible_key=$(jq -r '.content_license.license_response.key' "$voucher_file")
audible_iv=$(jq -r '.content_license.license_response.iv' "$voucher_file")
@Troftu
Troftu / disk-rip.sh
Last active December 31, 2022 15:42
Simple bash script that create an iso disk image from a disc drive. After copying both source and target checksums are created, saved and compared in order to validate the iso.
#! /bin/bash
DRIVE=$1
FILENAME=$2
INIT_TIME=$3
DISK_CHECKSUM_FILE="${FILENAME}.disk.sha512"
ISO_CHECKSUM_FILE="${FILENAME}.iso.sha512"
echo "Closing tray, then waiting some time for disc to initialize"
drutil tray close
@Troftu
Troftu / smartbroker.js
Last active July 2, 2022 01:29
Smartbroker uses a pretty strict auto logout timer that allows less than 5 minutes of inactivity. I do not believe this to have an advantageous effect on security. This script removes the annoyance by periodically scrolling the page without actually moving in the viewport. This action is interpreted as user interaction and therefore resets the t…
function removeSessionTimerVisuals() {
document.getElementById("sessionTimer").remove();
}
function fixLayout() {
document.getElementById("footer").remove();
}
function pseudoInteract() {
window.scrollBy(0, 1)