Skip to content

Instantly share code, notes, and snippets.

View Lucent's full-sized avatar

Michael Dayah Lucent

View GitHub Profile
@Lucent
Lucent / watchhistory.sh
Last active April 3, 2024 22:48
View Plex watch history by user on Synology
#!/bin/bash
db_loc="/volume1/Plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db"
names=$(sqlite3 "$db_loc" "SELECT name from accounts;")
counter=0
while read -r name; do
let counter++
echo "$counter : $name"
nameArray[counter]=$name
done <<< "$names"
read index
@Lucent
Lucent / thread_replies.py
Last active March 27, 2024 18:21
Convert Bluesky JSON export to plain text separated by day with replies, embeds, images, and facets to markdown
# Process account JSON export from https://observablehq.com/@aendra/bluesky-backup-tool
import json
import sys
def read_json(filename):
with open(filename, 'r') as file:
return json.load(file)
def transform_text_to_markdown(text, facets):
@Lucent
Lucent / spotify_library.txt
Last active January 12, 2024 17:16
Spotify library sorted by artist
https://open.spotify.com/local///Here%20Comes%20The%20Boom%20-%20Nelly/235
https://open.spotify.com/local///The%20Living%20Tombstone%20Gypsy%20Bard%20%5Bremix%5D/196
https://open.spotify.com/track/19X5dUlxVWC5jDg3eOysMz
https://open.spotify.com/track/316r1KLN0bcmpr7TZcMCXT
https://open.spotify.com/track/0ibdklhZmwLo3bzHqF435c
https://open.spotify.com/track/7pSJmBTlbA4S5zSLsj6Pzz
https://open.spotify.com/track/5q10Ov2JEbODDK2tk4NYWW
https://open.spotify.com/track/6rEr7AsF3cmfUR3birakRF
https://open.spotify.com/track/6Fe3Flc9SjE03pqwD6PVQl
https://open.spotify.com/track/0HDaKOlVAfUWXdFR2RhBtN
@Lucent
Lucent / routing.md
Last active August 30, 2023 22:05
Fantasy of Trees Teardown Routing

As early as possible

  • Obtain a list of all possible items that can be sold and their creators from Teresa Booth.

Throughout the show

  1. As items are sold, mark them off on master list as either pick-up or delivery.
  2. Enter each delivery item into Microsoft Streets & Trips and rename the pushpin as the code with no leading zeros (A-9 vs A-009). Include pick-up items if purchased with deliverable trees (A-9, TT-5, D-15).
  3. Change pushpins to icons for numbers 1-10 for cardinal directions.

At teardown

  1. Saturday A.M. walk the showroom floor and find every item not marked as sold for delivery or pickup.
@Lucent
Lucent / totp-paypal-ebay.html
Last active August 30, 2023 18:57
Use Google Authenticator/TOTP/2FA on PayPal and eBay. Obsolete now that they offer it.
<html ng-app="textInputExample">
<head>
<base href="/QRCodeInHTML/">
<link rel="stylesheet" href="bootstrap.min.css">
<style>p, span { font-size: x-large; }</style>
</head>
<body ng-controller="QRController" style="margin: 1em;">
<?php
$credential = shell_exec('vipaccess provision -t VSMT -p');
$credentials = explode("\n", $credential);
@Lucent
Lucent / bash_utilities.sh
Last active July 5, 2023 00:35
Useful bash one-liners
# Remove all empty folders
find . -maxdepth 1 -type d -empty -print0 > empty.txt; xargs -0 rmdir < empty.txt
# Remove empty folders 2 levels deep, and their parent
find . -maxdepth 2 -type d -empty > empty.txt; rmdir $(<empty.txt)
find . -maxdepth 1 -type d -empty > empty.txt; rmdir $(<empty.txt)
# Move all folders with certain name into their own named folder
find -maxdepth 2 -name 'lavajava' -printf '%h\n' > lavajava.txt; mkdir lavajava; mv $(<lavajava.txt) lavajava/
@Lucent
Lucent / lightroom-sync.md
Last active June 14, 2023 21:04
Lightroom CC/Cloud and Lightroom Classic synchronization

How to use Classic and keep a cloud backup of full-size originals and videos

I have no interest in organizing using CC's Collections and prefer to use folder hierarchy from Classic.

  • Keep Import folder separate to catch problems! Preferences, Lightroom Sync, Location, Specify location for Lightroom's Synced images
  • Set Catalog Settings > Metadata > Automatically write changes into XMP so removing from Classic to add back some data is recovered
  • Video edits don't propagate, but if added to CC first, they can be moved among synced Collections

https://community.adobe.com/t5/lightroom-classic-discussions/persistent-sync-issues-in-lightroom-classic-with-dng-and-tif/m-p/13163319

@Lucent
Lucent / mortgage.html
Created June 14, 2020 22:19
Section G mortgage calculator
<html>
<head>
<title>Section G Mortgage Calculator</title>
<style type="text/css">
TH { text-align: left; font-weight: normal; border: thin solid black; }
INPUT { text-align: right; }
</style>
<script type="text/javascript">
function cents(amount) {
@Lucent
Lucent / debian-8-jessie-efi-nvme.sh
Created November 29, 2019 23:26
Install Debian 8 Jessie on NVMe disk in UEFI mode
# Must use DVD or netinst images. CD image does not boot into UEFI mode.
# Disable CSM in BIOS.
# Clear secure boot keys.
# Expert install
# Alt+F2 to open shell
cd /target
mount --rbind /proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
@Lucent
Lucent / wake-up.bas
Created November 30, 2019 22:49
Use modem for wake-up call
CLS
WakeupTime$ = "11:02:00"
OPEN "COM1:9600,N,8,1,BIN" FOR OUTPUT AS #1 ' Open the COM port
LOCATE 10, 10, 0: PRINT "Current Time: ";
LOCATE 11, 10, 0: PRINT " Wakeup Time: "; WakeupTime$;
DO
LOCATE 10, 24, 0: PRINT TIME$;