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 / install-digits-centos7.sh
Created February 8, 2017 16:49 — forked from lukeyeager/install-digits-centos7.sh
Install DIGITS and NVcaffe on CentOS 7
# nvidia-docker run -ti nvidia/cuda:7.0-devel-centos7
yum update
yum install epel-release
yum install gcc gcc-c++ git vim python-devel python-pip make cmake \
blas-devel lapack-devel openblas-devel \
protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel gflags-devel glog-devel lmdb-devel libjpeg-devel libpng-devel
# Too old:
# yum install Cython scipy python-matplotlib
@lesterlo
lesterlo / lester_mod.zsh-theme
Last active November 27, 2019 10:12
My Simple and clean oh_my_zsh theme
#prompt setting
PROMPT="%{$fg_bold[yellow]%}%c " #show the current folder name
PROMPT+="%(?:%{$fg_bold[green]%}>:%{$fg_bold[red]%}>) %{$reset_color%}"
RPROMPT=' $(git_prompt_info)'
#git setting
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[cyan]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[red]%}*%{$reset_color%}%{$fg[cyan]%}]"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[cyan]%}]"
@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
@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 / 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 / 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 / apple_hidpi_list.md
Last active December 4, 2024 06:27
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

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 / 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==
@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.
#