Skip to content

Instantly share code, notes, and snippets.

@nunofgs
nunofgs / README.md
Last active November 11, 2024 10:17
Use any RTSP camera with Prusa Connect

I use a cheap Tapo C100 webcam to monitor my 3D prints. It supports RTSP.

Screenshot 2023-07-17 at 23 26 34

Instructions

  1. Go to the Cameras section at https://connect.prusa3d.com
  2. Add a new camera.
  3. Click the QR code link
  4. Click "Start Camera"
@vncsna
vncsna / bash_strict_mode.md
Created June 6, 2021 01:59 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@abraidotti
abraidotti / ks-readme-template.md
Last active September 28, 2020 14:43
Kintyre README template
@LukeMurphey
LukeMurphey / rest_handler.py
Last active October 19, 2022 08:32
A simple helper library for making a generic REST handler for Splunk #splunk
"""
This class makes creating a REST handler for Splunk easier.
The class will automatically call a function within the class based on the path and the method.
For example, if a GET call is made to the path "ping", then this class will call the function
get_ping().
Below is an example.
@sivel
sivel / cprofile-callback.txt
Last active December 16, 2023 07:26
Ansible callback plugin to profile code execution via cProfile
$ ANSIBLE_CALLBACK_WHITELIST=cprofile CPROFILE_FILTERS=ansible.plugins.connection,ansible.executor.task_executor ansible-playbook -i localhosts whoami.yml
PLAY [My Cool Play] **************************************************************************************************************************************************************************************************************************
TASK [Check who I am 1] **********************************************************************************************************************************************************************************************************************
changed: [localhost0]
changed: [localhost1]
TASK [Check who I am 2] **********************************************************************************************************************************************************************************************************************
changed: [localhost0]
@automine
automine / remove_local.sh
Last active October 18, 2018 16:17
Remove Splunk /etc/system/local configs - Linux
#!/bin/sh
[ -d "/opt/splunk" ] && SPLUNKPATH="/opt/splunk"
[ -d "/opt/splunkforwarder" ] && SPLUNKPATH="/opt/splunkforwarder"
[ -f "$SPLUNKPATH/etc/system/local/inputs.conf" ] && rm -f $SPLUNKPATH/etc/system/local/inputs.conf
[ -f "$SPLUNKPATH/etc/system/local/outputs.conf" ] && rm -f $SPLUNKPATH/etc/system/local/outputs.conf
[ -f "$SPLUNKPATH/etc/system/local/deploymentclient.conf" ] && rm -f $SPLUNKPATH/etc/system/local/deploymentclient.conf
@automine
automine / remove_local.bat
Created October 16, 2018 19:06
Remove Splunk /etc/system/local configs - Windows
@echo off
del /f /q "%SPLUNK_HOME%\etc\system\local\inputs.conf"
del /f /q "%SPLUNK_HOME%\etc\system\local\outputs.conf"
del /f /q "%SPLUNK_HOME%\etc\system\local\deploymentclient.conf"
@subfission
subfission / forwardsplunker.sh
Last active August 6, 2018 18:29
Splunk UniversalForwarder 7.0.0 Downloader for RedHat
#!/bin/bash
# Downloader script for Splunk Universal Forwarder
#
# Usage:
# bash forwardsplunker.sh
#
version="7.0.0" # Splunk product Version
hash="c8a78efdd40f" # Versioned HASH
# --- Dont edit below ---
@automine
automine / props.conf
Last active January 12, 2023 15:02
Windows Event Clean Up in Splunk
[WinEventLog:Security]
#Returns most of the space savings XML would provide
SEDCMD-clean0-null_sids = s/(?m)(^\s+[^:]+\:)\s+-?$/\1/g s/(?m)(^\s+[^:]+\:)\s+-?$/\1/g s/(?m)(\:)(\s+NULL SID)$/\1/g s/(?m)(ID\:)(\s+0x0)$/\1/g
SEDCMD-clean1-summary = s/This event is generated[\S\s\r\n]+$//g
SEDCMD-clean2-cert_summary = s/Certificate information is only[\S\s\r\n]+$//g
SEDCMD-clean3-blank_ipv6 = s/::ffff://g
SEDCMD-clean4-token_elevation_summary = s/Token Elevation Type indicates[\S\s\r\n]+$//g
SEDCMD-clean5-network_share_summary = s/(?ms)(A network share object was checked to see whether.*$)//g
SEDCMD-clean6-authentication_summary = s/(?ms)(The computer attempted to validate the credentials.*$)//g
SEDCMD-clean7-local_ipv6 = s/(?ms)(::1)//g
@LukeMurphey
LukeMurphey / modular_alert.py
Last active January 9, 2019 21:23
This is a base class that makes the creation of a Splunk modular alert easier. #splunk
import logging
from logging import handlers
import traceback
import sys
import re
import os
import json
import socket # Used for IP Address validation
from splunk.appserver.mrsparkle.lib.util import make_splunkhome_path