Skip to content

Instantly share code, notes, and snippets.

View pmudry's full-sized avatar

Pierre-André Mudry pmudry

  • Filière ISC, HES-SO Valais-Wallis
  • Switzerland
View GitHub Profile
@pmudry
pmudry / public_key
Created March 10, 2024 13:38
ssh publickey
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAlLTNSC5r/qLAVepPblz1fYUsND/yjT8ADGPOZBq0TC/xPd/zVeZHrVosKxWzG7f1ioJrDGAEaDV4rvgtMu1z7+pkLhaUODy0DVtFdevRwa+yGz1g4vqx2TW9koXoGPsISUnBQHYEzaf3T3JzpxWBj/tQhrH8I7oxSywWARIciFrPDXboVlMimA/6RqKVwR8eqV4P45QUZIBcWjcjaWo31KUO/D+UDZcDNGmJbS4yOIqPdiyJor2Y6NmqGnsq65R+F+GrkiBuKk+/4G0JfwY1oG7Z75l2x4ZqXzfgsE3bV5eo5ou4pmLhecfpFmma+odOv5Amz5pMX8JJq7NlVTkwUQ== rsa-key-20190428
@pmudry
pmudry / gist:99b28bacfc105e11ae5c2c6df22196f7
Created October 13, 2023 06:40
Remove from dpkg the hard way
dpkg -l | grep -e cuda-.*9-1 | awk '{print $2}' | xargs -n1 sudo dpkg --purge --force-all
@pmudry
pmudry / jupyter.md
Last active December 15, 2021 19:14
Python jupyter on WSL

How to install Jupyter-nb environment in WSL on Windows, no preriquistes

  1. Install miniconda from (https://docs.conda.io/en/latest/miniconda.html)
  2. Install mamba with conda install mamba -n base -c conda-forge
  3. Install the forge with mamba install xtensor-r -c conda-forge
  4. Install Jupyter NB with mamba install -c conda-forge jupyterlab
  5. Install some packages mamba install -c conda-forge pandas matplotlib seaborn numpy
  6. Run with jupyter-lab or in VSCode

Installing opencv for vscode with intellisense

@pmudry
pmudry / ubiquiti_snapshot.md
Created March 6, 2021 10:19
How to get a snapshot from a Ubiquiti camera
ffmpeg -rtsp_transport tcp -i 'rtsp://192.168.0.1:7447/IscqgonF1qcOGcoR' -vframes 1 -s 1920x1080 -nostdin photo.jpg -y -loglevel 0
# Testing things...
#
source [find interface/stlink.cfg]
transport select hla_swd
set WORKAREASIZE 0x2000
source [find target/stm32l0.cfg]
reset_config srst_only
@pmudry
pmudry / gist:7bd4658897d3a84c9f9b9e585502906f
Created May 6, 2020 19:20
ENOCEAN usb 300 on Hifiberry
pip install enocean
edit in /usr/lib/python3.7/site-packages/enocean/communicators/serialcommunicator.py --> ttyAMA0 to ttyUSB0
import hevs.graphics.FunGraphics;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
/**
* This class demonstrate how to implement keyboard events
* using the FunGraphics library.
*/
public class Demo {
Set CMake options to "-DIDF_PATH=..." in Preferences > Build, Execution, Deployment > CMake
Add an entry to the Environments table to set IDF_PATH as well.
Set the Generation Path to 'build' as that is the default for idf.py
@pmudry
pmudry / alias_dns.py
Created February 24, 2019 20:17 — forked from patrickfuller/alias_dns.py
Enables local DNS resolution of Unifi aliases
"""
When run in cron, automatically adds compliant alias names to local DNS.
Use at your own risk.
Patrick Fuller, 25 June 17
"""
import re
import paramiko
import pymongo
@pmudry
pmudry / readme.md
Created November 26, 2018 16:23 — forked from dideler/bot.rb
Sending a notification message to Telegram (via cURL)

Create a bot, gets its API token, get the ID of the channel.

https://core.telegram.org/bots/api#sendmessage

$ curl -X POST \
       -H 'Content-Type: application/json' \
       -d '{"chat_id": "541123411", "text": "This is a test from curl", "disable_notification": true}' \
       https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage