User Tools

Site Tools


This is my technical blog where I post about various stuffs. Take a look at my resume if you want to know more about me.

GLSL demo - shadertoy

Shadertoy clone done in C.

Check it on GitHub :

Here is an example shader based on iq work.



On the second video, I show with a colored scale (blue - red) the number of iterations per pixel. (blue : less, red : more)

Secure Surfing

Here is multiple methods to have a secure internet connection :

All these methods can be set up on a Raspberry Pi. Let's assume it can be accessed on on any ports.


You need a SSH access on the Pi and an opened port (here, 8080) :

ssh -D 8080

This command opens SOCKS server. You can use it to tunnel your traffic.

Firefox usage

Edit → Preferences → Advanced → Network → Connection → Settings…

Then in the URL bar, go to : about:config

And change “network.proxy.socks_remote_dns” to true. (There is a graphical button for this in Firefox nightly 30.xx next to SOCKS radio buttons)


I followed this wiki :

I didn't used everything. I will explain my procedure later.

Once the server is running, generate keys for your clients.

(see this :

./build-key client-name

Copy for “client-name” :

  • ca.crt
  • ta.key
  • client-name.crt
  • client-name.key

And create client-name.ovpn file :

dev tun
proto udp
remote 1194
resolv-retry infinite
user nobody
group nobody
ca ca.crt
cert client-name.crt
key client-name.key
ns-cert-type server
tls-auth ta.key 1
verb 3

Put these 5 files in the same folder and load client-name.ovpn in any OpenVPN client :


Install Privoxy :

pacman -S privoxy

Configure it to fit your needs by editing “/etc/privoxy/config”. I only changed “listen-address” parameter. By default it will listen to localhost on port 8118.

Run Privoxy :

systemctl enable privoxy.service
systemctl start privoxy.service

Chromium usage

chromium --proxy-server=""

Android usage

In the app, set :

  • Host :
  • Port : 8118
  • Proxy Type : HTTP

It can be configured to auto connect when using 3G or WIFI connection.

A lot more stuffs about it here :


Let's assume your ownCloud instance is accessible on

As always, there is still Archlinux wiki :

Android sync

Here, with an account “user” :

Calendar sync

Use this app :

Add a caldav account and set remote address (with a calendar named “calendar_name”) :

Contacts sync

Use this app :

Add a carddav account and set remote address (with an address book named “addressbook_name”) :


Better using DAVdroid now.

If https is used with a self signed certificate, CAdroid can be used too.


Line filter JS

A little JS experiment allowing to filter curves drawn by mouse.

Try to draw something (it should be a loop, or strange things can happen) and hit “Draw FT”.


  • raw points
  • raw curve
  • filtered curve

HTML5 video

Memo for encoding video in various formats for HTML5.

-vb parameter should be adapted if quality is too low (video bitrate).


ffmpeg -i video_src.format -vcodec libx264 -preset slow -crf 24 video.mp4


ffmpeg -i video_src.format -vb 800k -vcodec libtheora -g 30 video.ogv


ffmpeg -i video_src.format -vcodec libvpx -vb 400k -maxrate 8000k -bufsize 1000K -minrate 10k -qmin 3 -qmax 30 -rc_lookahead 16 -keyint_min 0 -g 360 -skip_threshold 0 -level 116 -preset slow video.webm


<video width="1280" height="720" controls="controls" >
    <source src="video.ogv" type="video/ogg">
    <source src="video.webm" type="video/webm">
    <source src="video.mp4" type="video/mp4">

Usage in Dokuwiki

Modification of html5video plugin allowing usage of multiple video formats :

{{ videos:vid.webm|videos:vid.ogv|videos:vid.mp4|320x240|loop }}

Email backup

Here is some details about my email backup system hosted on my Raspberry Pi. The purpose of this backup system is to allow access to this backup with IMAP.

I use dovecot as IMAP server and mbsync to sync IMAP account on the Pi.

First, install needed packages, Archlinux way :

pacman -S dovecot
yaourt -S isync-git

Dovecot setup

I changed a few things : protocols served, listen address, ports

vim /etc/dovecot/dovecot.conf

Only enable IMAP :

protocols = imap

Disable ipv6 :

listen = *

vim /etc/dovecot/conf.d/10-master.conf

Ports can be changed in “inet_listener imap” and “inet_listener imaps” sections if needed.

Run the service :

systemctl enable dovecot.service
systemctl start dovecot.service

Now we will suppose you are logged with “user” on “”. It means your IMAP account will be accessible through your dovecot server with email “”.

Maildir setup

Create a directory to put mails in (Maildir format) :

mkdir -p ~/.mail/INBOX
cd ~/.mail

Next, create a mbsync config file for each account you want to sync. In this example, we use :

vim .mbsyncrc1

User login
Pass pass
UseIMAPS yes
CertificateFile /etc/ssl/certs/ca-certificates.crt


Path ~/.mail/INBOX/
#Inbox ~/.mail/INBOX/

Patterns *
Create Both
SyncState *

“Inbox” command is commented here. This commands helps mbsync by telling it where is INBOX, because with some providers, it can't find it. Here, doesn't need it.

Providers needing “Inbox” command :


Create directories to store mails about :

mkdir -p INBOX/{cur,new,tmp}

cur, new and tmp are used to have a valid Maildir folder.

You can reiterate by creating another mbsync config file for another email account.

Ex : .mbsyncrc2, .mbsyncrc3, …

You can check Archlinux wiki page for some details about mbsync :

Once your mbsync config files are done, write a little script to update everything :


cd ~/.mail
for i in $(ls .mbsyncrc*)
        mbsync -c ~/.mail/$i -a

Your logins and passwords are stored in plain text in the config file, so protect it by making it readable only by your user :

chmod 600 .mbsyncrc*

Update with cron

crontab -e

07,22,37,52 * * * * ~/.mail/

Here, it is updated every 15 minutes. I use these strange values to avoid running the same time of another cron job.

Access with Thunderbird

Add an email account using “” as email, user as login, as IMAP server. You have to put a dummy smtp server to let Thunderbird enable the creation of the account.

Once it's ok, you should see all your emails in subdirs like “” in the Inbox.

Remember, as is, it can only be used to receive emails. And every action done on “” is synced. So if you delete some emails, they will be removed from the master server (in this example, !

Game Dev Party : Les 5 gardiens

Here is the game we developed at the Game Jam 5.

It's a webapp done with html5 and javascript (webgl using three.js).

Here is a live demo here : Les 5 gardiens



Bash and Linux tips

I put some tips and stuffs about bash and linux here.

Find all extensions in $folder :

find $folder -type f -name "*.*" | awk -F. '!a[$NF]++{print $NF}'

Autosuspend script for server :

Batch subtitle download :

To have fr and en subtitles :

for f in *.avi; do subdl --lang=fre "$f" ; done
for f in *.avi; do subdl --lang=eng,fre "$f" ; done

Pictures and videos encode script :

Keyboard layout in gdm

Edit Option “XkbLayout” in /etc/X11/xorg.conf.d/10-evdev.conf :

Section "InputClass"
        Identifier "evdev keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "evdev"

        Option "XkbLayout" "fr"

Cloth simulation

This is a simple cloth simulation in C++, OpenGL, GLSL. This is a spring-mass system with some eye-candy stuffs like per pixel lighting, shadow map. It also uses OpenMP for parallelization in critical parts.


In this video, there is a wind force.

In this one, one attach point of the cloth is moved by the user.

Sublime Text

As a memo, here is my Sublime Text config file :

// Sublime Text config file : Preferences -> Settings - User
    "color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
    "ensure_newline_at_eof_on_save": true,
    "font_face": "Consolas",
    "font_size": 11,
    "move_to_limit_on_up_down": true,
    "shift_tab_unindent": true,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
    "file_exclude_patterns": [".tags", ".tags_sorted_by_file", ".gemtags"]

To use ctags, first install “Package control” using this :

Then do :

  • type : ctrl+shit+p
  • type : ctags
  • press enter
  • it's installed !

Then, in your project, you can use ctrl+shit+p and filter with “ctags” to see available commands (like rebuild tags). After, it is possible to use alt+shift+s to find any symbol in the project.

Augmented Reality

Coming soon…


Munin installation on archlinux

It follows mostly archlinux wiki. Just adding some tweaks.

First tweak is to change permissions to /var/log/munin. Else, munin-cgi-* can't write logs there and hangs.

chmod 777 /var/log/munin

Maybe lesser permissions could be used, but I should take a look for that. (I think multiple users write to this folder : root, munin, http)

Next tweak is for cgi graph. Same permission problem : user http needs write access to /var/lib/munin/cgi-tmp/ :

chown -R http:http /var/lib/munin/cgi-tmp

Munin installation on debian

First, install needed packages :

apt-get install munin munin-node

Edit munin config file to set the hostname of the machine to monitor :

vim /etc/munin/munin.conf

# a simple host tree
[localhost] -> change to [yourhostname]
    use_node_name yes

Configure nginx :

vim /etc/nginx/sites-available/munin

Here is the config :

server {
    #listen 80;
    root /var/cache/munin/www/;
    index index.html;

    location / {
        try_files $uri $uri/ /index.html;
    # TODO : enable cgi graph

Enable the site :

ln -s /etc/nginx/sites-available/munin /etc/nginx/sites-enabled/

Restart services :

service php-fastcgi restart
service nginx restart

Enable munin service at boot : (TODO)

update-rc.d ...

Start service to test now without reboot :

service start munin
service start munin-node

Data gather is done using cron every 5 minutes

smartctl plugin fix

smartctl patch : /usr/share/munin/plugins/smart_:127

Thresholds should be adjusted.

Plugins management

Plugins in munin are activated by putting a symbolic link in /etc/munin/plugins/

It can be verified with this :

ls -l /etc/munin/plugins

To disable a plugin, remove the symbolic link.

Ex : to remove entropy plugin :

rm /etc/munin/plugins/entropy

To enable it again :

ln -s /usr/share/munin/plugins/entropy /etc/munin/plugins/

Open Destruction Derby

This game is a 1995 Destruction Derby clone. The main goal is to crush into opponents cars and make them spinning to earn points. Or you can simply destroy the cars or try to survive in the arena ! Like in the original game, cars deform and there is smoke and tire tracks everywhere !

Everything is pure C and OpenGL (all below OpenGL 2.0, mostly vertex arrays). Physics interactions are self made using a lot of dot products and squared distances. Car models are homemade using blender and textures using Gimp.




DCS headtracker

Here is my modification of a headtracker for DCS. It's working with freetrack and opentrack.

You can check it out on github :


start.txt · Last modified: 2015/06/19 23:39 by popux