Skip to content

Instantly share code, notes, and snippets.

@Akczht
Akczht / xld-config-reset.txt
Last active March 12, 2024 08:07
XLD Configuration Reset
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:
@Akczht
Akczht / ffmpeg-compile-macos.txt
Last active April 18, 2024 11:58
FFmpeg Compilation macOS
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
@Akczht
Akczht / mpv-build.txt
Last active July 31, 2024 18:09
How to compile mpv.app on macOS
#!/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
@Akczht
Akczht / renamer.sh
Last active August 6, 2024 01:55
A bulk file renaming script using bash, which renames files from a text file containing names
#!/bin/bash
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")
done < "$names_file"
@Akczht
Akczht / renamer.py
Last active August 6, 2024 01:55
Renames files in a directory using names from a text file.
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.
@Akczht
Akczht / base.sh
Last active July 31, 2024 13:28
base dependencies for ntfs-3g
#!/usr/bin/env 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
@Akczht
Akczht / defaults.txt
Last active August 25, 2024 20:26
Sensible Microsoft Office Defaults for macOS
defaults write com.microsoft.office SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.office ShowFileExtensions -bool TRUE
defaults write com.microsoft.Word SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Excel SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Powerpoint SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.Office365ServiceV2 SendAllTelemetryEnabled -bool FALSE
defaults write com.microsoft.autoupdate2 SendAllTelemetryEnabled -bool FALSE
@Akczht
Akczht / trim.sh
Created October 11, 2024 17:20
trims videos from start for a few seconds
#!/bin/bash
# Set default values for input and output formats
input_format="mkv"
output_format="mkv"
# Folder containing the video files
input_folder="./" # Change this if needed
# Create a directory for processed files
@Akczht
Akczht / ffmpeg.sh
Created October 30, 2024 21:24
A script to run ffmpeg on all the files in a folder and remux videos
#!/bin/bash
# Set input and output extensions
input_ext="mkv" # Default input extension is .mkv
output_ext="mkv" # Default output extension is .mp4
arguments="-codec copy -map 0:v -map 0:a:2 -map 0:s -map 0:t"
# Create output directory
output_dir="$PWD/dir"
mkdir -p "$output_dir"
@Akczht
Akczht / mpv.conf
Last active November 13, 2024 17:47
This is my mpv config for my Apple Silicon mac
# Player #
no-border
no-osc
window-scale=0.8
# Screenshots #
screenshot-template="%x/%F-T%wH.%wM.%wS.%wT-F%{estimated-frame-number}"
screenshot-format=png
screenshot-png-compression=9