rand(Ø)

> beautiful code & photos

about <

CSP Header Hacking for Apache2

Hello,

I write here to report my latest dirty hack. Story—

While enforcing our HTTP server configuration at work, we are slowly implementing CSP policies and one of them allow Web browsers to report violations to a given endpoint.

At this moment, we are only at the reporting step of the implementation because the first time we attempted to roll this header out, it ended up breaking our staging env.

So, it's recommended to set the Content-Security-Policy-Report-Only header.

This header takes the report-uri directive which allows the browser to push the violation findings to a given endpoint.

For this example:

> Continue Reading

Upgrading in a few commands

It has been over a year now that I migrated my 2 blogs on full Docker-hosting and I wanted it to be as simple as possible for several reasons:

  • Docker is easy to work with and to maintain
  • Everything is Dockerizable
  • I don't want to spend more than an hour every month or so to upgrade my stacks

At work, we previously used CoreOS to deploy a fleet of Dockerized apps but it was hard to maintain but more specifically, CoreOS is designed for distributed apps, which is not the case of this blog.

So, I searched for a simpler

> Continue Reading

Blue Monday

Lundi matin 5h30.

Merde, je suis déjà réveillé. Mon cerveau est déjà en route, ou alors ne s'est pas arrêté la veille. Cela me fait penser à tous mes amis qui n'arrivent pas à trouver le sommeil. Il fait froid mais j'ai trop la flemme d'aller chercher le plaid. Aller Joris, une grosse semaine se présente à toi et il faut dormir.
Tant bien que mal je parviens à me rendormir...

8h00 : le réveil sonne et là, c'est dur. J'ai rêvé entre temps de choses très désagréables, un vieux sentiment d'abandon me fait frissonner et je n'ai qu'une hâte : vérifier

> Continue Reading

Ghost: How I moved my images to Cloudinary

For the past two weeks, I have been very busy moving all my Ghost apps images over to Cloudinary. As you probably know, my Photography Portfolio is running with Ghost and even there is not a ton of content, I needed to ensure it could meet these requirements:

  1. Deliver top quality images faster than my hosting solution
  2. Support RetinaJS assets upload via Ghost

If I was pretty confident with the 1st requirement, the 2nd was a tricky one in addition to move all existing content in Cloudinary.

A new Cloudinary storage adapter for Ghost

I looked for existing

> Continue Reading

MySQL: Table count for all databases

Answers I found on the internet were all based on the table information_schema.tables but truth is, this table contains table schemas of databases, not the database list.

What happens when you also need to include databases with no table?
Answer with this query:

SELECT SCHEMA_NAME AS 'Database', COUNT(information_schema.tables.TABLE_SCHEMA) AS 'Table Count'
FROM information_schema.SCHEMATA
LEFT JOIN information_schema.tables ON information_schema.tables.TABLE_SCHEMA = information_schema.SCHEMATA.SCHEMA_NAME
WHERE SCHEMA_NAME NOT IN ('mysql', 'information_schema', 'performance_schema', 'tmp')
GROUP BY SCHEMA_NAME;
+----------+-------------+
| Database | Table Count |
+----------+
> Continue Reading

Chakram & JSON schema structuring

I know, Chakram is old (no update over a year) but I use it in one of my project because along with Mocha and Chai, it makes a pretty powerful tool for a NodeJS functional testing stack.

For the past few hours, I've been trying to reference a JSON schema from another one stored in the very same directory.

Understanding the documentation about structuring JSON schema is pretty straightforward but in real life, it gets more complicated when you don't fully understand how it really works (and I still don't, don't get me wrong).

The issue

Let's say, I have

> Continue Reading