Skip to content

aToaD #17: scripts on + roundmypic

Online various string conversion, like base64 to hexadecimal

I’ve been having issues creating tokens for the Apple Push Notification Service, and among other thing the app would sometimes produce base64 tokens. The library I use for sending the pushes from the server requires base16 / hexadecimal tokens, and also I found that checking the validity of base64 tokens is a bit less obvious than the base16 ones although I suppose that’s more of a personal convenience. Anyhow, so I searched for a convenient online tool to convert between the 2 formats, and eventually I found those tools on, with a base64 to hexadecimal converter but also quite a few others (hex to base 32, ASCII, DEC, etc, etc). There it is:

While I’m at it, on another topic but I don’t think it would deserve a separate post, a tool to easily round the corners of a picture (great to produce an application icon for Android) without shadow or other fancy effects (although there’s an option to add bevel effect). I found that a “Round Size” value of about 10% of the picture size looks decent (e.g. if width and height=1000px, round size=100px looks okay IMO). There it is: Round My Pic

Posted in A Tool A Day.

Apache 2.4: solving AH00125 (Request exceeded the limit of 10 subrequest…)

So I’m yet again in the middle of a painful Apache configuration, and with the major update (from version 2.2 shipped with Debian 7 to version 2.4 shipped with Debian 8) come the major annoyances as usual. When loading folders with no index.htm/.php, I noticed Apache threw errors at me instead of simply diplaying “Forbidden”. Something just like:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

So I checked the log and saw quite a few of these:
AH00125: Request exceeded the limit of 10 subrequest nesting levels due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

I suppose this recursivity accident can be caused by a various amount of causes. In my case the problem came from a misconfigured DirectoryIndex (in mods-available/php5.conf) : I had added a comment at the end, which used to work without issue in Apache 2.2.

DirectoryIndex index.html index.htm index.php #(seems optional now)

But apparently # is a valid character and not a comment starter if not at the beginning of a line, so in Apache 2.4 it creates that AH00125 error when loading a folder with no DirectoryIndex. As my own comment said, this line seems optional now, so for me the fix was just to remove it. Now I’ve got another error, but it seems quite unavoidable (“AH01276: Cannot serve directory /home/xxx/: No matching DirectoryIndex (index.html, index.cgi,, index.php, index.xhtml, index.htm) found, and server-generated directory index forbidden by Options directive“). Or maybe I should just put an empty index.htm file in there.

Source where I found the solution: Mailing List Archive: Apache: Dev – How to help users diagnose invalid # in DirectoryIndex?

Posted in servers.

Tagged with .

aToaD #16: WebODF

Open source Javascript-based editor for OpenDocument files

I remember getting a request some time ago to add slideshow viewing capacity to some website. At the time I didn’t really find anything good and just messed around a bit with LibreOffice’s (very limited) capacity to export a document into HTML.

WebODF seems to offer a much more satisfying option, although I assume it will “only” deal with OpenDocument and not MS Office stuff. A list of features is available here (online demos available on the same page), but long story short it allows for editing OpenDocument files or to just view them (like, display a LibO Impress slideshow).
Something great about it is that it’s impressively compact, the main javascript file, webodf.js, is smaller than 500 KB at the moment!

Posted in A Tool A Day, LibreOffice & OpenOffice, web development.

aToaD #15: Subtitle Edit

Open source (FLOSS) subtitle editor

I recently wanted to merge 2 subtitles files so as to adapt them to a video file that was a merge of 2. Which means I had to basically postpone all subtitles of the second part by the duration of the first part. I eventually found Subtitle Edit, which is open source and seems very feature-complete even though I only used a couple.

It seems to be well maintained, version 3 has been around since 2010 and the latest update was only a few weeks ago. It notably offer tools for automated error detection/fixing (like overlapping texts), can automatically merge short lines, split long lines, renumber lines (useful in my case since I was merging two files numbered starting at 1)… It makes synchronization really easy, for instance by setting a first point then a second point, it will adjust position and speed so that everything matches (and if speed is already good, you just need to set one point and it will adjust position only). I think now that I’ve found this I have a few subs that could benefit from that sync 😉

Last but not least, it also has a spellchecker and can auto translate via *cough* Google.

Posted in A Tool A Day, multimedia.

How to convert a video to OGV/MP4/WebM

I recently had to use the jquery.videoBG plugin for a site I work on. It is quite convenient as it does all the handling of various browser compatibility with different video formats so as to display a video in the background of the body or a div. However, of course, you have to provide it with the appropriate video formats, and that’s where things get a little bit more complicated.

My source file was .mov. For the various browsers, I needed an mp4 file, and ogv file, and a webm file.

MP4 is easy, my usual video compressing software, Handbrake, supports it (although I usually use it to obtain MKV).

Ogv and WebM are a bit less obvious, Handbrake doesn’t support them and apparently it’s easy to get lost in the jungle of video converters. I eventually settled for ffmpeg, which is command-line based but otherwise great (NB: as mentioned on the download page, “if you are confused about what build type you need just download a static build”).
A nice trick in ffmpeg is that you can demux and remux without re-encoding the streams. The syntax for this is, for instance:

ffmpeg -i inputfile.mkv -codec copy outputfile.mp4

So, all I need now is some video streams accepted by ogv and webm.
Ogv requires a Theora stream. And luckily Handbrake can provide that, so I can create an mkv file with a Theora video stream in it and then remux it to ogv with ffmpeg.
WebM requires a VP8 or VP9 stream. Handbrake can provide VP8 (sadly not VP9 yet), so again I can create an mkv file with VP8 video and then remux it to webm with ffmpeg.

Well, that’s all, problem solved. Here are what the commands would look like in ffmpeg although that’s probably obvious:

ffmpeg -i inputfile-with-theora-vid.mkv -codec copy outputfile.ogv
ffmpeg -i inputfile-with-vp8-vid.mkv -codec copy outputfile.webm

Posted in multimedia, open source.

Solving “Element link is missing required attribute property”

I use the W3C validator to check my HTML 5 documents, and somewhat recently this new error appeared, saying “Element link is missing required attribute property.”
After a bit of research, it turned out that, if a <link> tag is NOT inside the <head> section of the document but is in the <body>, then the validator wants an additional property attribute. Probably even easier with an exemple:

When inside the <head> section you would write:
<link rel=”stylesheet” type=”text/css” href=”css/myStyle.css”/>

But when inside <body> you’ll write:
<link property=”stylesheet” rel=”stylesheet” type=”text/css” href=”css/myStyle.css”/>

And voilà, no more error in the validator 😉

Posted in web development.

A possible workaround to Alt Gr not working in Windows

Since a few months, I’ve had that issue where Alt Gr randomly stops working in Windows 7. This is a major hassle because Alt Gr is needed for very common characters when programming (#, {, }…), and also, of course, for “@”. A first solution is to use Ctrl + Alt + [key] as a replacement for Alt Gr + [key], but this isn’t nearly as convenient.

According to various posts here and there, this can be caused by third party software, notably some drivers, stealing keyboard shortcuts. In my case I couldn’t identify a culprit: the issue appeared apparently without a recent update, shutting down running stuff didn’t help. Also the issue is really random (sometimes it occurs, sometimes it doesn’t) and is usually solved simply by rebooting.

I haven’t found a permanent solution, however I found a method much faster than a reboot: switching keyboard language back and forth. I have to keyboards layouts installed, and when I switch from one to the other (NB: the shortcut to do so is Ctrl + Shift), Alt Gr starts working again. So double switch brings me back to my current layout, with Alt Gr working. And so far, it then never disabled again until at least the next reboot.

Of course if you find a more permanent solution, such as a utility to find which program is responsible for causing this mayhem, I’d be glad to hear it in the comments.

Posted in Windows.

aToaD #14: ideone and codeboard

Well that’s 2 tools instead of one, but they seem a bit overlapping and a bit complementary at the same time. lets you submit small code snippets in order to test them (live compilation and run). They support about 60 languages (I didn’t count myself, but that seems quite accurate from their impressive list), from the classic C(++)/PHP/Java/Javascript/… to the more uncommon R/Octave/Scala/… and even quite a few I had never heard of before (bc/Unlambda/…) lets you work online on whole projects. They seem to be very recent (a project I created about a month about was ID 1500-ish while another project I created a few days ago was ID 4500-ish), and they only support 6 languages so far: C, C++, Eiffel, Haskell, Java, Python.

Nothing much to add… just give them a try whenever you need a quick way to test your code without setting up a whole development environment 😉

Posted in A Tool A Day, programming.

Bloquer les pubs sur OVS le retour – DEFCON 1

(NB: exceptionally, this article is written in French because it’s targeted at a French, non-English speaking audience – sorry for the inconvenience)

Il y a quelques mois, OVS chamboulait son systĂšme anti-anti-pub. AprĂšs quelques recherches, j’ai mis au point une mĂ©thode de contournement lourde mais imparable. Cependant entretemps OVS avait dĂ©jĂ  allĂ©gĂ© sa mĂ©thode, permettant un contournement simple, d’abord par l’usage de Ghostery seul Ă  la place de Adblock + Ghostery ou d’Adblock seul, puis par la simple mise Ă  jour des filtres AdBlock, qui ont Ă©tĂ© adaptĂ©s par le mainteneurs du projet. Je me suis donc contentĂ© de publier ces conseils, + un script Greasemonkey juste pour le fun.

Seulement voilà, ce matin surprise, Ghostery (ou Adblock Plus ou Edge avec les filtres mis à jour) sont détectés à nouveau. Il est temps de recreuser un peu les méthodes.

MAJ du 4 mai 2015 : la mĂ©thode 1) ne marche pas encore, la mĂ©thode 2) ne marche plus… reste la mĂ©thode 3) qui marche trĂšs bien : la seule raison pour laquelle je l’ai mise en 3) et qu’elle est un peu complexe pour un novice en informatique

1) Solution triviale mais pas immédiate, et incomplÚte

Attendre qu’AdBlock mette Ă  jour ses filtres 😀

2) Solution rapide, facile mais incomplĂšte Ă©galement

Utiliser Ghostery et dĂ©sactiver AdBlock. Dans Ghostery, mettre en liste blanche pour OVS le tracker “SMART Adserver”.
Screenshot parametres Ghostery
Vous serez désormais pistable par, mais vous ne verrez pas ou peu de pubs.

2.bonus) DĂ©tails techniques pour les curieux

Une des 2 protections anti-anti-pub consiste à créer un object smartadserver et à vérifier son existence:

sas.setup({ domain: ''});
if(typeof sas === 'undefined'){document.location='ovsadblock.php?test=sas&nav='+window.navigator.userAgent;}

La seconde est dans le mĂȘme genre, mais teste simplement un objet diffĂ©rent:

if (!(document.getElementById("my-smartads")))

3) Solution lourde mais ultime

Avec cette mĂ©thode, vous pourrez toujours vous en sortir mĂȘme quand 1) et 2) seront, Ă©ventuellement, mis en Ă©chec (il faudra juste adapter le script le cas Ă©chĂ©ant). En revanche elle nĂ©cessite l’installation d’un logiciel supplĂ©mentaire, voire d’un navigateur aditionnel si vous ne voulez pas interfĂ©rer avec votre surf sur les autres sites. Par souci de complĂ©tude je vais donc ici prĂ©senter la mĂ©thode avec l’utilisation d’un navigateur aditionnel.

3.1) Installer Firefox ou un dérivé (fork)

Je connais 2 grands forks de Firefox qui ont la caractĂ©ristique intĂ©ressante de pouvoir tourner en parallĂšle avec lui: Cyberfox et Palemoon. Selon ce que vous utilisez dĂ©jĂ , installez un de ces 3 navigateurs, puis configurez-le, dans les paramĂštres rĂ©seau, pour utiliser un proxy HTTP (la capture d’Ă©cran ci-dessous provient de Firefox 37).
Screenshot parametres proxy HTTP Firefox

3.2) Installer Fiddler

Fiddler est un freeware qui permet, entre autres, d’intercepter et modifier le traffic web. Nous l’utiliserons donc pour intercepter le traffic provenant d’OVS et retirer le(s) code(s) de protection anti-anti-pub avant de charger les pages dans le navigateur. Ainsi, la protection saute et on peut naviguer tranquillement :)

Fiddler est téléchargeable gratuitement ici. Le site demande un e-mail, mais vous pouvez laisser la case vide.

Installer Fiddler (Ă  l’heure oĂč j’Ă©cris ces lignes, la version actuelle est, puis dans Tools → Fiddler Options → Connection, configurer “Fiddler listens on port:” Ă  9901. Cf la capture d’Ă©cran ci-dessous.
Screenshot parametres Fiddler

Dans la fenĂȘtre gĂ©nĂ©rale, allez sur l’onglet “FiddlerScript”, et remplacez le contenu du script par le contenu de ce fichier: OVS-Fiddler-CustomRules-20150501.js.txt. N’oubliez pas de cliquer sur “Save Script” ensuite (vous devriez entendre un bip).

Et voilĂ , le tour est jouĂ©, vous devriez pouvoir charger OVS dans votre nouveau navigateur (n’oubliez pas d’y installer AdBlock et/ou Ghostery, selon vos prĂ©fĂ©rences, sinon Ă©videmment vous auez les pubs :D)

3.3) Remarques (lisez si ça ne marche pas) et détails additionnels

Ca fait longtemps que j’ai rĂ©alisĂ© ma premiĂšre installation de Fiddler, du coup je ne me rappelle plus des paramĂštres par dĂ©faut. Il est possible en particulier que le script modifiĂ© ne soit appliquĂ© qu’au redĂ©marrage de Fiddler (donc si le script ne semble pas appliquĂ©, redĂ©marrez Fiddler, ça l’appliquera alors Ă  coup sĂ»r).

Il y a, dans la barre d’outils, un gros bouton “Stream” (pas visible sur ma capture d’Ă©cran car le menu ouvert est devant) : assurez-vous qu’il est dĂ©cochĂ©. Sinon, le traffic sera envoyĂ© au navigateur AVANT d’y appliquer les modifications du script (oui, moi aussi ça me semble un peu idiot comme paramĂštre… mais bon c’est comme ça).

Si malgrĂ© tout, ça ne marche toujours pas, n’hĂ©sitez pas Ă  poser vos questions en commentaires (avec captures d’Ă©cran si possible, vous pouvez les hĂ©berger facilement sur par exemple).

Last but not least, Ă  propos de mon script Fiddler, en fait la seule zone qui change par rapport au script par dĂ©faut, c’est le contenu de static function OnBeforeResponse, autour de la ligne 278. C’est lĂ  que sont rĂ©alisĂ©s les traitements sur la page avant de la transmettre au navigateur.

Enjoy! :)

Posted in privacy, programming.

Tagged with .

Epson Perfection 1660 Scanner Driver for Windows 7 64 bits

So I have this very old scanner (Epson Perfection 1660 PHOTO), which still works great but for which no drivers are provided for Windows 7. Somehow, a long time ago, on an old PC of mine which I still have, I did manage to install some kind of driver, on Windows 7. I really don’t remember how/where I found it, though (maybe I managed to install a version targeted at another OS – but I tried that again and it didn’t work), and I wasn’t able to find the proper installer.

Gladly, there are programs that allow you to extract installed drivers. The one I used is Double Driver. Download links on the official website are broken, so I mirrored the latest version (4.1.0 portable) here. There is also Driver Extractor, but I find it a lot less convenient (I didn’t even manage to find the scanner in their “ordered” list).

Finally, if you need the Windows 7 x64 drivers for your Epson Perfection 1660, here is the version extracted by Double Driver. I didn’t manage to install it directly. What I did was I plugged the scanner, then I went to “devices and printers”, right-clicked the scanner, then PropertiesHardware tab → Properties button → Driver tab → Update Driver (or just “Update”) button, then chose “browse my computer for driver software” and navigated to where I unpacked my archive with the driver. The wizard should then pick the right file and be able to install the driver.

Driver version is and is dated 2006-12-21 as shown in screenshot below.

Screenshot of Epson Perfection 1660 PHOTO driver tab

PS: from what I read while looking for a way to obtain the driver (before getting the idea to grab it from the old PC), it seems fairly likely that this driver may also work on Windows 8 or 8.1.

Posted in drivers, Windows Se7en.