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 August 17, 2024 18:54
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 September 21, 2024 13:25
Print to Brother PTP300BT from a computer
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active September 3, 2024 20:47
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 September 12, 2024 19:41
RKE2 commands

RKE2 commands

  • Updated on May 29 to accommodate etcd container not having /bin/sh available anymore.

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active August 31, 2024 20:54
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 August 21, 2024 04:40
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 September 3, 2024 08:34
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 = '.')