Skip to content

Instantly share code, notes, and snippets.

View imrehg's full-sized avatar
🐒
Chaos Monkey

Gergely Imreh imrehg

🐒
Chaos Monkey
View GitHub Profile
@imrehg
imrehg / codeage.csv
Created November 11, 2024 07:43
Code Age analysis for Airbyte
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
2020-09-24;v0.1.0-alpha;206028;206028;206028;206028;206028
2020-10-21;v0.2.0-alpha;215379;215379;215379;215379;215379
2020-10-27;v0.2.1-alpha;204387;204387;204387;204387;204387
2020-10-30;v0.3.0-alpha;209715;209715;209715;209715;209715
2020-11-04;v0.4.0-alpha;223988;223988;223988;223988;223988
2020-11-12;v0.5.0-alpha;283586;283586;283586;283586;283586
2020-11-14;v0.5.1-alpha;296031;296031;296031;296031;296031
2020-11-14;v0.5.2-alpha;296660;296660;296660;296660;296660
2020-11-15;v0.5.3-alpha;296669;296669;296669;296669;296669
2020-11-26;v0.6.0-alpha;308223;308223;308223;308223;308223
@imrehg
imrehg / magnet.py
Created May 28, 2024 06:51
Solving the "magnet" puzzle from Machinarium
"""Solving Machinarium's magnet puzzle with graph traversal."""
import re
def status_check(status: str) -> bool:
"""Check if the status is valid or not
The status of the board has items of 'D' for down pointing
arrow, 'U' for up pointing arrow, and 0 for the gap. There
@imrehg
imrehg / batchdelete.py
Last active February 1, 2021 16:03
Batch delete files from a versioned S3 bucket
import argparse
import math
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
import boto3
from tqdm.auto import tqdm
client = boto3.client("s3")
objects = []
@imrehg
imrehg / 00_README.md
Last active August 11, 2020 13:27
Custom Python environment

Setting up a custom Python environments with Conda on Faculty Platform

The following scripts provide a foundation to use a different Python version on the the Faculty Platform servers than what's shipped in the default Python2 and Python3 Conda environments (Python 2.7.16 and 3.6.10 respectively, at the time of writing). These scripts are intended to be a quick fix while the Platform implements support for newer Python versions, and thus there are quirks of behaviour to take into account, as explained in this documentation.

There are 3 scripts attached here:

@imrehg
imrehg / GithubActions_jobs_trigger_overview.png
Last active March 17, 2020 16:59
GitHub Actions with Faculty Platform
GithubActions_jobs_trigger_overview.png
@imrehg
imrehg / README.md
Last active March 10, 2020 12:11
HiPlot with the Faculty Platform

Visualising experiments with HiPlot on the Faculty Platform

HiPlot is a tool for high-dimentiomnal visualisation, that comes handy for example when running hyperparameter optimisation of machine learning models. This readme collects some usage notes to make most of both experiment tracking on the Faculty Platform and HiPLot.

See the HiPlot documentation for more details on any HiPLot related information.

@imrehg
imrehg / disable-ethernet
Created August 20, 2019 21:09
Disable Ethernet with NM connection file
[connection]
id=Disable Ethernet
uuid=8377ffac-b6ff-4034-a910-be325524b925
type=ethernet
autoconnect=false
[ethernet]
mac-address-blacklist=
[ipv4]
#!/bin/bash
# Check succeeds if file found to be modified in shorter time than threshold
[[ -n "$(find /data/container_healthchecks/balena_tags -mmin -21)" ]]
systemctl stop resin-supervisor
balena rm -f $(balena ps -a -q) || true
balena tag $(balena images | grep registry2 | awk '{print $1}') backup
balena rmi $(balena images | grep registry2 | awk '{print $1}')
systemctl restart resin-supervisor
while ! balena images | grep -q registry2 ; do echo "waiting on supervisor download, sleeping 5s" && sleep 5; done
echo "download finished, removing temporary image tags"
balena rmi backup
@imrehg
imrehg / disable-ethernet
Last active March 19, 2019 17:32
Network Manager disable ethernet
[connection]
id=disable-ethernet
uuid=35a68233-05e3-4ef0-9150-9a4099f32344
type=ethernet
autoconnect=false
permissions=
[ethernet]
mac-address-blacklist=