Skip to content

Instantly share code, notes, and snippets.

View MazeW's full-sized avatar
🪻

‮ezaM MazeW

🪻
View GitHub Profile
@MazeW
MazeW / d1mini_relay_wiring.md
Created December 23, 2021 20:55
This is how to connect a tongling relay to a d1-mini (ESP8266)

Connect a 5V relay

I had issues connecting the relay to the wenmos d1-mini (ESP8266 or ESP-12F), turns out you must use the 3v3 pin not 5V.

relay d1
VIN 3v3
GND G
IN D2

You can use any pin you want for IN, but check diagram below for safe GPIO pins that aren't used by something else.

Connect ST7789 to ESP32

Wiring

ESP32 ST7789
GND GND
3v3 VCC
D18 SCL
D23 SDA
D4 RES
@MazeW
MazeW / lastfm 3 char names
Created February 6, 2022 08:54
out of 12500 3 char combo names
bpj
bp6
bqf
bq5
bq6
bq8
bq9
bq0
bse
bs6
@MazeW
MazeW / README.md
Last active November 4, 2023 06:09

hi

lastfm

@MazeW
MazeW / script.js
Created November 22, 2024 23:11
Simple function for getting last.fm user status using native fetch function.
async function getSongInfo(user) {
const url = `https://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&user=${user}&api_key=${API_KEY}&limit=1&format=json`;
const response = await fetch(url);
const json = await response.json();
const track = json.recenttracks.track[0];
return { user: json.recenttracks["@attr"].user, artist: track.artist["#text"], name: track.name, image: track.image[track.image.length - 1]["#text"], playing: ((typeof (track["@attr"]) != "undefined") ? true : false) };
}
// example response:
@MazeW
MazeW / hibernation.md
Last active December 21, 2024 16:19
How to enable hibernation on Arch linux 6.12.4

Enabling Swap and Hibernation on Arch Linux

This only works if you use systemd-boot and not GRUB or anything else.

Follow these steps to enable swap and hibernation on Arch Linux.

1. Check Your RAM and Swap Size

First, check your current RAM and swap usage to ensure the swap file is large enough to store the contents of your RAM: