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 / Proxmox email relay.md
Last active April 19, 2024 14:03 — 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 / .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 / gist:981f54244d33bfdf2eacb91f10f6fecd
Created November 30, 2021 22:30
EventCommandStart - delayed?
zmc_m1 INF - DEBUG logs did not seem to have any extra pertinent data ->
11/30/21 15:22:26.818604 zmc_m1[641].INF-zm_monitor.cpp/2111 [Front: 3486 - Gone into prealarm state]
11/30/21 15:22:27.016381 zmc_m1[641].INF-zm_monitor.cpp/2048 [Front: 3490 - Gone into alarm state PreAlarmCount: 2 > AlarmFrameCount:3 Cause:Forced Web]
11/30/21 15:22:28.019765 zmc_m1[521].INF-zm_monitor.cpp/1692 [Front: 3500 - Capturing at 10.00 fps, capturing bandwidth 779159bytes/sec Analysing at 0.00 fps]
11/30/21 15:22:33.242260 zmc_m1[641].INF-zm_monitor.cpp/2102 [Front: 3488 - Opening new event 51561, alarm start]
11/30/21 15:22:38.017708 zmc_m1[521].INF-zm_monitor.cpp/1692 [Front: 3600 - Capturing at 10.00 fps, capturing bandwidth 776973bytes/sec Analysing at 0.00 fps]
zmdetect_m1 DBG ->
@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 / 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
# Other attempt
response = requests.post(to the api that serves images)
r = response
img = np.asarray(bytearray(response.content), dtype="uint8")
image = cv2.imdecode(img, cv2.IMREAD_COLOR) # RGB ?
object['thing'] = image
# Now to send it in the response
img = object['thing'].tobytes()
response = make_response(img)
# Most recent base64 attempt
# SERVER SIDE
class Detect(Resource):
@jwt_required
def post(self):
# all the logic needed to build the request to grab images from an API at a certain URL
# requesting images from specified URL
response = request.post(xxxxx)
@baudneo
baudneo / gist:a2b164954d37969e5aa5c052a5c83161
Created October 20, 2021 11:29
Log output from forked ZMES - this is the zmevenotnotification side, animation creation, Pushover, Home Assistant and MQTT add-ons enabled and working correctly.
# This is not the same event as the mlapi logs, this is a past event with animations turned on, MQTT and HomeAssistant add-ons integrated and the new pushover add-on enabled.
❯ es.baredebug.objdet 38619
==> /var/log/zm/zmesdetect_m4.log <==
10/20/21 05:21:18.907295 zmesdetect_m4[742399] INF ZMLog:285 [Setting up signal handlers for log rotation and log in
terrupt]
10/20/21 05:21:19.244361 zmesdetect_m4[742399] INF ZMLog:292 [Connected to ZoneMinder Logging system with user 'www-
data' -> /var/log/zm/zmesdetect_m4.log]
10/20/21 05:21:19.270691 zmesdetect_m4[742399] DBG1 pyzm_utils:1030 ['std.out' -> TESTING STDOUT FOR ZM_DETECT]
10/20/21 05:21:19.272079 zmesdetect_m4[742399] DBG1 pyzm_utils:1032 [10/20/21 05:21:18.206647 CNSL[DBG1] pyzm_utils:
@baudneo
baudneo / gist:d5a8b54843531fc2a5ae7c1826733d91
Created October 20, 2021 11:04
Log output of forked ZMES - This is on the MLAPI side, MLAPI is installed on a remote system without ZM or ZMES.
10/20/21 04:54:36.533656 zm_mlapi[25758] DBG1 mlapi:139 [mlapi:JWT: 'Neo' accessed this endpoint '/detect' with a v
alid JWT]
10/20/21 04:54:36.541542 zm_mlapi[25758] DBG1 mlapi_utils:418 [SENT TO LOGGER -> initilized STDOUT class]
10/20/21 04:54:36.543705 zm_mlapi[25758] DBG1 mlapi_utils:210 ['std.out' -> TESTING STDOUT FOR MLAPI]
10/20/21 04:54:36.545846 zm_mlapi[25758] INF mlapi_utils:212 [config:init: reading config file found at '/home/baudneo/
PycharmProjects/my_mlapi/mlapi/mlapiconfig.ini']
10/20/21 04:54:36.548096 zm_mlapi[25758] INF mlapi_utils:218 [config:init: reading secrets from: '/home/baudneo/Pycharm
Projects/my_mlapi/mlapi/secrets.ini']
10/20/21 04:54:36.553892 zm_mlapi[25758] DBG2 mlapi_utils:253 [config:init: found configuration overrides for monitor
'1', applying...]
2021-10-08 20:11:03 | razer | INFO | Initialising Daemon (v3.1.0). Pid: 18013
2021-10-08 20:11:03 | razer.screensaver | INFO | Initialising DBus Screensaver Monitor
2021-10-08 20:11:03 | razer | INFO | Found device.0: 0003:1532:025E.0004
2021-10-08 20:11:03 | razer.device0 | INFO | Initialising device.0 RazerCynosaV2
2021-10-08 20:11:03 | razer.device0 | INFO | Putting device into driver mode. Daemon will handle special functionality
2021-10-08 20:11:03 | razer | INFO | Serving DBus
2021-10-08 21:06:15 | razer | INFO | Stopping daemon on signal 15
2021-10-08 21:06:51 | razer | INFO | Initialising Daemon (v3.1.0). Pid: 1395
2021-10-08 21:06:51 | razer.screensaver | INFO | Initialising DBus Screensaver Monitor
2021-10-08 21:06:51 | razer | INFO | Found device.0: 000