Skip to content

Instantly share code, notes, and snippets.

View r15ch13's full-sized avatar
👷‍♂️

Richard Kuhnt r15ch13

👷‍♂️
View GitHub Profile
@r15ch13
r15ch13 / readme.md
Last active December 14, 2023 20:24
Get pending printer jobs from a CUPS Printer with Node-RED

Get pending printer jobs from a CUPS Printer with Node-RED

Inject the printer uri via the msg.topic from your calling node (e.g. Timestamp node).

Printer uri should look like this: ipp://mycupsserver:632/printers/Brother_HL2030

Add a function to your flow and add the module @sealsystems/ipp on the Setup tab.

Then add the following code to the On Message tab.

@r15ch13
r15ch13 / convertfrom-subghzraw.ps1
Last active May 22, 2023 14:14
Convert Flipper SubGhz RAW Files to CSV
# Converts Flipper SubGhz RAW Files to PSCustomObject[]
function ConvertFrom-SubGhzRAW {
param(
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
[String] $Path
)
process {
$data = Get-Content $Path
if(!$data.Contains("Filetype: Flipper SubGhz RAW File")) {
@r15ch13
r15ch13 / iommu.sh
Last active December 12, 2024 09:34
List IOMMU Groups and the connected USB Devices
#!/usr/bin/env bash
shopt -s nullglob
lastgroup=""
for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
for d in $g/devices/*; do
if [ "${g##*/}" != "$lastgroup" ]; then
echo -en "Group ${g##*/}:\t"
else
echo -en "\t\t"
@r15ch13
r15ch13 / .ha
Created May 22, 2021 09:30
Simple Octoprint PSU Control script to toggle a switch in Home Assistant
HA_HOST=http://myhomeassistant:8123
HA_TOKEN=long lived token
HA_SWITCH=entity_id
@r15ch13
r15ch13 / README.md
Last active January 9, 2023 04:36
Use smartplug with Octoprint PSU Control and Home Assistant

Use smartplug with Octoprint PSU Control and Home Assistant

This explains how to use any smartplug connected to Home Assistant with Octoprint PSU Control.

It's based on a comment by tht and a Tasmota sonoff thread in the Octoprint forum.

Installation

The installation consist of three simple steps: create a config file, copy the script and change the PSU Control settings

@r15ch13
r15ch13 / cups.md
Last active February 18, 2020 12:41
Raspberry Pi Printer Server with CUPS

How to set up a print server on a Raspberry Pi with CUPS

Install CUPS and make it available

sudo apt-get install cups
sudo cupsctl --remote-any
sudo /etc/init.d/cups restart

Install foomatic database to get more printers

@r15ch13
r15ch13 / rtl8822bu-rpi.md
Last active November 10, 2024 14:22
Compile and install rtl8822bu for Raspberry Pi

Compiling rtl8822bu for Raspberry Pi

A small How-to for compiling the rtl8822bu wifi drivers on a Raspberry Pi.

Tested with the EDIMAX EW-7822UTC AC1200

Requirements

sudo apt install raspberrypi-kernel-headers
@r15ch13
r15ch13 / scoop-bucket.md
Created July 29, 2019 16:16
GraphQL querys to search for scoop-buckets
@r15ch13
r15ch13 / audible.ps1
Created June 9, 2019 16:34
Extract AAX checksum from Audible Audio Book
function Read-AudioBookChecksum {
param(
[Parameter(Mandatory=$true,
Position=0,
ParameterSetName="Path",
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path $_ -Type Leaf })]
[string]
@r15ch13
r15ch13 / changelog.md
Created May 13, 2019 19:09
Example Changelog.md for Scoop generated by git-chglog

[Unreleased]

[87a1e7] - 2019-05-12

Bug Fixes

  • decompress: Fix dark parameter order
  • depends: don't force adding dark dependency (#3453)
  • update: Rewording PowerShell update notice