Skip to content

Instantly share code, notes, and snippets.

View hdonnay's full-sized avatar

Hank Donnay hdonnay

View GitHub Profile
@hdonnay
hdonnay / stats.pl
Last active December 12, 2015 10:38
#!/usr/bin/perl
use strict;
use warnings;
use List::MoreUtils qw(zip);
my @a = ( 'Kernel Name', 'Hostname', 'Kernel', 'Platform', 'OS' );
my @b = split(/ /, `uname -snrio`);
chomp($b[-1]);
my @c = ( 'used', 'total' );
my %uname = zip(@a, @b);
@hdonnay
hdonnay / retag
Last active December 10, 2015 21:39
tiny mp3 tagger based on id3v2 and a sane file layout. Now with arbitrary genre support!
#!/bin/sh
ALBUM=$(basename "`pwd`")
ARTIST=$(basename "$(dirname "`pwd`")")
TOT=$( ls -1 | grep \.mp3 | wc -l )
printf "Tagging %d track in pwd as %s / %s\n" "$TOT" "$ARTIST" "$ALBUM"
printf "Pick a genre: (enter to list, the genre id, or '255' to specify string) "
read GENRE
if [ "x${GENRE}" = "x" ]; then
id3v2 -L | less
read GENRE