Choosing Random Files

February 14, 2017

This week, something short. To run tests, I needed a selection of WAV files. Fortunately for me, I’ve got literally thousands of FLAC files lying around on my computer—yes, I listen to music when I code. So I wrote a simple script that randomly chooses a number of file from a directory tree (and not a single directory) and transcode them from FLAC to WAV. Also very fortunately for me, Bash and the various GNU/Linux utilities make writing a script for this rather easy.

dice

Read the rest of this entry »


The Platypus

April 14, 2010

This afternoon, on #bash on Freenode:

[19:08:56]  < DrMax > well, yes, with the trailing -print, it works as expected
[19:09:20] * nDuff mutters about people who don't follow his examples exactly, and then complain when they don't work. :P
[19:09:37]  < DrMax > lol yes, sorry, my bad
[19:09:58]  < DrMax > won't do it again, promise
[19:11:55]  < DrMax > find is the platypus of the *nix ecosystems. It has a beak, claws, venom. It swims, lay eggs, is ugly, but somehow manages to survive
[19:12:13]  < DrMax > I hate this command
[19:12:39]  < DrMax > nDuff : nevertheless, the help is greatly appreciated
[19:13:48] < nDuff > eh; find is like *nix in general -- a little picky about who its friends are. Once you get to know it though, it's the kind of friend that helps you move bodies.
[19:14:16]  < DrMax > hmm interesting, but I don't have to move bodies very often
[19:14:21]  < DrMax > I'd rather have regular friends

We’re discussing find, the command I hate the most in all *nix-like commands. Needless to say, the guys and gals on #bash are always extremely helpful and got me on my way.