Skip to content

Instantly share code, notes, and snippets.

@scateu
scateu / Makefile
Last active August 28, 2026 09:07
imap2markdown: markdown, txt, org file bi-directional sync to IMAP
IMAP_REMOTE_FOLDER := Drafts
IMAP_HOST := imap.example.com
IMAP_USER := rss
IMAP_LOCAL_FOLDER := .
edit:
make sync
ranger .
make sync
@scateu
scateu / system.dtb
Created August 15, 2026 01:10
Pomera DM250 System Original Device Tree
/dts-v1/;
/ {
#address-cells = <0x01>;
#size-cells = <0x01>;
compatible = "rockchip,rk3128";
rockchip,sram = <0x01>;
interrupt-parent = <0x02>;
chosen {
@scateu
scateu / BOOT-SPEEDUP.md
Created August 14, 2026 06:35
Raspberry Pi 4, PocketTerm35 - Boot Speed Up

Raspberry Pi Boot Speedup — Findings & Changes

Target: pi@192.168.1.135 — Raspberry Pi (PocketTerm 3.5" / Waveshare display), headless console use OS: Debian GNU/Linux 13 (trixie), systemd 257 Kernel: 6.18.40-v8-cjk+ (custom kernel8-cjk.img) Date: 2026-08-14


Result

#!/bin/bash
# simple bash script to remove duplicated RSS items from rss2email
r2e list > r2e-list.txt
cat r2e-list.txt |cut -d'(' -f2 |awk '{print $1}' |sort |uniq -c | grep '2 http' > a
while read line; do cat r2e-list.txt |grep `echo $line |cut -d/ -f3` | tail -n1; done < a > b
cat b |cut -d: -f1|sort |uniq | xargs r2e delete
rm -i a b r2e-list.txt
@scateu
scateu / H2 & H3
Last active August 23, 2025 13:01
Bookmarklet - Convert HTML <h2> tag into foldables
javascript:(function(){
function wrapInDetails(el) {
var details = document.createElement('details');
var summary = document.createElement('summary');
summary.style.display = 'flex';
summary.style.alignItems = 'center';
summary.appendChild(el.cloneNode(true));
details.appendChild(summary);
while (el.nextElementSibling && !['H2', 'H3'].includes(el.nextElementSibling.tagName)) {
details.appendChild(el.nextElementSibling);
@scateu
scateu / go-webdav-server.go
Created April 10, 2025 08:48
go-webdav-server
// SRC: https://chai2010.cn/post/2018/webdav/
// USAGE: go run c.go -user=user -password=123456 -dir=. -http :8081
// go run main.go -https-mode -user=user -password=123456 -dir=/path/to/dir
package main
import (
"flag"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/webdav"
@scateu
scateu / init.el
Last active March 2, 2025 04:44
Minimalist Emacs Org Capture Configuration - Using Emacs as a notebook and notebook only
; Usage:
; put the following files to ~/.emacs.d/init.el
; Fire up Emacs.
; C-c c t will add an todo item to ~/org/todo.org
; C-c c j will add a journal item to ~/org/journal.org
; C-c s will add some date, before you check it later with C-c a t
; Org Capture Template borrowed from Doom Emacs. Thank you!
; M-x nerd-icons-install-fonts will fix the missing icon on bottom left corner.
(global-set-key (kbd "C-c l") #'org-store-link)
@scateu
scateu / pbpaste2keynote.scpt
Last active October 24, 2024 02:32
pbpaste2keynote
-- credit: ChatGPT.
-- This script fetch text from pasteboard and append to the end of opened Keynote.
-- If multiple Keynote opened, the most front will be selected.
-- Usage: Open it in Script Editor.app, export it as an Applcation. Then drag it into Dock.
-- KNOWN BUG: "shortcuts not allowed to sent keystroke, system events blahblah', just kill "System Events" from Activity Monitor.
-- tell application "System Events" to keystroke "c" using command down
tell application "System Events"
if not (exists (processes where name is "Keynote")) then
EDL 01:31:06,916 01:31:10,291 | Dont.Look.Up.2021 | We saw it with our own eyes\Nusing a telescope.
EDL 01:31:11,360 01:31:13,583 | Dont.Look.Up.2021 | we took a fucking picture of it!
EDL 01:31:13,583 01:31:15,291 | Dont.Look.Up.2021 | What other proof do we need?
EDL 01:31:46,215 01:31:48,166 | Dont.Look.Up.2021 | I don't know why we didn't do it.
EDL 01:32:08,666 01:32:11,000 | Dont.Look.Up.2021 | I'm just telling you the fucking truth.
EDL 01:32:17,041 01:32:21,750 | Dont.Look.Up.2021 | Right, well, the president\Nof the United States is fucking lying!
EDL 01:32:21,750 01:32:23,125 | Dont.Look.Up.2021 | [ SPACE 1.4 secs ]
@scateu
scateu / gist:6ceb04c2f107924d58374bb962cdcf76
Last active September 13, 2021 04:19
pbpaste.workflow
# Open "Automator.app", add a new "Quick Action"
# Workflow receives current "files or folders" in "Finder"
#+ Run Shell Script
#+ Shell: /bin/bash
#+ Pass input: as arguments
# Deployment: Keyboard / Shortcuts, bind 'Cmd-Shift-V'
# Usage: copy something to clipboard, click on a folder, press 'Cmd-Shift-V'.
# Contents will be pasted into 'pbpaste.txt'.