Skip to content

Instantly share code, notes, and snippets.

View lazyfrosch's full-sized avatar
📢
Hack the planet! Hack the planet!

Markus Frosch lazyfrosch

📢
Hack the planet! Hack the planet!
View GitHub Profile
@nunofgs
nunofgs / README.md
Last active April 30, 2024 22:09
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"
@Ircama
Ircama / PT-P300BT.md
Last active March 26, 2024 08:55
Print to Brother PTP300BT from a computer

Printing to a Brother P-Touch Cube PT-P300BT label printer from a computer

Introduction

The Brother P-touch Cube PT-P300BT labelling machine is intended to be controlled from the official Brother P-touch Design&Print 2 app for Android and iOS devices, instead of from a computer.

This Gist provides small code revision and some additional scripts to the dogtopus/Pipfile one, which in turn is forked from the excellent stecman one, in order to print text labels via scripts on computers with different O.S. or subsystems.

The scripts are used to convert text labels to appropriate images compatible with 12mm width craft tapes like [TZe-131

@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 29, 2024 17:35
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@superseb
superseb / rke2-commands.md
Last active May 3, 2024 11:07
RKE2 commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active April 16, 2024 02:30
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@hnakamur
hnakamur / .rpmmacros
Last active December 25, 2020 01:28
rpm sign
# The original settings confirmed by running: rpm --showrc
# -14: __gpg %{_bindir}/gpg2
# -14: __gpg_check_password_cmd %{__gpg}
# gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
#
# -14: __gpg_sign_cmd %{__gpg}
# gpg --batch --no-verbose --no-armor --passphrase-fd 3
# %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}}
# --no-secmem-warning
# -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
@cynipe
cynipe / validate_signature.lua
Created February 25, 2015 03:30
Securing Github Webhook Endpoint with Nginx + Lua
-- 多分こんな感じでできる
local x_hub_signature = ngx.hader['X_Hub_Signature']
local body = ngx.req.read_body
local expected_signature = 'sha1=' .. ngx.hmac_sha1(ngx.var.secret_token, body)
if expected_signature ~= x_hub_signature then
ngx.log(ngx.WARN, 'Invalid access detected')
ngx.header.content_type = 'text/plain'
ngx.status = ngx.HTTP_UNAUTHORIZED
ngx.print('401 Access Denied')
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active April 11, 2024 04:45
A better markdown cheatsheet.
@funzoneq
funzoneq / mib2yaml
Created May 9, 2013 13:11
A mib to yaml converter for SNMP::MIB based of https://github.com/axic/rsnippets/blob/master/mib2yaml.rb Requires libsmi
# MIB2YAML converts MIB files to YAML files for the Ruby SNMP library with support for imports
#
# The code is heavily based on http://snmplib.rubyforge.org/, the only addition is the "find imports" block
require 'rubygems'
require 'fileutils'
require 'yaml'
module MIB2YAML
def MIB2YAML.convert(module_file, mib_dir = '.')