A Swiss Geek previously in Singapore, now in Portugal

Cors at the Edge

With the raise of API driven apps, CORS is becoming an unavoidable subject. By adding a CDN, your CORS rules become a burden on caching.

Creating a Serverless GeoIP API

Why build a GeoIP API when you can buy it directly from Maxmind or use their GeoIP Databases? Using the downloadable database works well when used on an instance. When you need it inside Lambda or Glue, it becomes difficult to keep it up-to-date. It becomes easier to use an external HTTP-API. Hosting it yourself reduces the response time by having it nearer to your apps and you can extend your service by combining multiples sources.

Read More…

MySQL: deleting a huge amount of rows

One of our MySQL tables has started to grow out of control with more than 1 billion rows (that’s 109). The table is a typical “Rails Active-Record table” with id as primary key (auto increment), created_at, updated_at and a few columns for the business data. The table has multiple indexes on various columns, some of them having a cardinality in the millions. created_at and status don’t have an index. The majority of results from Google, involved peoples with millions of rows and deleting them in batches of 1000. We had the problem amplified by 103.

Read More…

converting dynamic sites to static hosting

Why? Security and speed are the two main factors that made me migrate dynamic sites to static sites. I used to build some small sites without any framework using PHP to reuse common files (headers, footers, database connections) with some minimalistic administration pages to avoid to do vi over ssh to manage content. Security wasn’t a concern, Internet users where nice and respectful back then (or more probably I was young and naive). A badly done image upload can quickly become a hacker paradise. This little php snippet that sends out thousands of emails or worse runs brute force attacks against some powerful institutions.

Read More…

From Wordpress to Hugo

As mentioned in Going Static, I migrated my Wordpress blogs to a static site build with Hugo. Most articles on the subject convinced me that it would be easy. The truth is, it isn’t that straight forward. Content With help of a Wordpress plugin, exporting your posts and content is easy. The plugin adds the necessary front matter in Yaml format. But you still need to go through all your posts to update manually all image references. Depending on the amount of posts and images you have, this can be a tremendous task.

Read More…

Going Static

I hosted my blog with Wordpress on my own VPS. The amount of attacks and successful hacks on this blogs is enormous. Wordpress just suffers from notoriety and therefore becomes an easy target. Maintaining Wordpress up-to-date and add some tricks to minimize the risks just didn’t become worth the pain anymore. On top of that, maintaining a VPS to run Apache, PHP and MySQL to serve a few never changing posts didn’t make sense anymore.

Read More…

The Corporate Disease

The tech B2B world has changed in the last decade. It used to be sales talks to sales and agree on a product and price. Then give the job to the tech team. In a tech-startup, Geeks are King. They decide what’s useful or usable. If you can’t convince the geek, you won’t get the business. At Spuul, I am on geek-side of the chain, and too often I had to experience the lack of market knowledge from some corporations. If I have to spend endless hours in meetings, sign an endless trail of paperwork and involve all departments of the company just to be able to start testing a service, the game is not worth it. It doesn’t matter how good your product is or how well Gartner ranks you. You are just too much hassle.

Read More…

Photoswipe plugin for Koken

Yes, I know! Again an article about Koken! This time it is about front-end, something I am really not familiar not at ease with, Thanks Steve for your help and trying to convince me that async is not that evil. The default Lightbox functionality from Koken has always annoyed me. Specially in a mobile world where swiping has become a defacto standard. Enters Photoswipe.

Read More…

Koken: Serve assets through CDN

You can highly improve your site display speed by using a CDN. This is also true with Koken. Koken doesn’t provide a “out of the box” way to handle CDN, so I wrote a plugin to allow you to serve your Koken assets through edges closer to your visitors.

Read More…

Boost your Koken speed with client-side caching

Koken’s default caching behavior is non-existent. Apart from the Photos who have a 1yr cache policy, all other assets have a Cache-Control: max-age=0. With just a little bit of configuration, you can highly improve the user experience for your visitors.

Read More…