Skip to content

Instantly share code, notes, and snippets.

View ymollard's full-sized avatar
🐧
Art, engineering & digital training

Yoan Mollard ymollard

🐧
Art, engineering & digital training
View GitHub Profile
@ymollard
ymollard / profile_module.sh
Created August 22, 2016 18:07
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")') the.module.to.profile
pyprof2calltree -k -i module.cprof
@ymollard
ymollard / freecad_svg_to_board.md
Last active August 28, 2016 21:56
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ymollard
ymollard / autoipd.md
Created December 17, 2016 20:59
Getting an auto IP

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

#!/bin/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 ]
then
day=$1
month=$2
year=`date +%Y`
@ymollard
ymollard / two_pass_ffmpeg.md
Created May 19, 2017 14:45
Two pass FFMPEG

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
ymollard / rename_ROS_pkg.md
Last active June 23, 2017 16:44
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
ymollard / systemd_history.md
Created June 26, 2017 13:37
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
$ sudo nmap -sS 192.168.43.1 --osscan-guess -O
Starting Nmap 7.01 ( https://nmap.org ) at 2017-09-16 19:26 CEST
Nmap scan report for 192.168.43.1
Host is up (0.040s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
53/tcp open domain
7676/tcp open imqbrokerd
9001/tcp open tor-orport
@ymollard
ymollard / change_MAC.md
Created November 13, 2017 16:46
change MAC address

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