Skip to content

Instantly share code, notes, and snippets.

View adrianjagielak's full-sized avatar
🚀
Deploying stuff

Jagi ᯅ adrianjagielak

🚀
Deploying stuff
View GitHub Profile
@adrianjagielak
adrianjagielak / JetBrains trial reset.md
Created May 1, 2025 17:11 — forked from h3ssan/JetBrains trial reset.md
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@adrianjagielak
adrianjagielak / JetBrains trial reset.md
Created May 1, 2025 17:11 — forked from h3ssan/JetBrains trial reset.md
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@adrianjagielak
adrianjagielak / convert_to_tinytv2.sh
Last active January 10, 2025 14:58
A shell script that uses ffmpeg to convert your video files into the correct format for the TinyTV2. This script takes one input parameter (the path to the video file), checks if the file is already an .avi, and then converts it with the appropriate settings.
#!/bin/bash
# Check if the input parameter is provided
if [ -z "$1" ]; then
echo "Error: No video file specified."
echo "Usage: $0 <video_file>"
exit 1
fi
INPUT_FILE="$1"
@adrianjagielak
adrianjagielak / yt-dlp YouTube Music to m4a with artwork and metadata
Last active November 28, 2024 20:59
This command downloads high-quality audio files from YouTube/YouTube Music in .m4a format and embeds cropped square album artwork and metadata. Perfect for importing music into Apple Music or other libraries. (Tested with yt-dlp version 2024.11.18, ffmpeg version 7.1_3 on macOS 15.2)
yt-dlp "song or playlist URL" \
-f "bestaudio[ext=m4a]" --extract-audio --audio-format m4a \
--embed-thumbnail --convert-thumbnail jpg --embed-metadata --add-metadata \
--write-info-json --write-thumbnail \
--exec-before-download "ffmpeg -i %(thumbnails.-1.filepath)q -vf crop=\"'if(gt(ih,iw),iw,ih)':'if(gt(iw,ih),ih,iw)'\" -frames:v 1 -update 1 cropped.jpg" \
--exec-before-download "mv cropped.jpg %(thumbnails.-1.filepath)q" \
--exec "rm \"%(artist)s - %(title)s.jpg\"" \
--exec "rm \"%(artist)s - %(title)s.info.json\"" \
--output "%(artist)s - %(title)s.%(ext)s"
@adrianjagielak
adrianjagielak / userscript.js
Created July 1, 2024 14:10
Empik 1.00pln book finder
// ==UserScript==
// @name Button Clicker and Price Checker
// @namespace http://tampermonkey.net/
// @version 1.5
// @description Click buttons and check prices
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
@adrianjagielak
adrianjagielak / Get Host and Port from NWEndpoint.swift
Created March 18, 2024 14:56
Obtaining NWEndpoint host & port
let connection = NWConnection(to: result.endpoint, using: .tcp)
connection.stateUpdateHandler = { state in
switch state {
case .ready:
if let innerEndpoint = connection.currentPath?.remoteEndpoint,
case .hostPort(let host, let port) = innerEndpoint
{
print("Connected to", "\(host):\(port)")
} else {
@adrianjagielak
adrianjagielak / links.md
Created March 1, 2024 01:24 — forked from tkersey/.2025.md
For future reference but maybe not.
@adrianjagielak
adrianjagielak / Google Photos Takeout remove duplicates which are both in albums and in Photos from XXXX, Archive, and Trash.py
Last active May 30, 2024 20:27
Google Photos Takeout remove duplicates which are both in albums and in "Photos from XXXX"/"Archive"/"Trash"
import os
import hashlib
import datetime
def get_md5(file_path):
"""Compute MD5 hash of a file."""
hasher = hashlib.md5()
with open(file_path, 'rb') as file:
# read and update hash in chunks of 4K
for chunk in iter(lambda: file.read(4096), b''):
@adrianjagielak
adrianjagielak / Google Photos Takeout keep only edited files.py
Last active October 16, 2023 12:14
Google Photos Takeout keep only edited files
import os
def find_and_rename(directory):
# Traverse through all the files recursively
for foldername, subfolders, filenames in os.walk(directory):
for filename in filenames:
if "-edited." in filename or "-edite." in filename or "-edit." in filename or "-edi." in filename or "-ed." in filename or "-e." in filename or "-." in filename:
# Original name without the edited tag
original_name = filename.replace("-edited.", ".").replace("-edite.", ".").replace("-edit.", ".").replace("-edi.", ".").replace("-ed.", ".").replace("-e.", ".").replace("-.", ".")
original_path = os.path.join(foldername, original_name)
@adrianjagielak
adrianjagielak / Fix Google Photos Takeout timestamps.py
Last active October 16, 2023 15:22
Fix Google Photos Takeout timestamps+gps+broken files (populate file creation time (all files), file modification time (all files), and exif DateTimeOriginal (images), clear the gps exif if its invalid (0,0), and remove invalid broken images (move them to a "corrupted_files" dir)
import os
import json
from PIL import Image, UnidentifiedImageError
import datetime
import re
import shutil
def set_file_timestamps(filename, timestamp):
"""Set the creation and modification dates for a file."""
dt = datetime.datetime.fromtimestamp(int(timestamp))