Categories
breakcore mp3 music mystuff n3wjack

battle beats vol two breakcore compilation

A while ago I saw this Facebook post in a breakcore group pass by with a call for submissions for a compilation album on some net-label. So I checked some of my unfinished tunes and found something suitable to finish and submit.

So here it is. The album turned out to be a “glorious mess” of very different types of breakcore tunes. Check it out if you want to be surprised and feel like listening to a something different. I bet you’ll find something cool you like in there. If not, no big loss. You can listen to the full album here and on Bandcamp, and download for free if you want.

Categories
geek music mystuff tips tools

download cover art for all your albums, with powershell

Album covers are nice eye candy when you’re using a media player like Foobar2000 which automatically picks up a cover.jpg file in an album folder. The problem is that I have a lot of mp3 albums I ripped from my CD’s from way back and those don’t have any fancy cover art files.

I looked around for some tools that could automagically download covers for my albums but didn’t find anything handy. Since my music is structured in sub-folders like \ I thought this should be easy enough to parse and get pictures for.
If only there was a service that could easily provide those…

I tried the Musicbrainz API’s but that turned out to be hard to use and didn’t give me any covers for some test albums either. Then I thought of Last.fm. They have a lot of cover art, and their URL structure is the same as my folder structure… hmmm.

And here it is, a Powershell script which runs over your folder structure, tries to get the album page from Last.fm and then saves a cover.jpg image from the album page metadata.

A few things to know:

  • Your mp3’s are expected to be in a folder structure like (artist)\(album)\*.mp3
    E.g. The Prodigy\The Fat of the Land
  • If a folder contains any JPG or PNG image, it will be skipped. So that means you can run the script multiple times, and it will only download images once.
  • The “Various artists” folder is skipped by default because it didn’t fit the search pattern. If you store these type of albums in another folder, you might want to update that line with the correct folder name. If it does happen to process that folder in your case because of a different name, nothing will go wrong. It simply won’t find any album matches.

To use it, copy the code below in a file called get-albumart.ps1, or whatever name you fancy. Then run it as follows to get those pretty cover albums:

.\get-albumart.ps1 d:\music

And as always, this script comes as is, without any kind of warranty and you’re free to try it at your own risk. I wrote and used it and it worked great for me. I hope it works for you too. If Last.fm sues you because you’re downloading every image they have on the site because of your huge album collection? You didn’t get this script from me OK. Nope. Not me. ;-)

param ([Parameter(Mandatory=$true)][string]$path)

$progressPreference = 'silentlyContinue'
pushd
cd $path
$artistFolders = ls -directory | where { $_.name -ne "Various artists"}

foreach ($artistFolder in $artistFolders)
{
    $artist = $artistFolder.name
    write-host "::: $artist :::" -foregroundcolor green

    cd -Literalpath $artistFolder
    $releaseFolders = ls -directory
    
    foreach ($releaseFolder in $releaseFolders)
    {
        $release = $releaseFolder.name
        write-host "$release" -foregroundcolor cyan
        cd -literalpath "$releaseFolder"

        if ((test-path *.png) -or (test-path *.jpg))
        {
            write-host "- Images found, skipping."
        }
        else
        {
            $url = "https://www.last.fm/music/$($artist)/$($release)"
            $r = $null

            try 
            {
                $r = invoke-webrequest $url -usebasicparsing
            }
            catch 
            {
                write-host "- Release not found, skipping: $artist - $release" -foregroundcolor red
            }

            if ($r -ne $null)
            {
                $s = $r.content -split "`n" | where { $_ -like "*`"og:image`"*"} 
                $img = ($s -split '"') | where { $_ -like "*https*.jpg*" }

                if ($img -ne $null)
                {
                    write-host "- Downloading image for $artist - $release from $url"
                    invoke-webrequest $img -outfile cover.jpg
                }
                else
                {
                    write-host "- No image for $artist - $release from $url" -foregroundcolor yellow
                }
            }
        }
        cd ..
    }
    cd ..
}

popd
$progressPreference = 'Continue'

Categories
geek mystuff n3wjack opensource programming software vim

a vim http log file syntax plugin

Log files are dull to look at. Lines and lines of text and no pretty colors to make it nicer to look at and easier to spot those weird errors you can’t simulate on your machine.

Vim rocks and writing a syntax file is supposed to be a breeze judging from the vast amount of syntax plugins out there. I didn’t quite find one I liked for syntax highlighting HTTP log files, so I thought I’d get down and dirty with some vimscript myself and see if I could hack something together.

It turned out alright I think. So to share the fun I’m hosting the logsyntax.vim plugin on Github and the vim.org scripts library for all to use. It highlights dates, HTTP verbs, URLs, IP addresses etc for IIS, W3C extended, NCSA and probably a bunch more typical log formats.

May your logs be pretty and colorful from now on.

The vim log file syntax highlighting plugin screenshot. Look at those pretty colors.

Categories
blog geek mystuff n3wjack opensource programming software wordpress

a wordpress full site spell checker tool

A while ago I noticed that some of my older posts had some silly misspellings in it, so I was looking for a way to spell check all my posts in one shot. I couldn’t really find anything that was free, so I figured I’d try to write something myself to do this for me.

I knew about the free and open source Hunspell spell checker and that you can use it from the command line. So I thought using that together with the WordPress export XML file which has all your post’s content it should be possible to spell check the whole lot.

The end result is a PowerShell script which reads out the XML export file and runs it through Hunspell, parses the spelling errors found and finally bundling it all into a simple HTML report.

It worked nicely for me, even though it’s pretty crude and simple. I only had to use this once, so I don’t see the point of fine-tuning it a lot further.

However this could be handy for others who want to do the same thing, so I cleaned it up a bit, slapped a readme file on it and posted it on Github as the WordPress full site spell checker.
Check it out if you want to spell check your WordPress blog in a single run and maybe this will be good enough to get your job done. You find more info on how to set up and use it on the Github page.

That very basic report I was talking about.

Categories
download flickr mystuff wallpaper

some free wallpapers for desktop and phone

My web stats tell me that you lot like to find some new and shiny wallpapers for your desktops and phones now and then. Since I’ve been tagging my flickr photos for a while now with wallpaper tags, I thought it would be nice if I’d just link them up here so you can take a peek and use them if you like.
All wallpapers are cc-licensed as usual so you’re free to use them, chop and manipulate them. To download an image, click the Actions menu on top, then pick “View All Sizes”.

Here’s some of the desktop wallpapers:

cmd.exe

belgian summer

dubai nights

And here are some more wallpapers specifically made for your smartphone (which means they are in portrait mode basically):

dark church ra dubai nights

Enjoy!