Skip to content

Instantly share code, notes, and snippets.

View lesterlo's full-sized avatar
😽
Cat Lover

Lester Lo lesterlo

😽
Cat Lover
View GitHub Profile
@lesterlo
lesterlo / additional_install.sh
Last active March 1, 2024 15:49
Nvidia sdkmamger
sudo apt install libxshmfence1 libglu1 libatk-bridge2.0-0 libatk-bridge2.0-0 libgbm1 libx11-xcb-dev
@lesterlo
lesterlo / .condarc
Last active January 12, 2023 03:54
Backup all environment from anaconda
# Place this to your home directories
# If you use this config, all of the envs will store into your home directories
channels: [conda-forge]
auto_activate_base: false
envs_dirs:
- /Users/"YOUR_HOME_DIR"/.conda/envs
@lesterlo
lesterlo / znp-uart-test.py
Created June 2, 2021 02:35 — forked from omerk/znp-uart-test.py
ZNP UART Comms Test
#!/usr/bin/env python3
# znp-uart-test
#
# Use this script as a sanity check after you burn the ZNP coordinator
# firmware on your zzh stick.
#
# !! Before you run this script, make sure you flash the
# latest Z-Stack Coordinator firmware on your zzh stick.
#
@lesterlo
lesterlo / remove_vbird_bg.js
Created May 16, 2021 15:49
Remove linux.vbird.org background image for better dark theme quality using dark reader
// ==UserScript==
// @name Remove vbird background image
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Remove vbird background image for better dark theme quality using dark reader
// @author Lester Lo
// @match http://linux.vbird.org/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

Mount the Home Assistant OS disk Image on Mac

Introduciton

In macOS, the home Assistant OS disk Image cannot be mount automatically. The system will propt a Mount Error alert.

To solve this problem, we need to mount the disk manuelly.

@lesterlo
lesterlo / apple_hidpi_list.md
Last active September 16, 2025 15:42
Apple display HiDPI resolution list

Below table listed the HiDPI resolution on all apple device.

Mac Display Type Air/Pro 13" (Intel) Air/Pro 13" (M1) Pro 16" iMac 21.5" iMac 27" Pro Display XDR
Monitor Size 13 inch 13 inch 16 inch 21.5 inch 27 inch 32 inch
Native Resolution 2560 x 1600 2560 x 1600 3072 x 1920 4096 × 2304 5120 x 2880 6016 x 3384
HiDPI Level 1 1024 x 640 1024 x 640 1152 x 720 1280 x 720 * 1600 x 900 * 1504 x 846 *
HiDPI Level 2 1280 x 800 1280 x 800 1344 x 840 1680 x 945 * 2048 x 1152 * 1920 x 1080 *
HiDPI Level 3 1440 x 900 1440 x 900 1536 x 960 2048 x 1152 2560 x 1440 2560 x 1440 *
HiDPI Level 4 1680 x 1050 1680 x 1050 1792 x 112
@lesterlo
lesterlo / patch-edid.md
Created December 31, 2020 15:28 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@lesterlo
lesterlo / uninstall_vnc.sh
Created July 21, 2020 08:47
Uninstall RealVNC-VNC Viewer on Linux
#!/bin/bash
sudo rm /usr/share/man/man1/vncviewer.1
sudo rm /usr/share/man/man1/vncaddrbook.1
sudo rm /usr/share/man/man1/vncserver-x11.1
sudo rm /usr/share/man/man1/Xvnc.1
sudo rm /usr/share/man/man1/vncserver-virtual.1
sudo rm /usr/share/man/man1/vncserver-virtuald.1
sudo rm /usr/share/man/man1/vncserver-x11-serviced.1
sudo rm /usr/share/man/man1/vncpasswd.1
sudo rm /usr/share/man/man1/vnclicense.1
@lesterlo
lesterlo / k2pdfopt_usage.md
Last active June 13, 2020 18:58
Add table of content to existing PDF file

Command

k2pdfopt -mode copy -n -toclist toc.txt srcfile.pdf -o outfile.pdf

# Copy mode, Native PDF output

file Format

toc.txt

@lesterlo
lesterlo / config.txt
Created May 14, 2020 17:20
Raspberry Pi additional Boot config option
# Change ACT LED to display SDCard R/W status
dtparam=act_led_trigger=mmc0
dtparam=act_led_activelow=off
# Change PWR LED to display OS error
dtparam=pwr_led_trigger=panic
dtparam=pwr_led_activelow=off