I’ve never taken cocaine or any other similar drug, but I imagine it as something that makes you a lot more productive at the cost of destroying your body and making it impossible to stop. I sometimes wonder if Claude Code works a bit the same. I’ve been actively using LLMs at work for ~6 months. We didn’t want to stay stuck with one model provider, so we tried various ones: one month with Claude…
When I started this blog 13 years ago*, I went with Octopress , a framework built on top of Jekyll with nice defaults. It had some features built-in that would have required various plugins in Jekyll, and I remember being quite happy about it. Unfortunately it didn’t last long, and its maintainer quickly abandoned it: the last commit is from February 2016. I kept it for a while because it still…
In 2023 I wrote only one article on this blog, but a few more on the tech blog of the company I currently work for, Bixoto: Deploy Mattermost on Dokku Add Let’s Encrypt SSL Certificates on Private Domains with Dokku Always encode your Requests payloads in Python Install avifenc on Ubuntu 20.04 How does Bixoto.com work? This explains why the present blog might look abandoned. It’s not, it’s just…
When using any library for Google Cloud you can specify a service account with GOOGLE_APPLICATION_CREDENTIALS , but unfortunately that doesn’t work when using gsutil in shell scripts. The documentation suggests to use gcloud auth activate-service-account , but that “activates” the service account for all gsutil invocations, and doesn’t work if you installed a standalone version of gsutil —without…
For the past three years I’ve been running a Twitter bot called @lemondeadit , a French equivalent of @NYT_first_said which tweets new words as they appear in the French newspaper Le Monde . The account was created in June 2019 but the first commit dates back to 2018. One day I might blog a bit about how it works under the hood, but today I’d like to talk about a small bug that made me crazy for a…
Python added support for type hints in 3.5. These are not typing as you may be used to in other languages since they have no effect on the compilation to bytecode nor at runtime, but rather hints for the (tools of the) developer. def print_int(n: int): print(n) print_int(1) print_int("foo") The code above doesn’t fail when you call print_int("foo") even though n is “typed” as an int . This is…
While working with Magento 2.3.6 on Bixoto I hit a weird issue: the bin/magento command-line tool was always eating all the RAM, even with a simple command: $ ./bin/magento --help PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /home/baptiste/.../vendor/magento/module-store/Model/Config/Placeholder.php on line 146 Check…
While following a tutorial to install Virtualbox in order to have docker working on macOS, I hit an issue where the docker-machine create command fails with an error that looks like this: VBoxManage: error: Failed to create the host-only adapter VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory VBoxManage: error: Details:…
Code-Golf is the art of writing the shortest program in a given language that implements some given algorithm. It started in the 90’s in the Perl community and spread to other languages; there are now languages dedicated to code-golfing and StackExchange has a Q&A website for it. In 2015, for example, I wrote a blog post showing how to write a JavaScript modules manager that fits in 140 chars (the…
For the latest StackExchange “time”-themed contest , I made a gif showing the evolution of StackOverflow from 2008 to today: (click on the image to play it again) The first step was to find a decent API for the Internet Archive . It supports Memento, an HTTP-based protocol defined in the RFC 7089 in Using the memento_client wrapper, we can get the closest snapshot of a website at a given date with…
Two weeks ago I created and put online a box plot of 73k movies durations across the time . It started with a question: “Are movies getting longer and longer?”. Spoiler: Not really, except maybe in the last couple of years. I used Wikidata’s online query service to export all movies then filtered those with both a publication date and a duration. This gave me a large JSON which I processed using…
Mattermost is a Slack -like self-hosted and open-source alternative. We use it at work but for some reason link previews don’t work. Before diving into Mattermost’s internals I wanted to see if I could write a quick workaround using the fact that Mattermost does show an image if you post a link ending with .png or .jpg . The Current Situation When you post an image link, Mattermost makes a request…
You’ve probably read this instruction quite a few times in online tutorials about installing command-line tools. What is this PATH for? Why should we add directories “to” it? This is the subject of this post. How the Shell Finds Executables When you type something like ls , your shell has to find what is this ls program you’re trying to run. Typical shells only have a handful predefined commands…
This post title sounds like a spam email subject but I was asked twice in the past three weeks where I buy my t-shirts, so here’s an answer that everybody can benefit from. Living in Europe means we can get quite high shipping costs on US-based websites. The highest shipping cost per t-shirt I ever got was $23 for two t-shirts and on some websites up to 40% of the total cost is due to shipping.…
For a lot of people, the GNU tar command’s options seem obscure and hard to use. The most common ones exist only in a short form and always appear grouped in the same order and often without a leading hyphen, e.g. tar xzvf archive.tgz and not tar -v -z -x -f archive.tgz . Additionally, tar doesn’t work without any “option”. These options, or rather these commands, can be seen as a (small) language…
This is the first post of a serie I’m starting about syntax quirks in various languages. I’ll divide each post in two parts: the first one states the question (mainly “Is this valid? What does it do? How does it work?”); the second one gives an answer. In Ruby, any sequence of 3+4n (where n≥0) percent signs ( % ) is valid; can you guess why? Here are the first members of this suite: %%% # n=0…
ES6 does provide modules ; but unless you’re using Babel you’ll have to rely on third-party libraries such as RequireJS until all major browsers support them. I use D3 everyday to visualize data about ego networks and have a small (400-500 SLOC) JavaScript codebase I need to keep organized. In the context I work in I must keep things simple as I won’t always be there to maintain the code I’m…
The easiest and most popular Bash pranks involve someone messing up with your ~/.bashrc . For example, here is a real-life example: #! /bin/bash b = ~/.bashrc echo >> $b echo "echo sleep 1 >> $b " >> $b If you execute this script, it’ll add a newline in your ~/.bashrc just in case it doesn’t end with a newline, then add this line: echo sleep 1 >> ~/.bashrc The effect of this isn’t immediately…
I started learning Python four years ago and have been heavily programming with it for near than a year now. In this post I’ll share some tools I use to ease and speed-up my workflow, either in the Python code or in the development environment. These tips should be OS- and editor-independent. I have some useful Vim plugins to work with Python, but that’ll be for another post. You might have to…
Command-T is a wonderful Vim plugin which allows you to open files with a minimal number of keystrokes . It’s really handy in a large codebase where you only have to type <leader>t , then a couple letters and press enter to open your file. It’s based on a fuzzy matching, which let you skip letters without worrying. I recently installed the plugin on another machine and noticed it was really low: I…
When I started writing Clojure, I couldn’t memorize the difference between conj and cons and always used one instead of the another. Their name are similar, but cons is used to add an element at the beginning of a vector, while conj is used to add an element at the end of it. How can one memorize this? I found a mnemonic trick over the time that helps me remember this. Here is it: The trick is to…
When plotting with gnuplot-py on OSX, I got an annoying warning saying that terminal aqua is unknown or ambiguous , even when I use a different terminal (e.g. postscript ). This terminal doesn’t exist on my Gnuplot installation (4.6.3). In fact, gnuplot-py uses slightly different files depending on your platform. OSX’s one is exactly the same as other UNIX-flavored OSes but its default terminal is…
Coveralls is a service that keep track of your tests coverage for you. It can notifies you when your coverage decreases under a custom threshold, and their bot comments on pull requests to report their tests coverage. Like Travis-CI, it allows you to add a badge to your readme with an up-to-date tests coverage percentage. If you already test your GitHub projects with a CI server like Travis, it’s…
Black-box testing is a method of software testing that examines the functionality of an application (e.g. what the software does) without peering into its internal structures or workings ( Wikipedia ). While it’s usually done at a system level, I think the most obvious place it should be used is at the function level. It’s even more efficient if you write tests for someone else’s code. Here is how…
I discovered a great feature in Vim today. While we generally use the same Vim settings everywhere, we sometimes (have to) contribute to projects with a coding style different of ours, and because nobody wants to edit their .vimrc everytime to switch between configurations, Vim allows you to have per project .vimrc ’s. This feature can be enabled with one line in your .vimrc : set exrc When you…
In this post, we’ll create a custom TLD for local development, and configure Apache to work with that. It’ll allow you to work on your local version of mysuperwebsite.com with the local domain mysuperwebsite.dev , with the exact same URLs, except that little .com which is replaced by .dev . This post is focused on OS X, but the tools used are available on Ubuntu and others. Additionally, you can…
When working with Internet protocols, we have to read RFCs a lot. They can be found on the Web, but it’s better to have them directly in the terminal. Ubuntu provide some packages to have them offline, but if you aren’t a sudoer, you can’t install them with apt-get . So I needed a little script to fetch RFCs from IETF’s website and read them locally. Here comes rfc rfc was initially a small Bash…
Spotify’s Web app is great, but you may prefer to use the desktop client. The problem is that the links default to the Web app. Here is a quick tip to make what you want. First, install Switcheroo . It’s a Chrome extension (Firefox users, go here ) that allows you to setup custom redirect rules for any http request, using a string replacement. Then, add a rule to replace http://open.spotify.com/…
The Urban Dictionary website is pretty useful when one wants to know the meaning of any familiar or slang word. Users can write definitions for any words, and upvote or downvote them. Unfortunately, the website doesn’t have a public API, and I couldn’t find a command-line tool for it. So I wrote one. Introducing ud ud is a command-line tool which prints definitions from the Urban Dictionary…