Blog de François Becker

Aller au contenu | Aller au menu | Aller à la recherche

mercredi 30 septembre 2015

Compress a MP4 video using ffmpeg

This is the two-pass command, using a 2048k video bitrate:

ffmpeg -y -i <input>.mp4 -c:v libx264 -preset medium -b:v 2048k -pass 1 -c:a libfdk_aac -b:a 128k -f mp4 /dev/null && ffmpeg -i <input>.mp4 -c:v libx264 -preset medium -b:v 2048k -pass 2 -c:a libfdk_aac -b:a 128k <output>.mp4

samedi 21 mars 2015

Automate Octave script execution on save on Mac OS X

Let's say the octave script you are working on is located in ~/Documents/script.m . On save, you want it to be automagically executed by octave, including persistent figures.

Let's create a watchdog script ~/Documents/

while true
  ATIME=`ls -al ~/Documents/script.m`
  if [[ "$ATIME" != "$LTIME" ]]
    echo "Running octave script"
    echo "script" > ~/Documents/OCTAVEPIPE
  sleep 1

Make it executable: chmod u+x ~/Documents/

Don't launch it yet. We are missing the OCTAVEPIPE pipe. Create it with mkpipe ~/Documents/OCTAVEPIPE

Launch the watchdog in a shell: ~/Documents/ or ./ if you are in the same directory.

In another shell, cd to /Documents/OCTAVEPIPE) | octave --interactive

Now edit and save your octave script, it shoud be executed after less than 1 second.

lundi 12 janvier 2015

Activer le protocole aptX sur Mac OS X

Activer le protocole aptX sur Mac OS X :

dimanche 17 août 2014

A Complementary Learning Methodology For Foreign Language Vocabulary

It can prove difficult to estimate its own vocabulary capacities in a foreign language. It can also be difficult to find which words are still missing to its own knowledge: there is a need for targeting the words which are the most useful in the foreign language.

One can find frequency analysis of text corpuses (or "corpora" for pedants) online for instance on the Wiktionary project, originating from the Project Guteberg which works on a collection of public domain books. The words are ordered by frequency, and one can browse the list in order to find the first words we don't know — yet. Once discovered, these words can be added to flashcard-type learning softwares — these flashcards could even be provided pre-built so that adding one is easier.

One can then evaluate its own vocabulary level to the number of most-used words known.

Instead of working on a student-class level, this personalized method looks like one of the best complementary method for brute-force vocabulary upgrade. Though for the classroom it can set student level targets.

lundi 11 août 2014

Node.js and Javascript for newbies like me

Node.js is very handy for prototyping, with its NPM packages allowing to create services using HTTP, websocket, TCP, UDP, Bonjour/Avahi service declaration or discovery, each of these in only tens of lines.

Here are some "must read" for newbies:

And "could read":

Streams to follow:

What can be done:

jeudi 24 octobre 2013

De la startup

Quelques bonnes explications pour monter ou comprendre les startups.

jeudi 16 août 2012

HTML&CSS container of a maximized image

When developing a web gallery, it can be usefull to maximize the image to the screen, so that

  • the proportions are preserved
  • the whole image fits the screen.

Here is a method for that, in pure HTML & CSS.

#imagewell {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
<div id="imagewell" style="background-image: url('');">

dimanche 20 mai 2012

Une politique de gestion de ses mots de passe

Comment gérer ses multiples mots de passe ? Il peut être déconseillé de les écrire, d'utiliser le même de multiples fois, d'utiliser des mots du dictionnaire ; il est également souvent conseillé de les choisir complexes, inintelligibles et très longs, et de les apprendre par cœur. Autant de recommandations difficiles à concilier, et qui ne sont probablement appliquées par personne dans leur intégralité.

Lire la suite...

samedi 19 mai 2012

CSS Tricks

Here are some CSS tricks I use.

Reset the style:

* { margin:0; padding:0; }
h1, h2, h3, h4, h5, h6 { line-height: 100%; margin: 0.15em 0 0 0; }
li { line-height: 133%; }
p { margin: 0.5em 0; }

Always have a scrollbar, at right-hand side (otherwise centered colums "move" when switching between pages which do or don't overflow the screen):

html {
        overflow: scrollbars-vertical;
        overflow: -moz-scrollbars-vertical;
        overflow: -webkit-scrollbars-vertical;
        overflow-y: scroll;

Style the quote tag <q></q>:

q:before { content: "« "; color:grey; }
q:after { content: " »"; color:grey; }

See also other quotation mark glyphs.

Other nice CSS tricks:



This page will be updated with more tricks in the future.

mercredi 7 mars 2012

Find in files, recursively, using egrep

'Just using the blog as a notepad, but you may find it useful.

Here is how to find files according to content, or find a content out of many files, recursively. This is using the egrep tool, available on many operating systems, such at GNU/Linux or Mac OS X.

egrep "pattern" --include=*.txt .

You can adapt or omit the --include=*.txt part if you want to change or remove the file name requirement.

You can also add the -n switch if you want the line number to be printed.

samedi 28 janvier 2012

How to disable the F10 menu shortcut in Unity

In the newest versions of Ubuntu, Unity is the default user interface for GNOME. It introduces the controversial feature of a Mac OS X like menu bar. This menu bar is triggered by the F10 key shortcut; however, this shortcut is used in some desktop applications, for instance for the "step" functionality of Qt Creator's debugger.

To change or disable this shortcut, follow these steps:

  • open a terminal an launch gconf-editor
  • browse the tree to / > apps > compiz-1 > plugins > unityshell > screen0 > options
  • edit the value of the "panel_first_menu" key to another key (for example F12).

The new configuration should be immediately applied.