Skip to content

Instantly share code, notes, and snippets.

@jklap
jklap / gist:1e80ea3a5bb7ccc5021d276f1201450f
Last active January 22, 2024 22:24
Wave2 Battery & esphome
# https://esphome.io/guides/automations.html#interval-component
interval:
# trigger the update to fetch battery
- interval: ${temp_update_interval}
then:
- ble_client.ble_write:
id: "airthings_${wave_serial}"
service_uuid: "B42E4A8E-ADE7-11E4-89D3-123B93F75CBA"
characteristic_uuid: "B42E50D8-ADE7-11E4-89D3-123B93F75CBA" # 0x10
value: [ 0x6d ]
@tothi
tothi / upgrade_LineageOS_with_Magisk.md
Last active November 6, 2024 11:50
Upgrading LineageOS and reinstalling Magisk

Upgrade LineageOS with Magisk

WARNING: tested only on my setup (LineageOS 18.1 on instantnoodle), other setups may break and brick the device!

Step-by-step instructions (for reinstalling patched boot.img for Magisk):

  1. upgrade LineageOS to the latest by the standard way in Android GUI (download + install + reboot)
  2. if using not the latest Magisk: wipe old (possibly hidden) Magisk app then install the up-to-date one from the official Magisk github repo
  3. install (git clone) payload_dumper from GitHub (in Termux or in an SSH session on the Android device) for the 1st time, or update (git pull) later
  4. the Android terminal session: wget the same LineageOS nightly image installed in step 1 from https://download.lineageos.org/
@alphapapa
alphapapa / fitness.org
Last active October 18, 2024 22:12
An Emacs food/weight/workout tracker self-contained in a single Org file

Plots

/home/me/org/double-plot.png

Tasks

@lxe
lxe / goes16-rtlsdr.md
Last active November 14, 2024 16:14
Receive GOES-16 and GOES-17 Images with a Raspberry Pi and RTL-SDR dongle
@prathik
prathik / todo.el
Last active September 27, 2020 05:27
Manage daily todo files on Emacs
(defun todo-create-directory (directory)
"Creates the todo directory."
(if (file-exists-p directory) (message "Directory exists")
(make-directory directory)
(message "Directory created")
))
(defun create-todo-file (directory filename)
"Checks if the todo file exists if not creates it."
(todo-create-directory directory)
@laurivosandi
laurivosandi / uwebsockets.py
Created August 18, 2017 10:53
Websockets client for MicroPython
"""
Websockets client for micropython
Based very heavily on
https://github.com/aaugustin/websockets/blob/master/websockets/client.py
"""
import ubinascii as binascii
import urandom as random
import ure as re
@heppu
heppu / ARCH_INSTALL.MD
Last active November 28, 2024 17:40
Installing Arch with GPT, dm-crypt, LUKS, LVM and systemd-boot

Create bootable USB

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

Boot from USB and set prepare system

loadkeys <your-keymap>
@basarat
basarat / form.tsx
Created October 6, 2016 05:20
React forms that don't reload page
import * as React from 'react';
interface FormProps {
/**
* Automatically prevents the default browser behavior so you don't have to
*/
onSubmit: () => any;
children?: JSX.Element;
}
export const Form = ({ onSubmit, children}: FormProps) =>
@jaksi
jaksi / mirrorlist.hook
Last active April 28, 2018 12:06
Update pacman mirrorlist using reflector after each upgrade of pacman-mirrorlist
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = pacman-mirrorlist
[Action]
Description = Updating mirrorlist...
When = PostTransaction
Depends = reflector
@celly
celly / gist:c4ea2ebc2957059c138e
Created January 11, 2016 22:19
Printrbot Simple Metal start gcode
Found in this post: https://www.reddit.com/r/PrintrBot/comments/3jm8bc/start_gcode_does_not_extrudeandmove_but_the_code/
Use this to reset, center, and auto-extrudea small bit before printing.
G90 ; Explicitly force absolute positioning in case it was not reset previously.
G28 ; Home all axes.
G29 ; Auto-level the bed.
G0 X0 Y0 Z0.15 F9000 ; Move to the front-left part of the bed.
M109 S{print_temperature} ; Set and wait for extruder temperature.
G92 E0 ; Zero the extruder.