Skip to content

Instantly share code, notes, and snippets.

View pladaria's full-sized avatar
👾

Pedro Ladaria pladaria

👾
View GitHub Profile
@pladaria
pladaria / avoid-susped-if-ssh-session-active.md
Created October 28, 2026 22:35
Ubuntu: Suspend laptop when lid is closed and no SSH sessions are active

Ubuntu: Suspend laptop when lid is closed and no SSH sessions are active

Automatically suspend an Ubuntu laptop when its lid is closed, but keep it running while incoming SSH connections are active.

Tested on Ubuntu 26.04 LTS with systemd.

Behavior

Lid SSH connections Behavior
@pladaria
pladaria / atokenophobia.md
Created July 16, 2026 09:35
Atokenophobia

Atokenophobia

/eɪˌtoʊkənəˈfoʊbiə/

noun [uncountable] (Digital Culture, AI Tech slang) The irrational fear or persistent anxiety of running out of AI processing tokens.

@pladaria
pladaria / a24.md
Last active January 29, 2026 14:11

A24 Movies (Ranked by Tomatometer)

  • On Becoming a Guinea Fowl (2024) (🍅 100%)
    • A woman returns to Zambia to attend the funeral of her uncle. As funeral preparations unfold, she must navigate complex family dynamics.
  • Lady Bird (2017) (🍅 99%)
    • A teenager navigates a loving but turbulent relationship with her strong-willed mother over the course of an eventful and poignant senior year of high school.
  • Eighth Grade (2018) (🍅 99%)
  • An introverted teenage girl tries to survive the last week of her disastrous eighth grade year before
@pladaria
pladaria / jodoverse.md
Last active March 15, 2025 19:35
Jodoverse
@pladaria
pladaria / use-is-virtual-keyboard-open.ts
Last active April 29, 2024 18:12
Detect if Virtual Keyboard is open in web app using React
const useIsVirtualKeyboardVisible = () => {
const [isVirtualKeyboardVisible, setIsVirtualKeyboardVisible] = React.useState(false);
React.useEffect(() => {
// probably incomplete, good enough for me
const inputTypesThatOpenTheVirtualKeyboard = ['text', 'email', 'password', 'number', 'search'];
const handleFocus = (event: Event) => {
if (
event.target instanceof HTMLTextAreaElement ||
@pladaria
pladaria / tesseract-tsv-to-json.js
Created April 8, 2023 11:33
Tesseract OCR tsv to json converter
const tesseractTsvToJson = (tsvFilename, jsonFilename) => {
console.log(`> tsvToJson ${tsvFilename} => ${jsonFilename}`);
const tsvLines = fs.readFileSync(tsvFilename, 'utf-8').trim().split('\n').reverse();
/** @type {any} */
const json = {pages: []};
// discard header
tsvLines.pop();
@pladaria
pladaria / vitashell-usb-mount-linux.md
Last active January 19, 2023 11:28
How to mount PSVita in linux using VitaShell and a USB cable
  • Linux Mint 20.2 x86_64
  • Kernel 5.4.0-135-generic

Remove exfat-fuse and exfat-utils packages

sudo apt-get remove exfat-fuse exfat-utils

Install exfat-linux.

@pladaria
pladaria / bo-mx4000-sw2.0-notes.md
Last active December 5, 2025 00:52
Bang & Olufsen MX4000 SW 2.0 Notes
@pladaria
pladaria / clean-up-boot-partition-ubuntu.md
Created December 20, 2019 09:45 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@pladaria
pladaria / Logitec-z960-IR-codes.md
Created December 12, 2019 11:35
Logitech Speaker System Z906 remote IR codes