Skip to content

Instantly share code, notes, and snippets.

View p-karanthaker's full-sized avatar
🎯
Focusing

Karan Thaker p-karanthaker

🎯
Focusing
View GitHub Profile
@p-karanthaker
p-karanthaker / naruto-kai-sub-fix.sh
Created June 23, 2023 22:53
Converts Naruto Kai .mkv episodes with separate subtitle streams to .mp4 with hardcoded subtitles. Chromecast doesn't like the subtitle streams and displays them with no spacing. The script uses ffmpeg with nvidia hardware acceleration.
#!/bin/bash
# Converts Naruto Kai .mkv episodes with separate subtitle streams to .mp4 with hardcoded subtitles.
# Chromecast doesn't like the subtitle streams and displays them with no spacing.
# The script uses ffmpeg with nvidia hardware acceleration.
#
# Recommend to dryrun first which will echo all commands that it will run. If you're happy with it,
# then run the script without the dryrun flag
# Usage: ./naruto-kai-sub-fix.sh /dir/to/search -dryrun
# Usage: ./naruto-kai-sub-fix.sh /dir/to/search
@p-karanthaker
p-karanthaker / csv-jsonl.py
Last active February 9, 2024 15:43
csv to jsonl example for chatgpt openai api
import csv
import json
with open('source.csv') as csvfile, open("target.jsonl", "a") as jsonfile:
r = csv.reader(csvfile)
next(r, None)
for row in r:
model = {
"messages": [
{