Skip to content

Instantly share code, notes, and snippets.

View attilaolah's full-sized avatar
🌿
Namespacing.

Attila Oláh attilaolah

🌿
Namespacing.
View GitHub Profile
@attilaolah
attilaolah / dl.py
Created May 1, 2021 15:56
Pokémon TV episode downloader
"""Pokemon episode downloader script.
Usage:
python dl.py https://s2.content.video.llnw.net/smedia/path/to/playlist0.ts
"""
import os
import shutil
import sys
@attilaolah
attilaolah / mapbox_dl.go
Last active January 12, 2024 19:17
Mapbox Static Tile Downloader
// Package main downloads tiles from the Mapbox Static Tiles API.
// See https://docs.mapbox.com/api/maps/static-tiles/#retrieve-raster-tiles-from-styles.
//
// Usage:
// go run mapbox_dl.go -h
package main
import (
"flag"
"fmt"
@attilaolah
attilaolah / LICENSE
Last active April 2, 2023 02:42
Google Apps Script for converting UTM coordinates to [latitude, longitude].
Copyright 2018 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@attilaolah
attilaolah / README.md
Created October 1, 2022 11:31
Systemd service for creating in-memory cache directory on login

Create the file under ~/.config/systemd/user/, then enable the service with systemctl --user enable cache.service.

@attilaolah
attilaolah / cleanup.sh
Created October 1, 2022 10:37
Arch System Cleanup
# Clean up the package manager cache:
yay --sync --clean
# Clean up the Nix store:
nix-store --gc
# Clean up system journals, except the past two days:
journalctl --vacuum-time=2d
# DANGER ZONE:
@attilaolah
attilaolah / fix_sony_arw.sh
Created April 30, 2022 11:36
Fix SONY ARW timestamps (after forgetting to change time zone)
# Fix time offset:
export TZ=GMT+2
$ exiftool '-FileModifyDate<${SonyDateTime2}+00:00' .
$ exiftool '-CreateDate<${FileModifyDate}' '-ModifyDate<${FileModifyDate}' '-DateTimeOriginal<${FileModifyDate}' '-SonyDateTime<${FileModifyDate}'
# Geotag using UTC timestamps:
$ for gpx in *.gpx; exiftool -geotag "${gpx}" '-Geotime<${SonyDateTime2}+00:00' .
# Clean up:
$ exiftool -delete_original .
@attilaolah
attilaolah / docker-compose.yml
Created March 27, 2022 12:27
AdGuard Home / Docker Compose
version: "3.8"
services:
adguard_home:
# AdGuard Home server.
image: adguard/adguardhome
ports:
# DNS:
- 53:53/tcp
- 53:53/udp
@attilaolah
attilaolah / BleLssService.java
Created February 10, 2022 01:11
NIKON UUIDs, decompiled from the SnapBdrige APK.
public class BleLssService {
public static final UUID AUTHENTICATION = UUID.fromString("00002000-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID BATTERY_LEVEL = UUID.fromString("00002A19-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID CLIENT_DEVICE_NAME = UUID.fromString("00002002-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID CONNECTION_CONFIGURATION = UUID.fromString("00002004-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID CONNECTION_ESTABLISHMENT = UUID.fromString("00002005-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID CURRENT_TIME = UUID.fromString("00002006-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID DESCRIPTOR = UUID.fromString("00002902-0000-1000-8000-00805F9B34FB");
public static final UUID LOCATION_INFORMATION = UUID.fromString("00002007-3DD4-4255-8D62-6DC7B9BD5561");
public static final UUID LSS_CABLE_ATTACHMENT = UUID.fromString("0000200A-3DD4-4255-8D62-6DC7B9BD5561");
@attilaolah
attilaolah / civ.sh
Created December 5, 2021 11:18
Kinglet Launcher
#!/usr/bin/env bash
ROOT="${HOME}/legendary"
GAMEDIR="${ROOT}/SidMeiersCivilizationVI"
DXVK="1.9.1"
export WINEPREFIX="${GAMEDIR}.wine"
# Download & copy DXVK libraries.
@attilaolah
attilaolah / imgcmp.py
Created February 29, 2012 11:30
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255