Skip to content

Instantly share code, notes, and snippets.

View mlouielu's full-sized avatar
🎯
floating

Louie Lu mlouielu

🎯
floating
View GitHub Profile
@mlouielu
mlouielu / parse-tzfile.py
Created February 27, 2024 16:51
Parse tzfile for timezone information
import sys
import struct
import pathlib
def read_till_null(b, start):
end = start
while b[end] != 0:
end += 1
return b[start:end].decode("utf-8")
@mlouielu
mlouielu / restore_darktable_ratings_from_snapshot_database.py
Created November 23, 2023 02:21
Restore Darktable Image Ratings from Snapshot Database
import sqlite3
def get_column(source_db_path, table_name, column_name):
sc = sqlite3.connect(source_db_path)
cursor = sc.cursor()
cursor.execute(f"SELECT id, filename, {column_name} FROM {table_name}")
rows = cursor.fetchall()
cursor.close()
@mlouielu
mlouielu / realsense-camera-formats.patch
Created April 10, 2023 22:07
Intel RealSense `realsense-camera-formats.patch` for kernel 6.2.8
diff --git a/drivers/media/usb/uvc/Makefile b/drivers/media/usb/uvc/Makefile
index c26d12f..d86cf22 100644
--- a/drivers/media/usb/uvc/Makefile
+++ b/drivers/media/usb/uvc/Makefile
@@ -2,2 +2,3 @@
+CONFIG_MODULE_SIG=n
uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \
uvc_status.o uvc_isight.o uvc_debugfs.o
ifeq ($(CONFIG_MEDIA_CONTROLLER),y)
[
{
"name": "SofleKeyboard",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
@mlouielu
mlouielu / uma_first_blood.py
Last active June 27, 2022 13:31
I am lazy | Samsung S20
import subprocess
import time
def click(x: int, y: int, delay: int = 50):
subprocess.check_output(['adb', 'shell', 'input', 'tap', str(x), str(y)])
time.sleep(delay / 1000.0)
def skip(delay: int = 500):
@mlouielu
mlouielu / EU_DCC_QRCode_command_line_README.md
Created January 20, 2022 09:13
Decode EU Digital COVID Certificate (EU-DCC) QR-Code from command line tools

Prereuiqrements

  • sed
  • zbar
  • zlib
  • python-base45
  • python-cbor2

Snippet

@mlouielu
mlouielu / elantouchpad_disable.sh
Created July 27, 2021 01:51
Disable Elan Touchpad. Setting Thinkpad Elan Touchpad Palm Detection on, and Palm Dimensions to minimum.
#!/bin/bash
#
# Disable Elan Touchpad
#
# Setting Thinkpad Elan Touchpad Palm Detection on,
# and Palm Dimensions to minimum.
#
xinput set-prop "Elan Touchpad" `xinput list-props "Elan Touchpad" | grep "Palm Detection" | grep -o '[0-9]\+' | head -n 1` 1
xinput set-prop "Elan Touchpad" `xinput list-props "Elan Touchpad" | grep "Palm Dimensions" | grep -o '[0-9]\+' | head -n 1` 0, 0
@mlouielu
mlouielu / webdav.conf
Created February 10, 2021 02:53 — forked from pawl/webdav.conf
Installing nginx webdav server on ubuntu 20.04
server {
listen 80;
listen [::]:80;
root /var/dav/data;
# dav allowed method
dav_methods PUT DELETE MKCOL COPY MOVE;
# Allow current scope perform specified DAV method
dav_ext_methods PROPFIND OPTIONS;
@mlouielu
mlouielu / purify.py
Last active July 28, 2019 14:59
BibTex Field Purify
# -*- coding: utf-8 -*-
#
# BibTeX Purify
#
# Description
# This script will purify the BibTex file's fields and *overwrite* it
#
# Usage
# $ ./purify.py filename [filenames...]
#

115.159.111.193 151.80.140.13 152.136.40.218 159.65.12.204 159.65.30.66 181.111.181.50 181.123.9.3 181.84.99.212 187.65.164.143 190.190.215.114