As a self-proclaimed perfectionist whose attention to detail can sometimes stall my productivity (read OCD), I found myself wanting to speed up a lot of the repetitive tedious tasks I was accumulating.
I have taken a series of small JavaScript hiatuses over my dev journey to branch off of my usual grind and learn something new.
One of those things was bash. Another one of those things was python.
Then I realized that scripting in these two languages was useful for system automation.
This repo is just a list of scripts I have written to automate various productivity and data processing tasks. You can use them for reference or adapt them for your own automation needs. Also feel free to ask me questions about them if you are learning to script too.
- aac_192k_vbr.sh
- Convert current directory's FLAC files to m4a (192kbps, aac, lossy) for playback and portability.
- audio_raffle.py
- Select and open a random song from your music library for playback.
requirements:- The
DATA_DIRS
variable must have at least one valid path to select music from. - The
MEDIA_PLAYER
variable must contain the path to your media player's executable for playing back your music files (VLC is recommended).
- (optional) add a genre as an argument to limit the search to a certain genre
- The
- bt_watch.sh / bt_watch_win10.sh
- Watch local IP for changes, and kill Bittorrent client on change.
requirements:- (win10 version) The
BT_CLIENT
variable must be set to your torrent client's binary path (*.exe) containing the text files to be re-encoded.
- (win10 version) The
- dupFinder.py
- Find and ouput file duplicates. Checks against file's content regardless of if file name differs.
- encode.py
- Re-encode a directory's text files to UTF-8.
requirements:- The
DATA_DIR
variable must be set to a valid path containing the text files to be re-encoded. - The
OUPUT_DIR
variable must be set as the output location for the newly encoded UTF-8 files.
- The
- ffmkv.sh
- Convert current directory's Matroska files (*.mkv) to mp3 files for passive listening and daily language immersion.
parameters:- (optional) a track number can be specified in the first argument (
$1
) to target a specific track to be re-encoded; if the file(s) have multiple audio tracks, and no track number is specified, the first audio track will be used by default
- (optional) a track number can be specified in the first argument (
- ffmp4.sh
- Convert current directory's *.mp4 / *.avi files to mp3 files for passive listening and daily language immersion.
- mux.sh - special script for AJATT/Japanese learners – contact me for usage info
- Multiplex two video files— the first containing your main audio and video stream, and the second containing your supplemental audio stream. I wrote this because some of the content I acquire has extra audio tracks and Matroska is so freakin' convenient for handling multiple audio tracks in video files.
- sentence_search.py
- Search a directory for all text files (must be UTF-8) containing a certain word and compile sentences into a single text file with filename references.
- video_raffle.py
- Select and open a random, video, movie, or series from your video library for playback.
requirements:- The
DATA_DIRS
variable must contain at least one valid path with video files. - The
SERIES_DIR_IDENTIFIER
must contain a string (usually the name of a subfolder) that identifies if the chosen file is in a series directory. - The
MOVIE_DIR_IDENTIFIER
must contain a string (usually the name of a subfolder) that identifies if the chosen file is in a movie directory. - The
MEDIA_PLAYER
variable must contain the path to your media player's executable for playing back your music files (VLC is recommended).
- (optional) add the
--movie
flag if you would like to open a movie - (optional) add the
--series
flag if you would like to open an entire series
- The