Skip to content

Instantly share code, notes, and snippets.

Art, engineering & digital training

Yoan Mollard ymollard

Art, engineering & digital training
  • Bordeaux INP
  • Bordeaux, France
View GitHub Profile
ymollard /
Created Aug 22, 2016
Profile a python module and plot
pip install pyprof2calltree
sudo apt-get install kcachegrind
python -mcProfile -o module.cprof $(python -c 'import runpy; print runpy.__file__.rstrip("co")')
pyprof2calltree -k -i module.cprof
ymollard /
Last active Aug 28, 2016
Freecad to Inkscape board
  1. Objet vers Chemin
  2. Redimensionner à L+0.1, H+0.1, épaisseur de ligne = 0.1
  3. Dégrouper
  4. Sur chaque couple de noeuds superposés, les sélectionner, ils disparaissent
  5. Maj + J sur chaque couple
  6. Dupliquer la forme globale
  7. Appliquer un miroir (attention : est-ce symétrique ?)
  8. Sur chaque segment partagé de la forme dupliquée -> Alt+Suppr (pas Alt Gr)
  9. Lors de la dernière suppression, la largeur est réduite de 0.05
  10. Aligner verticalement
View generate_circle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ymollard /
Created Dec 17, 2016
Getting an auto IP

sudo /usr/sbin/avahi-autoipd -w eno1

View get_quotidien.bash
# TF1 utilisant toujours des technologies obsolètes en 2016 (Adobe Flash),
# voici un script Bash trivial pour regarder le programme Quotidien sous Linux
if [ $# -eq 2 ]
year=`date +%Y`

Your video is 10 minutes (600 seconds) long and an output of 200 MiB is desired. Since bitrate = file size / duration:

(200 MiB * 8192 [converts MiB to kBit]) / 600 seconds = ~2730 kBit/s total bitrate 2730 - 128 kBit/s (desired audio bitrate) = 2602 kBit/s video bitrate

ffmpeg -y -i input -c:v libx264 -preset medium -b:v 2600k -pass 1 -c:a aac -b:a 128k -f mp4 /dev/null
ffmpeg -i input -c:v libx264 -preset medium -b:v 2600k -pass 2 -c:a aac -b:a 128k output.mp4
ymollard /
Last active Jun 23, 2017
Rename ROS package
  • Replace upper case and lower case name occurences with KFilereplace on files: *.md;*.py;*.launch;*.xml;*.txt;*.srv;*.msg;*.action
  • Replace name occurences in folders and files:
    shopt -s globstar  # Enables **
    rename 's/old_name/new/' **  # Run it several times until there's no new error
ymollard /
Created Jun 26, 2017
Read SystemD history
sudo systemctl status apex.service -l  # Summary of the execution and success/failure state
sudo journalctl -u apex --all  # Displays the full log
# Long version: journalctl _SYSTEMD_UNIT=apex.service --all  # Full output
View gear_360_scan
$ sudo nmap -sS --osscan-guess -O
Starting Nmap 7.01 ( ) at 2017-09-16 19:26 CEST
Nmap scan report for
Host is up (0.040s latency).
Not shown: 997 closed ports
53/tcp open domain
7676/tcp open imqbrokerd
9001/tcp open tor-orport
ymollard /
Created Nov 13, 2017
change MAC address

sudo ifconfig eth0 hw ether a0:1d:48:0d:ae:f5