Skip to content

Instantly share code, notes, and snippets.

@nunofgs
nunofgs / README.md
Last active April 23, 2024 11:39
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"
@mohrezaei
mohrezaei / Calyx3-Magisk.md
Created March 27, 2022 18:02
CalyxOS 3.x (Android 12) with Magisk

CalyxOS 3.x (Android 12) with Magisk with working signed images and AVB Verity

This idea was inspired by this post topjohnwu/Magisk#509 (comment)

I got this working with CalyxOS 3.3.1 (Android 12) with full AVB Verity enabled and was able to lock the bootloader after flashing and still have su. The OTA update zip generated was also tested against the Calyx 2.11.0 version (with Magisk) and it works well.

Create a working build

First, make sure you can build and sign a proper CalyxOS for your device. This is probably the hardest part.

@mohrezaei
mohrezaei / Calyx-Magisk.md
Last active January 13, 2024 23:24
CalyxOS with Magisk with working signed images and AVB Verity

CalyxOS with Magisk with working signed images and AVB Verity

This idea was inspired by this post topjohnwu/Magisk#509 (comment)

I got this working with CalyxOS 2.11.0 (Android 11) with full AVB Verity enabled and was able to lock the bootloader after flashing and still have su.

Create a working build

First, make sure you can build and sign a proper CalyxOS for your device. This is probably the hardest part.

Prepare Magisk files for rooting

@hrkrshnn
hrkrshnn / generic.org
Last active April 21, 2024 01:51
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@spalladino
spalladino / Loans.sol
Created March 20, 2021 16:57
Strawman for flashloans for flashbots
pragma solidity ^0.7.0;
// Each mining pool that intends to provide flash loans deploys a Loaner contract and transfers ETH to it
// When testing each bundle, the diff in balance in this contract is taking into account for calculating effective gas price
// The contract loans funds only on blocks mined by the miner and on zero-gasprice txs
contract Loaner {
address immutable owner;
constructor(address _owner) {
owner = _owner;
@stefanionescu
stefanionescu / proto_rai_addresses.txt
Created February 28, 2021 17:22
List of addresses that interacted with Proto RAI
0x00000000b9d747ef42d224e572a5b7e6488929c8=30
0x000f4432a40560bbff1b581a8b7aded8dab80026=30
0x00290ffc9e9d19bda7b25c6e44d8adf55dfbf2dd=30
0x004537fcd9095489ebe38180a382341b962b501d=30
0x00a7115685d9d7007360c562c01ce72a1efb9a24=30
0x0154d25120ed20a516fe43991702e7463c5a6f6e=30
0x019882789983306222c4b4cab71258189fd92998=30
0x03d1ba09c6b93692cc5a2f17c3b1c5cba43b9500=30
0x051dce94b53dcf1f51af1d3bc14f615b87650424=30
0x056590f16d5b314a132bbcfb1283fec5d5c6e670=30

How to create a Wake-on-LAN API Endpoint with OpenWRT LuCI

Disclaimer

I'm stuck on OpenWRT 18.06, and these info may soon be obsoleted by newer versions, and/or the more detailed ACL scheme in LuCI2.

Motivation

The motivation So i have this server at home, that serves http://hq.strfry.org , which i sometimes switch off at night.

@mbursa
mbursa / kem-decryptor.py
Last active February 13, 2024 20:55
Python script to decrypt Kamstrup KEM files
# A Python script that decrypts the content of Kamstrup KEM file and imports meter files
# to wmbusmeters' config folder.
#
# The KEM file is a (sometimes zipped) xml file that contains xml-encrypted data using
# the xml-enc standard (http://www.w3.org/2001/04/xmlenc). The password needed to decrypt
# the xml-encrypted data can either be the CustomerId or something else selected by the
# person that has created the KEM file using Kamstrup software.
#
# This script takes the encrypted KEM file and decrypts its content (it automaticly detects
# the zip archive and extracts the kem file from it). The result is a XML with a list of meters
@najdanovicivan
najdanovicivan / update_do.sh
Last active August 29, 2020 22:56 — forked from Temikus/update_do.sh
OpenWRT DDNS using DigitalOcean API
# Script for sending user defined updates using DO API
# 2015 Artem Yakimenko <code at temik dot me>
#
# activated inside /etc/config/ddns by setting
#
# option update_script '/usr/lib/ddns/update_do.sh'
#
# the script is parsed (not executed) inside send_update() function
# of /usr/lib/ddns/dynamic_dns_functions.sh
# so you can use all available functions and global variables inside this script
@danielkucera
danielkucera / compal-decrypt.c
Last active July 3, 2023 23:02
compal-decrypt.c
/*
Program for decrypting Compal CH7465LG private key
Compilation:
gcc -o compal-decrypt compal-decrypt.c -lcrypto
Running:
./compal-decrypt
usage: ./compal-decrypt <infile> <outfile>