Skip to content

Simple bash and python scripts I have written for batch file processing, data processing, and bulk automation.

Notifications You must be signed in to change notification settings

barkdoll/scripts

Repository files navigation

Scripts for automating the daily monotony

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.

And I was like OH YES.

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.

Scripts Functionality Index

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:
  1. The DATA_DIRS variable must have at least one valid path to select music from.
  2. The MEDIA_PLAYER variable must contain the path to your media player's executable for playing back your music files (VLC is recommended).
parameters:
  • (optional) add a genre as an argument to limit the search to a certain genre
bt_watch.sh / bt_watch_win10.sh
Watch local IP for changes, and kill Bittorrent client on change.
requirements:
  1. (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.
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:
  1. The DATA_DIR variable must be set to a valid path containing the text files to be re-encoded.
  2. The OUPUT_DIR variable must be set as the output location for the newly encoded UTF-8 files.
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
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:
  1. The DATA_DIRS variable must contain at least one valid path with video files.
  2. 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.
  3. 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.
  4. The MEDIA_PLAYER variable must contain the path to your media player's executable for playing back your music files (VLC is recommended).
parameters:
  • (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

About

Simple bash and python scripts I have written for batch file processing, data processing, and bulk automation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published