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 / xrandr.bash
Last active November 5, 2023 13:55
Set the screen to a custom resolution with xrandr
# 1. Select first the resolution you would like to get the modeline (preferably the screen native resolution)
$ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
# 2. Identify your screen name (here VGA-0 with a low res)
$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 1080, maximum 16384 x 16384
VGA-0 connected 640x480+1920+0 (normal left inverted right x axis y axis) 0mm x 0mm
640x480 59.9*+
@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 / persistent_ubuntu.md
Last active January 22, 2023 21:58
Create, customize, and duplicate Ubuntu Live USB sticks with persistence

1. If you are creating the image

1.1. Create the Live stick

Install DUS/MKUSB :

sudo add-apt-repository ppa:mkusb/ppa
sudo apt update
sudo apt install mkusb mkusb-nox usb-pack-efi
dus
  1. i (install)
@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]><!-->
@ymollard
ymollard / clean_git_repository.bash
Created February 4, 2016 00:54
Clean a git repository by deleting history and data of old deleted files
#!/bin/bash
# This script, executed at the root of a git repository, deletes traces of every old file in this repository, index + blob on all branches
# It can take 10-30 minutes to run and will print regular warning stating than some references are unchanged
# time ./clear_git_repositor.bash >cleaning.log
# We need several passes to clean files renamed multiple times (git log --find-renames prevents its deletion for each renaming)
# MAXIMUM_PASSES should be more than the maximum number of renamings/movings for any file, if not then we might keep some traces of former files
MAXIMUM_PASSES=10 # Maximum number of passes
import time
def log(*args):
if not hasattr(log, "t0"):
log.t0 = time.time()
print("t+" + str(int(time.time()-log.t0)) + "\t: ", end="")
print(*args)
from datetime import datetime
class BankAccount:
def __init__(self, owner: str, initial_balance:int):
self._owner = owner
self._balance = initial_balance
def print(self):
print(f"This account belongs to {self._owner} with a balance of ${self._balance}")
DxlCommunicationError                     Traceback (most recent call last)
<ipython-input-3-277838a6949f> in <module>
      1 with Dxl320IO("/dev/ttyAMA0") as f:
----> 2     print(f.scan())
      3 

~/pyenv/lib/python3.7/site-packages/pypot/dynamixel/io/abstract_io.py in scan(self, ids)
    219     def scan(self, ids=range(254)):
    220         """ Pings all ids within the specified list, by default it finds all the motors connected to the bus. """
@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()
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)