Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
Art, engineering & digital training

Yoan Mollard ymollard

🐧
Art, engineering & digital training
  • Bordeaux INP
  • Bordeaux, France
View GitHub Profile
@ymollard
ymollard / profile_module.sh
Created Aug 22, 2016
Profile a python module and plot
View profile_module.sh
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 Aug 28, 2016
Freecad to Inkscape board
View freecad_svg_to_board.md
  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
ymollard / autoipd.md
Created Dec 17, 2016
Getting an auto IP
View autoipd.md

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

View get_quotidien.bash
#!/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`
View two_pass_ffmpeg.md

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 Jun 23, 2017
Rename ROS package
View rename_ROS_pkg.md
  • 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 Jun 26, 2017
Read SystemD history
View systemd_history.md
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 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 Nov 13, 2017
change MAC address
View change_MAC.md

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

You can’t perform that action at this time.