Unnatural deeds do breed unnatural troubles.

I use my Sansa players as my daily music companions, but also as a DJ-ing backup if something goes wrong with the normal hardware. Since I could not find a good solution for keeping the files in sync with my computer, I wrote my own python script that does it for me.

Specifically, I wanted to achieve 3 things:
 1. Copy playlists (e.g. the evenings dancing playlist as a backup) to the player itself, but avoiding copying files that are already present to speed up the process.
 2. Regularly copy and update ther music that I listen to on the go on the SD card (similar to winamps "AUTOFILL"), but avoiding duplicates on player and SD card, which will show up as duplicates in the database.  
 3. All of this for my Linux music player (clementine), which does not support a direct transfer of playlists.
 

The downloadable script (below) allows this by doing the following.

WHAT IT DOES:

The python script allows to transfer M3U-Playlists from a computer to an mp3 player or its internal SD card. In the process, the required music files are copied from THE COMPUTER to THE PLAYER or the SD card, and then a playlist is created ON THE PLAYER that points to these files.

My computer carries a somewhat peculiar configuration: An SSD with the operating system and home partition, and a regular HD for everything else. Living a in a world, where data matters, I therefore wrote this little script, to backup my home drive to an encrypted veracrypt container on the large normal HD in one command (in principle you could also just cron it). While not useful to prevent the loss of data if the laptop is lost entirely, it is a really nice way to quickly backup my stuff even when not online.

I jsut put the script here as-is, maybe it is useful to you. Use at your own risk.

For my thesis, I wanted to make sure, that all my references, figures, etc. have consisten formatting regarding whitespaces and abbreviations. Furthermore I wanted to check to not have made any of the most common errors, such as duplicate words. For this, I created a script (borrowing from various websites), that basically runs a list of RegExes on the tex/source files, marking most of these things.

Again, I give this script as-is, hoping it may be useful for you. It sure helped me a lot. First, it defines a lot of regexes, then it simply runs each of them on all files and pipes the results to stdout, marking the "problematic" parts.