Fabrice's web : CV · Blogs (⇢ Madrid · ⇢ Science · ⇢ Everything)

# Blog: Hacks

This is a collection of tricks, scripts, one-liners, patches, hacks of all sort & anything related to computers and computing. Try at your own risks!

## mp3 files in mediawiki without flash

Flash is no longer supported, maybe the worst thing to happen in 2021 (and there's a pandemic going on). Among some of the best things to go, the fantastic lightweight, efficient and elegant dewplayer to play mp3, which served us so well all this time! (the site says that "Dewplayer n'est plus, mais renaîtra, un jour. «When it's done»). You'd think mediawiki would offer tons of replacement. Strangely, it turns out to be quite difficult to find how to bring mp3 to your wiki! (see what's available). HTML5 is the solution.

## Starting a counter in mediawiki without extension

Say you want to count like this in mediawiki (not starting at 1):

1. Three
2. Four
3. Five

The internet tells you it's not possible natively and that you need an extension. Here's an ugly hack to do it anyway! (keeping the # rather than going full HTML).

## Lastres de Mujer animation

Elena and Julia made a video-clip for Lastres de Mujer, one of Elena's songs (you can see it here). It consists of stop-motion animation of some of Julia's drawings that she arranges in a book. We shot pictures in rafales that we turned up into a movie following these simple steps.

## Stitching mp4 in linux

Rendering a video is extremely lengthy. If you want to alter a little part of it, you certainly do not want to render the whole thing again. Here's what you can do instead.

## Vals del vampiro animation

Carlos Sánchez, who has all the talents, composed a song (El Vals del vampiro), for which Elena, in a sequence of events that I did not follow in details, came to compose the lyrics. They decided to make a stop-motion animation to release the piece on YouTube (you can see the result here). At this point, I got involved for the minor technical aspects of assembling the artwork (also from Elena) into the said animation. These are the steps I followed to do so, which I store here mainly for my own recollection.

## Forcing et al. for all BibTeX entries with more than one author.

If you're tight in space (e.g., for a conference abstract) and want all entries to read F. Author et al., BibTeX doesn't usually help you much (biblatex would allow that but the more common natbib doesn't). The easiest fix is to hack the .bst file!

## Timelapse of a drawing

Elena took various pictures of her drawing Maternidad and wanted to do a timelapse. This lists the steps to do so.

## Supplementary TeX material on arXiv

Papers increasingly come with a supplementary material. This is in principle good as providing all the gory details, except that often this is where the authors flush out what didn't fit in the allotted space of the main text, so supplementary of PRL, for instances, are particularly tough (as often required-reading)

When you upload your prose to arXiv, you typically want the supplementary to be there as well. That's not easy to do.

## Common.js on mediawiki

Each mediawiki web has a MediaWiki:Common.js page (see, e.g., that of Wikipedia) that runs java script on each page. That's a powerful tool (apparently to be deprecated at some point). Installation should be straightforward but for some reason, can sometimes be frustratingly painful, so I give a particular example that should work on its own.

## Removing trailing spaces for makeindex

Makeindex, $\mathrm{\LaTeX}$'s historical index-building engine, is irritatingly buggy. One recurrent problem that plagues the output from careless index makers is that of duplicated entries:

A sore to the eye!

## Making space in gmail

We all eventually get there:

## Referencing figures by a label in mediawiki

If you want to refer to images in Mediawiki the way you would in a $\mathrm{\LaTeX}$ document, you can use this cheap trick of mine...

## KDE default profile

It's a pain that konqueror opens two panels by default in 'filemanagement' mode. I always have to close one by hand.

## Emacs regexp for our compound decay rates notation

We find that algebraic sums of decay rates are fairly common, which make a notation such as $\gamma_{\widetilde{ij}}=i \gamma_a + j\gamma_\sigma$ useful (e.g., $\gamma_{\widetilde{31}}=3\gamma_a+\gamma_\sigma$). This is, however, a bit of a pain to typeset:

(e.g., $\gamma_{\widetilde{31}}=3\gamma_a+\gamma_\sigma$)


In emacs, this regexp substitution allows to transliterate \gamma_{31} into the widetilde form:

Replace regexp (default _{$$[0-9][0-9]$$} -> _{\\widetilde{\1}}):


## Snowing in the browser

For Christmas, it's nice to feature a goody on one's website to participate to the overall merrier atmosphere. A favorite and immemorial web touch is the snow fall. It used to be popular on UNIX boxes as well though it apparently isn't so standard nowadays. As for the good old web, we like to use Scott Schiller's snowstorm, bringing snow to the web since 2003.

## 21844 files

If you look at what computers can do in terms of storing data, you feel sort of safe.

It's $2^{32}-1$ files (that makes 4 294 967 295) for NTFS, only 4 194 304 for FAT32 and a minuscule 65 536 for FAT16 which is however obsolete, while exFAT reads "Nearly Unlimited" [1].

## Changing file extensions in multiple LaTeX files

That's a pretty concrete problem: I have multiple .tex file which include .eps extensions. I have converted all the postscript (old fashioned) stuff into brand new converted pdf, now calling figure.eps by figure.eps.convto.pdf.

This piece of code says the $\mathrm{\TeX}$ files about that daring move:

perl -pi -w -e 's/\\includegraphics(\S+)pics\/(\S+)\}/\\includegraphics$1fig\/$2\.convto\.pdf\}/g;' *.tex


## Inflationary bubbles

This is the title I gave to this "kinetic digital sculpture" of mine, filed to the Wolfram Tweet-a-Program program:

## Walter Zorn's tooltips v°0.2

I have upgraded my extension wz (named after Walter Zorn) to support more features of this great library that provides tooltips.