Recent Posts (all)

Power structures are not a human-only prerogative

Beautiful quote from Frans de Waal’s Are We Smart Enough to Know How Smart Animals Are? book:

“When I began observing the world’s largest chimpanzee colony, at Burgers’ Zoo in 1975, I had no idea that I’d be working with this species for the rest of my life. Just so, as I sat on a wooden stool watching primates on a forested island for an estimated ten thousand hours, I had no idea that I’d never again enjoy that luxury. Nor did I realize that I would develop an interest in power relations. In those days, university students were firmly antiestablishment, and I had the shoulder-long hair to prove it. We considered ambition ridiculous and power evil. My observations of the chimps, however, made me question the idea that hierarchies were merely cultural institutions, a product of socialization, something we could wipe out at any moment. They seemed more ingrained. I had no trouble detecting the same tendencies in even the most hippielike organizations. They were generally run by young men who mocked authority and preached egalitarianism yet had no qualms about ordering everyone else around and stealing their comrades’ girlfriends. It wasn’t the chimps who were odd, but the humans who seemed dishonest. Political leaders have a habit of concealing their power motives behind[…]”

Posted on 01 Jan 2023

Easy to use macOS disk cleanup tools

Pretty Clean

A small utility to — unobtrusively — scan your macOS disk to remove caches and other files and folder that can be clean up.

Free, and built on Tauri.

There’s an Hacker News discussion as well in case you want to know more.

Posted on 11 Oct 2022

New Airpods

Two years ago I replaced my Airpods with the Airpods Pro.

The upgrade was significant and necessary, as after 2-3 years, the battery of the old ones was worn out.

Apple Airpods Pro

Some months ago (as the Airpods where nearing their 2 year anniversary), the first major issues started to come up. The right microphone wouldn’t work well, when touching the right Airpod I would hear a cracking noise, and the battery was slowly decaying.

Turns out that there’s a service program from Apple and Airpods exhibiting crackling or static sounds are eligible.

So I went into the Apple Store in Amsterdam and got a new pair!

Some notes:

Posted on 29 Sep 2022

OpenAI Whisper

OpenAI has just open sourced Whisper, an automatic speech recognition.

I just tried it out and I’m blown away.

Installation was a piece of cake (even though there was a missing step, but I’ve opened a pull request to help out), and once you’re there, it literally takes seconds to start transcribing:

whisper my_file.m4a --model base

The output is ready to be used in subtitles programs as well, as it looks like this

[01:23.000 --> 01:31.000] Camilla, first question, what keeps you awake at night?
[01:31.000 --> 01:36.000] Around data analytics, let's keep it to that box
[01:36.000 --> 01:45.000] Yeah, so I think we have three different, very specific business units
[01:45.000 --> 01:52.000] And we have teams that are divided between being masters in data in analytics
[01:52.000 --> 01:57.000] And they know much more than I do to having people who are just hearing about data
[01:57.000 --> 02:00.000] And it's a very, very scary topic
[02:00.000 --> 02:08.000] And what I'm supposed to be doing is raising the level so that we at least come to the same level of understanding
[02:08.000 --> 02:13.000] What does it mean for me? What does it mean for the company? What is data?
[02:13.000 --> 02:17.000] I mean we really go into those type of basic conversations
[02:17.000 --> 02:23.000] So that really is a challenge and an opportunity, huge opportunity
[02:23.000 --> 02:26.000] So that keeps me awake at night, how do I do that?

(The audio was taken from an interview I had with Camilla Björkqvist last year).

The future is here :)

Posted on 22 Sep 2022

Configure Caddy v2 to reverse proxy the Unifi Controller

Caddy is an open source web server that can be used to, among others, proxy other sorts of server adding https with valid certificates.

At home, I have a Unifi controller that uses https but has no valid certificate, so I decided to expose it through caddy.

Since I run caddy as an unpriviliged user, it listens to port 2016 for http and 2017 for https. My router then listens to port 80 / 443 and reroutes to port 2016 / 2017 on the host running caddy.

The working configuration I came up with my Caddyfile is pretty simple

  http_port 2016
  https_port 2017 {
    reverse_proxy {  # the unifi controller runs on the same machine as caddy
      transport http {
        tls_insecure_skip_verify  # we don't verify the controller https cert
      header_up - Authorization  # sets header to be passed to the controller

That’s it!

Posted on 14 Sep 2022

Get URL of selected Mailmate messages

One of the features of my favourite email client, Mailmate, is the ability to copy a unique link per message.

Upon clicking the link from anywhere, Mailmate will be opened showing the associated email.

I use this feature a lot to link to-do in Things. Mailmate even offers a bundle to automatically add an email link to Things.

However sometimes I already have an existing to-do, and I need to paste the Mailmate link.

To make it easy, I created an AppleScript in Typinator that pastes the link of the selected Mailmate message.

Reported here for posterity :)

tell application "MailMate"
	set selectedMessages to messages
	set theMessage to item 1 of selectedMessages
	return message url of theMessage
end tell
Posted on 31 Aug 2022

Change macOS computer name

I recently upgraded to a new M1 Pro Macbook Pro and the computer is managed by the company.

It means that — for one reason or the other, spuriously documented on Apple discussion forum — I was not able to change the computer name.

can't change computer name on macOS

A good soul documented the solution, that I am reporting here for my future self: fire up the terminal and type

sudo scutil --set ComputerName <your_name_here>


Posted on 04 Aug 2022

Test your Machine Learning models in production

Have you ever thought why the flight attendants bother giving safety instructions? Do you listen to them?

Flight attendants are stuck. They can’t go off script.

Probably a long time ago, there were tests on how to deliver those safety instructions to passengers.

The current way was tested not with busy passengers needing to get somewhere, but people recruited for the purpose. It probably fared better than anything else.

Yet, when applied in real life, it sucks. We don’t listen to what they say.

I see the same mistake made in data science: people test their model with real data, but not in production.

I used to tell my classes a story of a big online retailer developing a much better version of their recommender — “customers who bought this, also bought that” type of thing.

With the new recommender, fewer clicks were necessary to understand the set of items the customer wanted to buy.

Before rolling out, they A/B tested it — luckily.

To their surprise, people exposed to the new version, were closing their browser more quickly without buying!

Some of them were logged in, so they decided to investigate.

It turns out, customers were creeped out by the eerie accuracy of the new recommender. They left the website, afraid of what else the retailer would find out about them.

The retailer went back to the old version.

It doesn’t matter how enthusiast data scientists are about the model.

Without testing in production, it counts for nothing.

Posted on 01 May 2022

Explainable AI and fraud

Algorithms can have serious consequences on the lives of people around you.

The Dutch tax office used the second nationality as a feature in their model — to find possible fraudulent behavior in their allowances scheme.

There were two problems with their approach:

Is this problematic?

Yes, it is! If you don’t know why someone is flagged, then you will be looking into everything trying to find something is wrong. And sometimes that something is a technicality such as forgetting to sign a form — a far cry from committing fraud!

So how do you do it right?

A couple of years ago, I was called by a bank that had a high-performing machine learning model (an isolation forest) to flag correspondent banking transactions that were suspicious.

The problem is that isolation forests are not very explainable, you don’t know why they flag something.

However, the bank found it unacceptable for the model to just report a transaction to an analyst.

The analyst would have engaged in the same behavior the Dutch office engaged in: find anything that was not 100% kosher. Of course, if you’re not 100% within the lines, it doesn’t mean you’re committing fraud. It can be as silly as forgetting to sign a form.

What I did back then was to develop a geometric model that would explain why the isolation forest model was flagging transactions.

Please do the same with models that can have nefarious effects. I don’t care if you’re wrong about my taste in fashion when I browse Amazon.

I very much care if my life gets destroyed though!

Posted on 26 Apr 2022

Disable Bluetooth on Mac before Sleep

The recent Monterey update (12.2), introduced a bug that drains the battery of my laptop while sleeping.

A fix is to disable bluetooth before putting it to sleep, but who remembers that?

Luckily, I use Launchbar to put the Mac to sleep: it has a very convenient Sleep action.

I then copied and updated the action to have it turn off bluetooth before sleeping.

How can you do the same?

First, install Homebrew.

Then, activate Launchbar (⌘ Space on my Mac), and then launch its index (⌥ ⌘ I).

In the general section on the left, click on Action. From there, use the search bar to find the Sleep action, disable its checkbox, right-click, and select Show in Action Editor.

Then right-click the Sleep action and duplicate it.

Once you have duplicated, rename it to Sleep BT (or whatever), click on Scripts, and click on Edit.

Replace the content of the script with

-- Sleep
-- LaunchBar Action
-- default.scpt
-- Version 3
-- Copyright (c) 2007-2016 Objective Development

tell application "LaunchBar" to hide
delay 0.5
do shell script "/usr/local/bin/ blueutil -p 0"
tell application "System Events" to sleep

The only new line is the one but last, do shell script "/usr/local/bin/ blueutil -p 0".

Save it, and you’re done!

Remember though: every time you wake the Mac up from sleep, you need to reactivate bluetooth!

Posted on 11 Feb 2022