This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pathlib | |
def rename_files(directory, names_file, add_numbers=False, keep_extension=True): | |
"""Renames files in a directory using names from a text file, sorting files by name, optionally adding numbers with leading zeros, and optionally keeping extensions. | |
Args: | |
directory: The path to the directory containing the files. | |
names_file: The path to the text file with new names. | |
add_numbers: If True, adds numbers to the new file names. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
directory="/path/to/your/directory" | |
names_file="/path/to/your/names.txt" | |
# Read new names into an array | |
new_names=() | |
while IFS= read -r line; do | |
new_names+=("$line") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
findcd() { | |
local search_string="$1" | |
target_dir=$(find . -maxdepth 1 -type d -name "$search_string*" -print -quit) | |
if [ -n "$target_dir" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling FFmpeg with Build Options | |
This guide outlines the steps to compile FFmpeg with specific build options using the ./configure script. | |
Prerequisites | |
Ensure you have the following prerequisites installed on your system: | |
- GCC compiler | |
- Git | |
- GNU Make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To remove the old configuration of XLD (X Lossless Decoder) on a Mac by deleting two files, you can follow these steps: | |
1. Open Finder: | |
- Click on the Finder icon in your Dock or open a new Finder window. | |
2. Navigate to the XLD configuration files and delete the XLD configuration files: | |
- XLD configuration files are typically stored in the user's home directory. | |
- Go to the following paths, look for these files they are (currently) named something like: | |
NewerOlder