Emacs fat fringes and colours

Having gotten used to various editors implementations of distraction free or presentation mode views, I figured that emacs could probably do something similar with little effort.

As usual, it could.

For me, distraction free means no clutter, no menu bars, tool bars, gutters, line numbers, just the code. The first step is to be able to set the size of the left and right margins to something large, 100px works quite well. I use Aquamacs a lot. This does not work in the terminal! So, here is the little bit of code you need to place into your beloved ~/.emacs file:

Then, using the Ctrl-U prefix, you would set the left and right margins to be whatever you want, let’s say we wanted to have 500px left and right, which works well for meo n my 1920×1080 display, the keystrokes:

will make the fringes become very wide and take on the current theme background colour. If you change themes a lot like I do, then just re-issue the sequence if the fringes end up a different colour. Sometimes it actually looks nicer!

Some other command that are useful in cutting down the visual clutter:

You could of course combine all of the above into a single killer command, make it interactive and also use the Ctrl-U prefix to turn it on or off. For example, if the prefix was set to a non-negative integer for example that could mean to enable the mode and any other value would disable it.

If I get some time I’ll write that command and stick it here.

OSX rsync and Google Drive

After a recent horrifying experience upgrading to El Capitan which resulted in basically losing my internal hard-drive for a week before I got it back (a whole other story) I have managed to wipe it, reinstall El Capitan and start getting my digital life back together.

I had most of my stuff backed up out there in the cloud but it was just the sheer inconvenience of it!

Anyway, I am now back in the game and and having learned the value of backups, I am toying with using “rsync” and the Google Drive application on my mac as it seems to be the easiest way to go, at least for me.

Sure, Time Machine, CrashPlan, Carbon Copy Cloner are all out there and serve a purpose but none feel right. Time Machine uses a black list, CrashPlan uses a whitelist approach. CCC…. TL;DR !

I’ve been using this for a while to great effect:

At the end of the day I just run it and go make a coffee… the only danger is knowing when it has finished but the flashing GDrive icon is a good indicator.

Hope that helps somebody find a real simple developer style backup option.

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.