Although I do my best to make this site compliant with all browsers, not having CSS is a big miss on this one. Consider coming out of that CLIshit browser, you fatass neckbeard.

Cool tools, pt. 1

[linkstandalone]

Sometimes I just make tools to make my doodly-doos around the computer a little easier.

Since I think these are too small to have their own git repository or something, I thought I'd share these in my blog.

However many I'll write/release, they'll be "licensed" under CC0. Practically public domain, and if your state/country doesn't have public domain - it'll still act like it.

The first in the series is a small thing I made to learn awk. It counts your music by formats.

FLAC sound molesters can flex their RAID arrays with this.

Here's the source code:

#!/bin/bash

find ./ | awk '

BEGIN {
    AllMusic=0
    Flacs=0
    MPThrees=0
    MFourAs=0
    WAVs=0
}

/flac$/ {
    AllMusic++
    Flacs++
}

/mp3$/ {
    AllMusic++
    MPThrees++
}

/m4a$/ {
    AllMusic++
    MFourAs++
}

/wav$/ {
    AllMusic++
    WAVs++
}

END {
    print "Total music:", AllMusic
    print "FLACs:", Flacs
    print "MP3s:", MPThrees
    print "M4As:", MFourAs
    print "WAVs:", WAVs
}
'

Of course there are some issues with this, like not supporting every music format in existance. But you can easily edit it, if you would like to do that.

If you're wondering what my music collection looks like, well...

~/Music> CountMusic
Total music: 560
FLACs: 367
MP3s: 138
M4As: 54
WAVs: 1
~/Music> 

I'll leave it there.