Skip to content

Instantly share code, notes, and snippets.

@DarthJahus
DarthJahus / convert_av1.py
Last active November 24, 2025 18:42
Convert subfolders' content to AV1.
#!/usr/bin/env python3
"""
convert_av1.py
Exploration non-récursive des sous-dossiers directs de RootFolder.
Pour chaque sous-dossier:
- cherche les .mkv
- extrait un ID YouTube (dernier motif de 11 chars [A-Za-z0-9_-]{11} ou dernier token trouvé)
- vérifie (optionnel) présence dans archive.txt (lu à chaque fichier)
- vérifie done.txt (par dossier) pour ne pas re-traiter
@DarthJahus
DarthJahus / yt_dl_folders.ps1
Last active November 23, 2025 22:18
Check folders for .url files and download YouTube playlists
param(
[string]$BaseFolder = "F:\.temp\dl",
[string]$YTDLScript = ".\ytdl.ps1",
[string]$DownloadFolder = $null,
[string]$YTDL = $null,
[string]$Cookies = $null,
[string]$DownloadArchive = $null,
[int]$MinDuration = $null,
[int]$MaxDuration = $null
)
@DarthJahus
DarthJahus / ytdl_av1.ps1
Last active November 23, 2025 22:43
yt-dlp + transcode to AV1 (AMD)
param(
[string]$DownloadFolder = "F:\.temp\dl\Fillers",
[string]$YTDL = "yt-dlp",
[string]$Cookies = "A:\Secure\youtube.com_cookies.txt",
[string]$DownloadArchive = ".\yt-dlp.list.txt",
[int]$MinDuration = 0,
[int]$MaxDuration = 0,
[string[]]$Urls
)
param(
[Parameter(Mandatory = $true)]
[string]$Source,
[Parameter(Mandatory = $true)]
[string]$Destination,
[int]$Bitrate = 40,
[ValidateSet("speed", "balanced", "quality", "high_quality")]
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb http://repo.pritunl.com/stable/apt jammy main
EOF
# Import signing key from keyserver
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
# Alternative import from download if keyserver offline
curl https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | sudo apt-key add -
sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list << EOF
@DarthJahus
DarthJahus / instructions.md
Created February 26, 2022 19:00 — forked from douglasmiranda/instructions.md
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret &gt; keybase-private.key
@DarthJahus
DarthJahus / silly_addition.py
Created September 21, 2020 11:41
Solution to 16+18=214 at Codewars (Python)
# Jahus
# 2020-09-19
# Passes tests at Codewars / 16+18=214
# https://www.codewars.com/kata/5effa412233ac3002a9e471d/train/python
def decompose(num):
if num != 0:
_vec = []
while num > 0:
@DarthJahus
DarthJahus / weighted_jabberwocky.py
Created September 11, 2020 13:30
Script to generate giberish words given letters, weights and lenght. Created and used for typing practice.
# Jahus
# 2020-09-11
# Weighted Jabberwocky
import random
_letters = "aerlndvtxyhbpsoigzmfqkcwuj"
_speeds = [45, 41, 32, 31, 30, 26, 26, 25, 25, 24, 23, 23, 22, 22, 21, 20, 20, 20, 20, 16, 15, 15, 15, 12, 12, 8]
_letters = [i for i in _letters]
@DarthJahus
DarthJahus / ExifFolders.py
Created September 8, 2019 22:21
Read EXIF data from image and video files and sort theses files in a custom structure (folders and subfolders representing years, months and days…).
from PIL import ExifTags, Image
from os import listdir, mkdir
from os.path import isfile, join, isdir, getmtime
from datetime import datetime
import shutil
files = [f for f in listdir('.') if isfile(join('.', f))]
__folder_structure = ["%Y", "%Y-%m (%Y-%B)", "%Y-%m-%d"]
@DarthJahus
DarthJahus / slack_delete_messages.js
Created March 5, 2019 22:06
NodeJS script to delete messages in a Slack channel.
#!/usr/bin/env node
// Channel ID is on the the browser URL.: https://mycompany.slack.com/messages/MYCHANNELID/
// Pass it as a parameter: node ./delete-slack-messages.js CHANNEL_ID
// CONFIGURATION #######################################################################################################
const token = ''; // You can learn it from: https://api.slack.com/custom-integrations/legacy-tokens
// GLOBALS #############################################################################################################