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 / clickshare.md
Created April 4, 2023 16:19
sudo iw dev wlan0 interface add wlan1 type station

Connect to Barco Clickshare via Linux

The USB-C Clickshare is just an external Network card.

Get the password of the Clickshare network and connect to it.

Create a virtual Wifi card so that you can still access the web:

Replace wlan0 by your own card:

sudo iw dev wlan0 interface add wlanvirt type station 
@ymollard
ymollard / invite_body.html
Last active January 10, 2023 21:48
Mattermost invite body personnalisé
{{define "invite_body"}}
<!-- FILE: invite_body.mjml -->
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>
</title>
<!--[if !mso]><!-->
Exception in thread Thread-9:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/poppy/pyenv/lib/python3.7/site-packages/pypot/utils/stoppablethread.py", line 130, in _wrapped_target
self._target()
File "/home/poppy/pyenv/lib/python3.7/site-packages/pypot/utils/stoppablethread.py", line 205, in run
make_update_loop(self, self._update)

Gestion des images sous ROS et Marker RViz

  1. Tester le package usb_cam qui ouvre l'image de la webcam et la publie sur sur un topic (pour tester, affichez-la avec le package image_viewer)
  2. Ecrire un noeud color.py qui calcule la couleur dominante de l'image de ce topic et l'écrit dans le terminal
  3. Remplacer l'écriture dans le terminal par la publication d'un Marker dans RViz

Ronds et carrés Turtlesim : Roslaunch, rosparam et noeud

  1. Ecrire un noeud move_turtle.py qui fait dessiner un carré à la tortue de turtlesim
  2. Mettre le code du carré dans une fonction et écrire une autre fonction qui dessine un cercle
  3. Créer un package et un launchfile pour pouvoir lancer en une seule commande turtlesim et move_turtle.py en tapantn roslaunch formation dessin.launch
  4. Modifier le launchfile pour écrire square ou circle dans un paramètre /shape du serveur de paramètres selon ce qui est passé en argument e.g. draw.launch shape:=circle

Image to PDF

convert -density 300 in.jpeg out.pdf

Concat

sudo apt-get install pdftk
pdftk in1.pdf in2.pdf cat output out.pdf
@ymollard
ymollard / navigate.py
Last active May 31, 2022 13:55
english
#!/usr/bin/env python3
import rospy, actionlib, tf
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Pose, Point, Quaternion
def goto(x, y, theta, timeout=120):
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = 'map'
goal.target_pose.header.stamp = rospy.Time.now()
@ymollard
ymollard / jitsi_crop_1920x1080.bash
Last active March 14, 2021 01:38
Crop and blur Jitsi from 1920x1080 screen captures
#!/bin/bash
type convert || exit(1);
for i in Capture*png; do
convert "$i" \
-region 1600x800+300+200 -blur 0x9 \
"tmp-$i";
convert "tmp-$i" \
-crop 1920x930+0+120 \
@ymollard
ymollard / count_files_by_extension.bash
Created December 9, 2020 21:54
Count files by extension
find -type f | rev | cut -d. -f 1 | rev | sort | uniq -c | sort -n
@ymollard
ymollard / mount_img.md
Last active October 20, 2021 20:23
losetup: Mount an img file with multiple partitions to edit files in them
sudo losetup 2020-10-23-poppy-torso.img -Pf
ll /dev/loop*

Then find the partition there eg /dev/loop15p2

mdkir -p mnt
@ymollard
ymollard / multipass.md
Last active February 4, 2021 14:35
Multipass VMs

Build a custom image

multipass launch           # will create a 20.04
sudo apt update
sudo apt upgrade
sudo apt install ubuntu-desktop xrdp
sudo passwd ubuntu         # Change the password