Skip to content

Instantly share code, notes, and snippets.

@MrDOS
MrDOS / riptime.py
Created October 15, 2012 19:40
Determine the extraction speed of a disc drive based on an EAC log.
#! /usr/bin/python
import sys, re
DRIVE_PATTERN = "Used drive : (.+?) Adapter"
TRACK_PATTERN = "([0-9]+) +\| +([0-9]+):([0-5][0-9].[0-9]{2}) \| +([0-9]+):([0-5][0-9].[0-9]{2}) \| +([0-9]+) +\| +([0-9]+)"
SPEED_PATTERN = "Extraction speed ([0-9]+.[0-9]) X"
def parse(log):
if not log.startswith("Exact Audio Copy V"):
@MrDOS
MrDOS / grabber.py
Created October 16, 2012 20:08
Generate log file URLs for all torrents with logs recently uploaded to What.CD.
#! /usr/bin/python
"""Use values from one of your personal RSS feed URLs."""
USER=""
AUTH=""
PASSKEY=""
AUTHKEY=""
import urllib, re
try:
@MrDOS
MrDOS / grope.sh
Created November 14, 2012 22:10
Grope, a multipiece Amazon album art retrieval script
#! /bin/sh
# Grab multipiece album art from Amazon.
# Usage:
# ./grope.sh url output
# ...where URL is the URL of one piece of the album art, as shown by
# right-click -> Page Info after zooming in on the image, e.g.,
# http://z2-ec2.images-amazon.com/R/1/a=B0011Z1BII+c=A17SFUTIVB227Z+d=_SCR(3,2,0)_+o=01+s=RMTILE+va=MAIN+ve=391313817+e=.jpg
# (Yes, the whole thing.)
@MrDOS
MrDOS / checkalbums.sh
Created November 28, 2012 19:57
Check album art and ReplayGain tags of a hierarchical music library
#! /bin/sh
# Check through a hierarchical music library to verify that album art meets a
# minimum size or that music is ReplayGain-tagged.
# Usage:
# ./checkalbums.sh [-art] [-replaygain]
# If -art is given, verify album art size. If -replaygain is given, check for
# the existence of ReplayGain tags and add them if not present.
MINSIZE=600
@MrDOS
MrDOS / flake.sh
Last active December 13, 2015 20:48
Transcode FLAC files to AAC. Grabs all FLAC files in the given directory, transcodes to AAC, then makes some attempt to copy tags and, if folder.jpg is found, to embed album art.
#! /bin/sh
# Transcode FLAC files to AAC. Grabs all FLAC files in the given directory,
# transcodes to AAC, then makes some attempt to copy tags and, if folder.jpg is
# found, to embed album art.
AAC_FLAGS="-q 0.5"
FLAC_TAGS="TITLE ARTIST ALBUM GENRE TRACKNUMBER DATE"
AAC_TAGS="title artist album genre track year"
@MrDOS
MrDOS / gist:4973656
Created February 17, 2013 21:44
Banner for /r/edmpdj
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
@MrDOS
MrDOS / passgen.sh
Created February 18, 2013 20:11
Simple alphanumeric password generation.
#! /bin/sh
# Simple alphanumeric password generation.
DEFAULT_LENGTH=10
if [ "$1" = "-h" -o "$1" = "--help" ]
then
echo "Usage: $0 [length]" 1>&2
echo "Generate a random alphanumeric password." 1>&2
http://cloc.sourceforge.net v 1.58 T=3.0 s (17.7 files/s, 1288.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 29 232 483 1845
XML 9 7 0 629
HTML 12 33 0 570
Javascript 2 1 0 43
Bourne Shell 1 3 6 12
-------------------------------------------------------------------------------
@MrDOS
MrDOS / nbtologist.c
Last active December 30, 2015 13:39
Print out the Bukkit/Spigot “lastKnownName” tag if it exists.
/* "Where my people at?"
*
* NBTologist: search through an un-gzipped player.dat NBT file for the player's
* X/Y/Z coordinates.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@MrDOS
MrDOS / spot.sh
Last active December 30, 2015 13:39
In light of UUID conversion, pull player names out of the NBT files.
#! /bin/sh
# Generate a markers.js file with markers for players based on their last-known positions.
# Requires a binary of NBTologist:
# https://gist.github.com/MrDOS/7836657
# Path to NBTologist.
NBTOLOGIST=/home/minecraft/map/nbtologist
# Path to directory containing player NBT files.
PLAYERS=/home/seecraft/map/world/playerdata
# The name of the Mapcrafter world.