Skip to content

Instantly share code, notes, and snippets.

View johnbarratt's full-sized avatar

John Barratt johnbarratt

View GitHub Profile
@Elwell
Elwell / README.md
Created July 16, 2023 11:44
ESPHome modbus configuration to read a Hiking DDS238-2 ZN/S Energy meter

ESPHome modbus polling of a single phase energy meter

This is my working configuration to poll a http://www.chinaenergymeter.com/1-1-15-dds238-2-zn-s-single-phase-din-rail-type-watt-hour-meter.html (I have the 65A hard wired variant - I've seen postings that the CT clamp version may not be as responsive

I'm using a wemos D1 mini (ESP8266) with a RS485 toTTL module (that's OK at 3.3v). This seems fine using software serial on D1/D2 at a polling rate of every 5s

GOTCHAS

  • If the wemos stays connected to home assistant but CAN'T talk to the meter, HA will re-use the last value rather than marking it offline/NaN/unavailable
@travisbrown
travisbrown / withheld-accounts.csv
Last active May 16, 2023 18:52
Twitter accounts withheld in specific countries, sorted by date of last observed change (most recent first)
Twitter ID Screen name Follower count Countries Observed Reversed
779611043819511809 kebs2theWorld 25 ID 2023-05-14
489399217 cevheriguven 584378 TR 2023-05-13
859035306 pascocle 767 ID 2023-05-13
2889606220 Tipobet_GirisTR 20991 TR 2023-05-13
3389937886 who98408150 715510 TR 2023-05-13
1250630172329402368 qazwsx168888 425623 ID 2023-05-13
1304490800844345355 MyVintageFox 28841 ID 2023-05-13
1357673140797796352 _YFKOfficial 404 IN 2023-05-13
1366132337919016960 JabamiOnly 10690 ID 2023-05-13
// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// @version 1.9.2
// @author @chaoticvibing - GH @busybox11
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/busybox11/53c76f57a577a47a19fab649a76f18e3/raw
@norwegianblueparrot
norwegianblueparrot / bourtange.R
Last active November 25, 2023 03:40
A script to produce a 3D render of Fort Bourtange from LiDAR data
## ----setup,include=FALSE,message=FALSE,warning=FALSE-----------------------------------------------------------------------------------------------------------------------------------------------------
library("here") # 1.0.1
library("sf") # 1.0-14
library("rgl") # 1.2.1
library("geoviz") # 0.2.2
library("raster") # 3.6-26
library("rayshader") # 0.35.7
library("osmdata") # 0.2.5
library("tidyverse") # 2.0.0
@justinschuldt
justinschuldt / raspberry-pi-zero_as_webcam.md
Last active February 25, 2024 07:34
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@cramforce
cramforce / vc.md
Last active April 18, 2021 17:42
Malte's home video conferencing setup
  • Lights: Elgato Key Lights (2, one as actual key light, one as fill light)
    • Looking into these lights can cause fatigue after a while, which sucks if you're doing that all day.
    • I managed to work around it by heavily dimming one light that is in my field of view and moving the other light out of my field of view.
  • Microphone: Blue Snowball Ice
  • Microphone pop filter
  • Wall/ceiling mounts for camera and lights
  • Camera: Sony a6000.
    • This is one of multiple older Sony mirrorless cameras recommended for streaming.
  • Whichever you buy, make sure the reviews mention that it can stay on
@calebporzio
calebporzio / pure_html_css_modal.css
Last active February 28, 2022 18:15
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
@svenmuennich
svenmuennich / clear-purgeable-space.sh
Last active June 25, 2021 09:30
Clearing "purgeable" space on macOS High Sierra (e.g. before installing Windows 10 using BootCamp)
# 1. Check for any local time machine snapshots
tmutil listlocalsnapshots /
# 2. Ask time machine to free 100 GBs of local snapshots. Third parameter '4' probably means high priority (https://apple.stackexchange.com/a/398356)
tmutil thinlocalsnapshots / $((100 * 1024 * 1204 * 1024)) 4
# 3. Make sure that only a `(dataless)` snapshot exists
tmutil listlocalsnapshots /
# 4. List all mounted volumes and find the one mounted on '/' (probably '/dev/disk1s1')
@ammarshah
ammarshah / all_email_provider_domains.txt
Last active May 19, 2024 00:32
A list of all email provider domains (free, paid, blacklist etc). Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
0-mail.com
007addict.com
020.co.uk
027168.com
0815.ru
0815.su
0clickemail.com
0sg.net
0wnd.net
0wnd.org
@niw
niw / fetch_nike_puls_all_activities.bash
Last active April 10, 2024 08:48
A simple NikePlus API description to fetch past run metrics
#!/usr/bin/env bash
# fetch_nike_puls_all_activities.bash
# A simple bash script to fetch all activities and metrics from NikePlus.
# See `nike_plus_api.md` for the API details.
readonly bearer_token="$1"
if [[ -z "$bearer_token" ]]; then
echo "Usage: $0 bearer_token"
exit