Skip to content

Instantly share code, notes, and snippets.

View Vincent-Stragier's full-sized avatar

Vincent STRAGIER Vincent-Stragier

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Vincent-Stragier
Vincent-Stragier / tutorial.md
Last active May 5, 2024 11:10 — forked from crundberg/gist:a77b22de856e92a7e14c81f40e7a74bd
Setup USB (COM port) pass-through on unprivileged Proxmox container

Setup USB (COM port) pass-through on unprivileged Proxmox container

Preparation on host

First find your USB device with lsusb and note the ID. Here, the USB device is the Arduino SA Uno R3 (CDC ACM). The vendor is 2341 and the product is 0041.

root@home:~# lsusb
Bus 003 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Bus 003 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. Root Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
@Vincent-Stragier
Vincent-Stragier / presets_variations_merger.py
Created December 15, 2022 15:48
A pydub based Python script used to merged fractions of audio segments.
import argparse
import os
import mimetypes
# You need to:
# python -m pip install pydub tqdm
# And to install ffmpeg
# https://github.com/jiaaro/pydub
# https://github.com/jiaaro/pydub/blob/master/API.markdown
from pydub import AudioSegment
@Vincent-Stragier
Vincent-Stragier / extract_contacts_information_from_vcf.ipynb
Last active October 4, 2022 11:47
Dirty hack to extract contact information from .vcf file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Vincent-Stragier
Vincent-Stragier / ical_generator.py
Created February 3, 2022 00:01
Generate a simple icalendar using Python 3 and the icalendar module
from datetime import datetime, timedelta
import os
from icalendar import Calendar, Event, vText, Alarm
from icalendar.cal import Component
def component_wrapper(component: Component, *arg, **karg) -> Component:
use_vtext = karg.get('use_vtext', True)
# We can only add Components
for value in arg:
@Vincent-Stragier
Vincent-Stragier / read_tp_adc.py
Created January 12, 2022 23:37
Read TP ADC on some Allwinner CPU (A20)
#!/usr/bin/env python3
"""
Related to https://forum.armbian.com/topic/15032-reading-a20-lradc0-and-lradc1-values/?do=findComment&comment=134459
To use this script you must remove kernel drivers related to the A20's adc.
Note that this script has been developped on a pcDuino 3, running on Armbian
(Linux pcduino3 5.15.13-sunxi #trunk.0004 SMP Wed Jan 5 17:53:11 UTC 2022 armv7l GNU/Linux)
The values registers have been set using the A20 Allwinner User Manual and by reverse engineering
the previous OS images released by the pcDuino 3 teams in order to find a correct configuration.
(pcDuino3 OS iso used: pcduino3_dd_sdbootable_20141110)