Batch Rename or Move An Extension In Linux (Eg .JPG to .jpg)

A short and easy trick, but one that is either not referred to or more complex examples given. I wanted to change a bunch of upper case .JPG images to lower case. Rather than writing a bash script or some such, I just used the ‘rename’ command:

rename 's/\.JPG$/\.jpg/' *.JPG

It may depend on perl being installed though. I don’t have a Linux machine to hand that doesn’t have perl present, so I cannot verify this. If this command doens’t work for you, please leave a comment to that effect below.

Another useful one from the manpage:

rename 'y/A-Z/a-z/' *

To translate upper case filenames (and extensions by the looks of it) to lower case.

Bass

Ah bass, king of the gamefish. At home in both fresh and saltwater, one of the most sought after fish in the US, this fish has its sporting origins in the nineteenth century… No no no! What? Oh, not that kind of bass. Right.

Throwbacks to A Bit of Fry and Laurie aside, I feel a rant coming on. The flat below is having some kind of box social or mixer or shindig and where there is box socials, there is music. And where there is party music, there is an excess of bass. So sleeping is off for the moment… hence this rant.

I don’t know where my aversion to bass comes from though. I can tell you my subwoofer has its bass knob turned the full way down, and the software mixers on my various computers have bass set low (if applicable), and the music player equalisers have it similarly adjusted so as to de-emphasise the lower frequencies. I do like a good beat, but I find bass lines overwhelm and muffle the rest of the more important (in my opinion) instruments. It may completely fail to surprise you that I tweak up the treble response a bit too.

But anyway, before I get called Buzz Killington, buzzkiller, I should point out that these box socialites don’t even have the good grace to let us get used to a particular beat. The music is getting changed with about as much care as and ADD DJ. The reverberations are spasmodic, coming up through the floor for 30 seconds, then a change, then 2 minutes of something similar, then a minute of silence, then 4 minutes of something completely different, then 5 minutes of silence, then a few changes in quick succession. Concomitant with this joyous musical indecision is a grand variance in the volume of the music. As I write this sentence, I can feel the floor vibrating through the rug and carpet; earlier, I had to put my ear to the flow, then actually go downstairs to confirm the music was indeed coming from the flat below. Why there quite is so much variety I am not sure, perhaps they are playing some brazen, adult form of musical chairs that I wish to both remain ignorant of and take hearty part in.

I begin to ramble, partly because it is nearly half 1 and I am tired, while being subjected to weapons-grade bass and listening to songs with odd lyrics on Last.fm; and partly because there is a word counter right below this ever-growing wall of text, and I feel I have been short-changing in recent posts.

Anyway, the lovely people (can you feel the restraint that went into those two words?) downstairs have about half an hour before I strap on the kevlar and helmet and go SWAT on their music system.

How Not To Run a Poll

There is a very good writeup by Paul Lamere of Music Machinery of how Anonymous subverted a major poll by Time. AKA “moot wins, Time Inc. loses“.

A number of things strike me:

  • Despite how obvious it is, Time deny that the poll was manipulated, stating they have safeguards in place, etc, etc. I guess humble “we fucked up” pie is hard to eat
  • For an influential (ie well-funded) publication they sure have no idea how to protect a poll
  • Anonymous are (as ever) a force not to be trifled with. Sure, they probably won’t topple regimes or enact social change any time soon, but if you draw their ire or attention, you’ll have a hell of a storm to weather.
  • reCAPTCHA wasn’t subvertable, even in the hands of these determined people. This is a Good Thing.

There’s not much else besides these scantly-150 words to say. The writeup is most detailed, although it would have been interesting if Paul had elaborated on how they determined Time’s ranking algorithm to eliminate the need for 46 000 votes. Well worth the read though.

Brown Apologises For Treatment of Turing

The British Government has apologised for the treatment of Alan Turing, convicted of ‘gross indecency’ and sentenced to chemical castration under anti-homosexuality laws in 1952. In a statement responding to a petition on the Prime Minister’s website, Gordon Brown has recognised that the action taken against Turing was “inhumane” and “appalling”, and that he [Turing] should be remembered for his contributions to the Allied war effort and to humanity:

It is no exaggeration to say that, without his outstanding contribution, the history of World War Two could well have been very different. He truly was one of those individuals we can point to whose unique contribution helped to turn the tide of war. […] But even more than that, Alan deserves recognition for his contribution to humankind. For those of us born after 1945, into a Europe which is united, democratic and at peace, it is hard to imagine that our continent was once the theatre of mankind’s darkest hour. […] It is thanks to men and women who were totally committed to fighting fascism, people like Alan Turing, that the horrors of the Holocaust and of total war are part of Europe’s history and not Europe’s present.

Sleep Matters

Once again, the BBC is running a story about how if you value your mental health, you should sleep apart from your partner. Link.

This story concerns two talks, both given as part of the British Science Festival (Sleep After 60: Changes and Challenges in Later Life). The first part is a study done by a Dr Rob Meadows of the University of Surrey (sociology dept). It included 40 couples, and concluded that there is a 50% chance of disturbance if “one [partner] moves in [their] sleep”. In the BBC article there is no mention of time or grouping, and my Ovid-fu has yet failed to return me the article in question. Perhaps it is yet unpublished.

The other half of the article concerns Dr Neil Stanley of the Norfolk and Norwich University Hospital (and somewhat attached to the U of Surrey, as he set up his “sleep lab” there). He reiterates his point (made here, and no doubt elsewhere) that: sleeping together is bad for you, we didn’t do it before the industrial revolution, the Romans didn’t do it, etc.

Without seeing the study methods I cannot comment on how well it was done, although Dr Meadows has been published several times in this area before. Dr Stanley also seems to be well-published, although his focus seems to be more on the urological side of things (disclaimer: this opinion is based on some Ovid / Scholar searches…). However, the 2006 BBC article concerns itself with 8 couples over 10 nights. 80 data points (or 160 some might argue) may be enough, but I’d need to see the statistical analysis to be sure.

My point is, the BBC seem to be taking it as read that it is a good idea to sleep separately, with no more justification than “people did it before the Victorian era”, on the word of a ‘sleep expert’. We need to be given the data, not taking people’s word for it!

Mission Failed

Drat! I failed my test. Did all the hard parts fine, but two silly things let me down:

  1. A failure to indicate while doing a reverse park… Didn’t know about this but hey ho, I do now.
  2. Went through an unmarked crossroads on Mitre Road, a road I am intimately familiar with. D’oh.

My intructor reckons it was just nerves that did me for the second one, but I think that I would have done that even just in the car with him. Problem is, that I know the  4-way junction in question is always always always really quiet, and so in my mind it’s a give way coming from the side street (rather than a 4 way give way). Ah well, lesson learned. An expensive lesson right enough…

Driving Test Stuff

My practical test is in a week. Eep, yikes, etc etc. I had my penultimate lesson (counting the one right before the Real Thingâ„¢) today, and managed to get a couple of silly fails out of my system.

My point point is that the website The Driving Test could be quite useful if you’re in the position where you have a test but aren’t exactly sure of the procedure. It may not look like much, but it has some useful information. It talks you through what will happen in a test – ie what kinds of things the examiner will say – which is very useful in allaying fear of the unknown. The author is a former DSA examiner, so he should know his stuff. Check it out.