Skip to content

Instantly share code, notes, and snippets.

View Lucent's full-sized avatar

Michael Dayah Lucent

View GitHub Profile
Verifying my identity on Peepeth.com 0x4e6dddefc6047242128697caf28bdfec6c845337
@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 / journal_search.php
Created August 19, 2018 04:11
Search and cleanup LiveJournal entries
<?php
if ($_GET["password"] != "password") { ?>
<p>Private search feature. Intrusion logged.</p>
<?php
return; }
set_time_limit(300);
$journal_dir = "C:\documents and settings\michael dayah\my documents\lj backup";
$username = "lucent";
$entry_array = array ();
@Lucent
Lucent / cd_interest.php
Last active August 21, 2018 01:06
Calculate CD interest over term
<?
setlocale(LC_MONETARY, "en_US");
$cd_list = array(
array("Principal" => 250000, "Interest" => 5.05, "Start" => "27 Apr 2007", "Term" => "6 months", "Interest Term" => "6 months"),
array("Principal" => 250000, "Interest" => 5.10, "Start" => "27 Apr 2007", "Term" => "9 months", "Interest Term" => "9 months"),
array("Principal" => 250000, "Interest" => 5.20, "Start" => "27 Apr 2007", "Term" => "12 months", "Interest Term" => "6 months"),
array("Principal" => 250000, "Interest" => 5.00, "Start" => "27 Apr 2007", "Term" => "90 days", "Interest Term" => "90 days")
);
$total = 0;
@Lucent
Lucent / logprism.pl
Created August 18, 2018 17:12
Custom logprism for Ptable
#!/usr/bin/perl -w
#=============================================================================
#
# Copyright (C) 2005 - 2007, Matti Tukiainen, http://ktmatu.com/mt/
#
# Program name : LogPrism (logprism.pl)
# Version : 2.03
# Purpose : LogPrism turns Apache access log files (combined) into
# easy to read color highlighted format where user
# sessions, error status codes, external referrers and
@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
Verifying my Blockstack ID is secured with the address 1GcuXgjPPyChs53Ka2kj2upAgRgpBdzcGY https://explorer.blockstack.org/address/1GcuXgjPPyChs53Ka2kj2upAgRgpBdzcGY
@Lucent
Lucent / rip-dvd-chapters.bat
Created July 31, 2018 03:58
Rip DVD into chapter/title files using VideoLAN
set DVDDrive=E:
set DestPrefix="Whatever"
set Title=2
set FirstChapter=1
set LastChapter=20
for /L %%i in (%FirstChapter%,1,%LastChapter%) do "vlc.exe" --sout "#standard{access=file,mux=ts,dst=%DestPrefix%_c%%i.mpg}" dvdsimple:///%DVDDrive%/#%Title%:%%i-%Title%:%%i vlc://quit
04dda9359cbbe5371631773b15ce7fb757293bf2c95002ab72733438b7d511148b64cca7979276450f4d834fff9743723a52339fa859229d339b128662cd58f514
@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