Up2, a NanoStation game

A while ago, I received an odd little piece of hardware in the mail. It was a birthday present from my friend Florian, the NanoStation. Along with it was a letter. Florian challenged me to make a game for it. I knew that the hardware was very limited and I wanted to see how much I could push it. So, I decided to make a platformer – …okay, the truth is, it was actually because I love platformers!

Hiding properties in JS... for real

Sometimes, you want to hide the property of an object1. Probably you are a library author and you are afraid that: your users will see it and attempt to use it your users will try to enumerate over it although it might not make sense So here is what you do: const protectedObj = Object.defineProperty({}, 'foo', { enumerable: false, configurable: false, writable: false, value: 'hi there' }); console.log(protectedObj.foo); // 'hi there' console.

WebRTC: the future of web games

At some point in JumpSuit’s development I realized it was impossible to create the game we envisioned: WebSockets are just too slow, because they sit on top of TCP. While it is possible to write moderately fast-paced games with them, such as the enormously successful Agar.io and Slither.io, if you need low-latency, WebSockets won’t cut it. So I started looking for alternatives. WebRTC is currently the only way a browser can exchange with the outside world in UDP-like fashion – disregarding Flash.

Hoisting in JavaScript

This behavior can surprise beginners to JavaScript, and also, I admit, people like me who learned JavaScript by doing. So what is hoisting about? Concisely put, it means that every variable declared in a scope is actually declared when entering the scope, no matter where you choose to put the declaration. In the following examples I’m going to create a function to define a scope, but this can be applied to every scope, the global scope, a scope you define with { and }, etc.

SMS Watchdog

My mobile carrier offers access to an API that can send SMS to its users. With systemd’s timers, I have been able to make a script that warns me when the load on my server is too high! Basically, timers work by stating a service repeatedly; which in turn starts a script in this case. This shell script is responsible for checking the load and sending a SMS. Of course, you can have it send you a mail too.

Mon projet d'ISN : Mario Kombat

Lors de ma dernière année de lycée, dans le cadre de l’option ISN, j’ai réalisé en groupe un projet sur lequel nous avons été notés au Bac (j’ai eu 20/20). À la fin de l’année nous devons rendre un dossier papier, que voici. Je le poste ici car il y a des choses intéressantes dans ce projet (les trucs sur la reliabilité), et de plus il peut sans doute aider les futurs lycéens à s’en inspirer pour structurer leur dossier.

A virtual webcam

There are a lot of fun things you can do with Linux. What I propose you today is to stream an arbitrary video as if it were your webcam and microphone output. I’d like to thank Osqui LittleRiver who nicely sent me a mail with the last missing piece of this little experiment! Setup a virtual webcam First, install v4l2loopback. It’s a kernel module for Linux we will use to create a virtual webcam.

Privilege escalation with setuid

What are setuid and setgid? When applied on executable (and shell scripts if it’s not disabled), setuid is a mechanism in UNIX systems to allow an user to execute a program with the owner’s permissions. Setguid is the same principle, but we get the group permission instead of the user’s. If you want too know more about it or setgid (that we won’t use), read the Wikipedia article. In this article we will create a C program we will run as a normal user, and thanks to setuid it will spawn for us a shell (as root!

Hyphens in UNIX filenames

Today I discovered an interesting UNIX design flaw. UNIX deals badly with files starting with -. Let’s mess around! Warning: do like me, create a new directory and cd into it. $ mkdir tests && cd tests $ touch -r touch: usage: touch [-alm] [-t time_t] <file> Okay, so I can’t create a file starting with a -, because touch thinks it’s an argument. There are several ways around to create this file: