Skip to content

Instantly share code, notes, and snippets.


@RubenKelevra RubenKelevra

View GitHub Profile
RubenKelevra / git partial push
Last active December 28, 2022 13:39
Github only accepts pushes up to 2 GB as they are bundled into a single pack - this allows for a partial push via `git partial-push origin branchname` after placing it into .gitconfig. Error message"remote: fatal: pack exceeds maximum allowed size (2.00 GiB) error: remote unpack failed: index-pack abnormal exit"
View git partial push
partial-push = "!sh -c
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
n=$(git log --first-parent --format=format:x $range | wc -l);
echo "Have to push $n packages in range of $range";
View turbo vs no turbo
on powersave and battery
real 0m11.109s
user 0m22.276s
sys 0m3.989s
real 0m10.972s
user 0m22.343s
sys 0m3.903s
RubenKelevra / ambient_light.yaml
Last active January 30, 2023 02:29
ESPHome example for an ambient light sensor with some smoothing / throttleling but overall low delay
View ambient_light.yaml
name: $devicename
platform: ESP8266
board: d1_mini
devicename: ambient-light-sensor
friendly_name: "Ambient Light Sensor"
RubenKelevra /
Last active March 12, 2023 16:11
Make Firefox fast again
RubenKelevra / Recommended MotionEye Settings
Last active December 30, 2022 22:37
Recommended MotionEye Settings (version 4.3.2 at the time of writing) capturing a large area with walking people with an ESP32-CAM (OV2640)
View Recommended MotionEye Settings
"""Calculate jerks in the recent history (sliding exponential average) from lateral acceleration data"""
from __future__ import annotations
import time
from collections import deque
from math import hypot
from numpy import ma, logspace
RubenKelevra / grocyAddMessurements.php
Created February 10, 2022 17:43 — forked from catatonicChimp/grocyAddMessurements.php
Add messurements to grocy
View grocyAddMessurements.php
$apiaccess =[
"url" => "https://grocy.yourdomain.tld/api",
"key" => ""
$quantity_units = [
"Cup US" => [
"name" => "Cup US",
"description" => "",
"name_plural" => "Cups US"
View high power indirect lights.yaml
alias: 'Bedroom auto turn on High Power Lights '
description: ''
- platform: numeric_state
entity_id: switch.adaptive_lighting_bedroom
attribute: color_temp_kelvin
for: '00:05:00'
above: '5000'
- platform: state
entity_id: input_boolean.bedroom_lights_master_switch
RubenKelevra /
Created May 4, 2020 18:50
IPFS convert datastore with system service installation

Compile the tool via your user account

echo "$GOPATH" -> if empty go to ~/go/bin/, else "$GOPATH/bin/"

copy the ipfs-ds-convert binary to /tmp/:

cp -a ipfs-ds-convert /tmp/

convert your datastore:

View gist:7a913f379afe758b083c3867c0ee5827
I understand that there's the ability to build a cluster with ipfs-cluster, with friends. But this is a shared storage space (everybody can delete stuff - not very good).
How about adding the ability to add peers as friends to a list, and give them the ability to store a given amount of bytes on my hard drive?
This could create a Web of Trust.
When the friend will pin a file, the file can be sharded and replicated according to his specifications to his list of peers - I will get also some parts of the file.
To acknowledge (somewhat reliably) that a "friend" peer still holds the data, he can be asked like once a day to XOR a salt to the file and send me the checksum. A list of salted-checksums can be calculated before seeding, avoiding that the data has to remain "local" to ask the nodes that they still hold our chunks reliably.