Skip to content

Instantly share code, notes, and snippets.

@lapo-luchini
lapo-luchini / spotify-csv-to-m3u.py
Last active January 18, 2026 09:51 — forked from lambdan/spotify-csv-to-m3u.py
Spotify CSV (Exportify) to m3u by matching ISRC
import os, json, csv, sys, subprocess
from tqdm import tqdm
# Export from Spotify using exportify.app, then run this on it when you have the songs!
metaFile = "meta.json"
audioExts = [".mp3", ".flac", ".ogg", ".opus", ".wav", ".m4a", ".aac"]
musicDir = "/Volumes/Media/Music/Organized/" # CHANGE THIS!
playlistBasepath = "../" # CHANGE THIS relative to musicDir from the playlists perspective
@lapo-luchini
lapo-luchini / smartmon_exporter.sh
Last active February 19, 2021 16:13 — forked from hadret/smartmon.sh
smartmon.sh script adapted for FreeBSD
#!/bin/sh
# Script informed by the collectd monitoring script for smartmontools (using smartctl)
# by Samuel B. <samuel_._behan_(at)_dob_._sk> (c) 2012
# source at: http://devel.dob.sk/collectd-scripts/
# TODO: This probably needs to be a little more complex. The raw numbers can have more
# data in them than you'd think.
# http://arstechnica.com/civis/viewtopic.php?p=22062211
# can be add to /etc/crontab like this, and node_exporter will see it automatically:
@lapo-luchini
lapo-luchini / change-favicon-from-CSS.js
Last active May 4, 2021 03:07 — forked from mathiasbynens/change-favicon.js
Dynamically change favicon from CSS. (does not work on Internet Explorer and Safari)
/*! dynamically change favicon from CSS (does not work on Internet Explorer and Safari)
*
* use with:
* <link id='linkCSS' href='my.css' type='text/css' rel='stylesheet' />
* <link id='favicon' rel="shortcut icon" href="../images/favicon.png" type="image/png" />
*
* my.css can contain:
* #favicon { background-image: url(any valid URL); }
*/