Control OSX Screen Brightness from Ubuntu 14.04 (on a USB stick!)

After trawling here and there and trying lots of different things, for me this works on my late 2012 21″ iMac with an ACPI card.

It’s best to put the script into a file, make sure the file is discoverable on PATH.

All details are in the folder:


which on my machine looks like this:

ubuntu@ubuntu:~/mc2$ cd /sys/class/backlight/acpi_video0
ubuntu@ubuntu:/sys/class/backlight/acpi_video0$ ls -l
total 0
-r--r--r-- 1 root root 4096 Oct 7 08:29 actual_brightness
-rw-r--r-- 1 root root 4096 Oct 7 08:29 bl_power
-rw-r--r-- 1 root root 4096 Oct 7 08:28 brightness
lrwxrwxrwx 1 root root 0 Oct 7 08:29 device -> ../../../0000:01:00.0
-r--r--r-- 1 root root 4096 Oct 7 08:03 max_brightness
drwxr-xr-x 2 root root 0 Oct 7 08:29 power
lrwxrwxrwx 1 root root 0 Oct 7 08:29 subsystem -> ../../../../../../class/backlight
-r--r--r-- 1 root root 4096 Oct 7 08:03 type
-rw-r--r-- 1 root root 4096 Oct 7 08:03 uevent

WARNING: If you use values higher than the maximum allowed for your card you *MAY* cause damage. The limit on my machine is 15 as indicated in the file

echo $1 | sudo tee /sys/class/backlight/acpi_video0/max_brightness

There are more exhaustive solutions out there including one I saw that didn’t work first time for me that limits the value but for me, being a hacker, I only needed a one liner. YMMV.

DISCLAIMER: If you damage your machine, that’s your fault not mine!!!

Cross platform development with Scheme

Just a quick note about something I recently found whilst trying not to buy MOCL…

LambdaNative is developed and maintained by the Pediatric Anethesia Research Team (PART) and the Electical and Computer Engineering in Medicine (ECEM) group at the University of British Columbia (UBC).

I have spent a week or two evaluating it and accidentally contributed a pull request that got merged and one that didn’t and I have to say that, for what it offers, it is awesomely good.

Having¬†personally spent many hours with it now, I do not yet think it is ready for mainstream development for a few reasons. I don’t mean that it a bad way either. What I mean is that the language, Scheme, is not really that widely known and as such it probably won’t break out into the public arena any time yet.

That’s a real shame.

Because I think that they have achieved an amazing thing; total abstraction of the underlying platform with a really powerful, underestimated language.

Go visit the site, give it a try. You will learn something.

Prime Peace

I think prime numbers are the numerical expression of peace. Restful nodes in the vibration of everything.

Prime factorisation has always struck me as something truly astounding and it is reassuring to know that awsesome minds are hard at work trying to solve the Riemann hypothesis right now.

There are some truly wonderful professional and amateur (in the nicest sense of the word) explorations I have watched recently and the ones that moved me the most, in order of cool factor were:

This guy,Carlos Paris, has put in some serious work with AutoCAD and made some interesting observations. I truly enjoyed watching all of his four videos. Awesome work Carlos. As an interested amateur I found his work and thoughts to be very compelling. I am sure the professionals would groan or moan but to me this video is most excellent and informative.

Speaking of the professionals, this video is also very interesting to watch as it goes some way to visually explaining the Riemann hypothesis in a way that a layman can understand (that’s me), in fact I believe his audience to have mostly consisted of young kids and their parents!

So… as I continue my studies and dreaming of a million dollars, I truly hope that there is another (Sir) Andrew John Wiles out there close to a proof of RH.