Skip to content

Instantly share code, notes, and snippets.

View baudneo's full-sized avatar
👽
Mars 2034

baudneo baudneo

👽
Mars 2034
  • dAIngerous Consulting
  • Canada
View GitHub Profile
@baudneo
baudneo / main.py
Created July 19, 2021 02:18 — forked from pliablepixels/main.py
ZMES Cloud Function (Trusted app)
import firebase_admin
from firebase_admin import messaging
from firebase_admin import exceptions
from flask import jsonify
import json
from firebase_admin import auth
from functools import wraps
import jwt
import re
@baudneo
baudneo / usb_reset.py
Created July 19, 2021 20:18 — forked from 18516329677/usb_reset.py
Reset USB device from python
"""
Example code for resetting the USB port that a Teensy microcontroller is
attached to. There are a lot of situations where a Teensy or Arduino can
end up in a bad state and need resetting, this code is useful for
"""
import os
import fcntl
import subprocess
@baudneo
baudneo / mjpegviewer.py
Created September 16, 2021 19:35 — forked from tito/mjpegviewer.py
MJpeg Viewer in Kivy
"""
MJpeg Viewer using pure Kivy + urllib
=====================================
.. author:: Mathieu Virbel <mat@meltingrocks.com>
"""
import io
import urllib
import threading
@baudneo
baudneo / systemmonitor.sh
Created September 24, 2021 08:07 — forked from roelle/systemmonitor.sh
This is a simple bash script that will monitor a few things on a server and notify you over pushover is there are any problems. Specifically, the script checks for reboots, ZFS pool health, dropbox status, disk (over)utilization, and that a specified process is running.
#!/bin/bash
# Copy into /etc/cron.hourly
pushover_app_token="your--app--token"
pushover_user_guid="your--user--or--group--id"
dropbox_username="user--with--dropbox--installed"
process_to_check="your--process--name"
# Notification function
notify () {
# Send pushover notification
@baudneo
baudneo / read_nonblocking.py
Created November 16, 2021 05:53 — forked from conrad784/read_nonblocking.py
nonblocking read function for python, e.g. for named pipes
def read_nonblocking(path, bufferSize=100, timeout=.100):
import time
"""
implementation of a non-blocking read
works with a named pipe or file
errno 11 occurs if pipe is still written too, wait until some data
is available
"""
grace = True
@baudneo
baudneo / nvidia-fix-linux-5.13.patch
Created November 21, 2021 07:42 — forked from joanbm/nvidia-fix-linux-5.13.patch
Tentative fix for NVIDIA 465.27 driver for Linux 5.13-rc1
From 6c1d401600b76dd7d9c24ca4c6aa8d6e6b54fb05 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Fri, 16 Apr 2021 09:29:24 +0200
Subject: [PATCH] Tentative fix for NVIDIA 465.27 driver for Linux 5.13-rc1
---
nvidia-drm/nvidia-drm-crtc.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/nvidia-drm/nvidia-drm-crtc.c b/nvidia-drm/nvidia-drm-crtc.c
@baudneo
baudneo / .xbindkeysrc
Created June 29, 2022 06:00 — forked from thraizz/.xbindkeysrc
XF86 media key bindings using xbindkeys
"pactl set-sink-volume @DEFAULT_SINK@ -1000"
XF86AudioLowerVolume
"pactl set-sink-volume @DEFAULT_SINK@ +1000"
XF86AudioRaiseVolume
"playerctl play-pause"
m:0x0 + c:208
XF86AudioPlay
"playerctl play-pause"
m:0x0 + c:209
XF86AudioPause
@baudneo
baudneo / Proxmox email relay.md
Last active July 11, 2024 18:45 — forked from tomdaley92/README.md
Proxmox - Email Alerts Setup (gmail)

Proxmox - Email Alerts Setup (gmail)

  1. SSH into proxmox node and become root user. Run the following commands to download extra software dependencies we'll need.

    apt update
    apt install -y libsasl2-modules mailutils
  2. Enable 2FA for the gmail account that will be used by going to security settings

@baudneo
baudneo / mac-vendors.json
Created April 23, 2023 19:12 — forked from hemantapkh/mac-vendors.json
List of MAC address OUI with their Vendors in JSON format.
# https://gist.github.com/aallan/b4bb86db86079509e6159810ae9bd3e4
{
"OFFICIALLY XEROX": [
"000000"
],
"SUPERLAN-2U": [
"000001"
],
"BBN (WAS INTERNAL USAGE ONLY, NO LONGER USED)": [
@baudneo
baudneo / pyvenvex.py
Created July 22, 2023 16:38 — forked from vsajip/pyvenvex.py
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages.The script needs Python 3.3 or later; invoke it using"python pyvenvex.py -h"fo…
#
# Copyright (C) 2013-2020 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve