Skip to content

Instantly share code, notes, and snippets.

View iAnanich's full-sized avatar

Illia Ananich iAnanich

  • Ukraine
View GitHub Profile
@iAnanich
iAnanich / SystemsScoutLite.ahk
Last active March 8, 2025 12:46
Elite Dangerous: PowerPlay systems scout AutoHotKey script
#Requires AutoHotkey v2.0
; = = = Introduction: = = =
; To begin: open GalMap, focus on the search bar.
; Previously make sure that system's will display Powerplay info.
; Script will begin working when you it Ctrl+F6
; Edit list of system names below (follow the format - systems enclosed in double quotes " and comma , between them)
; One of the ways to get systems to monitor is Spansh, so here's example: https://spansh.co.uk/systems/search/CB29DC2A-F8E7-11EF-ABF7-A8FA2C4A4B3A/1
@iAnanich
iAnanich / aiofile.ipynb
Last active September 30, 2024 21:59 — forked from mosquito/aiofile.ipynb
aiofile Benchmark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iAnanich
iAnanich / normalizer.py
Last active August 1, 2024 08:45
(De)Normalizer
import dataclasses
from typing import Self
import numpy as np
__all__ = (
"MinMaxNormalizer",
)
@iAnanich
iAnanich / install-ubuntu-luks-lvm.md
Last active August 1, 2024 08:49 — forked from superjamie/install-ubuntu-luks-lvm.md
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy).

@iAnanich
iAnanich / set-bash-history-time-format.sh
Last active June 15, 2023 09:19
Enable recording datetime in bash history
#!/bin/bash
# This bash script configures the bash history to include timestamps in a human-readable format.
# It first checks if the user's .bashrc file exists and contains the HISTTIMEFORMAT configuration.
# If the .bashrc file doesn't exist, it creates it and adds the HISTTIMEFORMAT configuration.
# If the .bashrc file exists but doesn't contain the HISTTIMEFORMAT configuration, it adds the configuration.
# It then applies the changes immediately by sourcing the .bashrc file.
# Define the time format for ease of modification and reuse
TIME_FORMAT="%y-%m-%d %T | "
@iAnanich
iAnanich / swarmpit_api.py
Created April 15, 2023 18:12
Simple SwarmPit API adapter example
from dataclasses import dataclass, field
from typing import Optional
from urllib.parse import urljoin
import httpx
@dataclass
class Swarmpit:
"""
@iAnanich
iAnanich / do.sh
Last active April 2, 2023 08:30
Shell script that helps to simplify Docker Compose usage
#!/bin/bash
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ###
### Generated with the help of ChatGPT ###
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ###
# Usage:
# ./do.sh dc ps
# ./do.sh dc down
# ./do.sh dc up -d service
@iAnanich
iAnanich / dataclass_from_dict.py
Created May 23, 2021 21:50 — forked from gatopeich/dataclass_from_dict.py
Python 3.7 dataclass to/from dict/json
from dataclasses import dataclass, fields as datafields
from ujson import dumps, loads
# Note: ujson seamlessly serializes dataclasses, unlike stdlib's json
@dataclass
class Point:
x: float
y: float
# Shallow dataclass can be rebuilt from dict/json:
@iAnanich
iAnanich / gauth.py
Created October 22, 2020 07:11
Google's ID token verification module
"""
https://developers.google.com/identity/sign-in/android/backend-auth#verify-the-integrity-of-the-id-token
"""
import json
from typing import Optional, List
import yarl
from google.oauth2 import id_token
from google.auth.transport import requests as google_requests
@iAnanich
iAnanich / pipeline.py
Created October 25, 2019 23:59
AsyncIO Pipeline
import typing
import asyncio
class Layer:
class STATES:
IDLE = 1
RUNNING = 2
GOING_TO_STOP = 3
STOPPED = 4