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 / batchdelete.py
Last active February 1, 2021 16:03
Batch delete files from a versioned S3 bucket
View batchdelete.py
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
View 00_README.md

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 / README.md
Last active March 10, 2020 12:11
HiPlot with the Faculty Platform
View README.md

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
View disable-ethernet
[connection]
id=Disable Ethernet
uuid=8377ffac-b6ff-4034-a910-be325524b925
type=ethernet
autoconnect=false
[ethernet]
mac-address-blacklist=
[ipv4]
View healthcheck
#!/bin/bash
# Check succeeds if file found to be modified in shorter time than threshold
[[ -n "$(find /data/container_healthchecks/balena_tags -mmin -21)" ]]
View gist:6386b02f198858aca82cbcfcd133bd88
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
View disable-ethernet
[connection]
id=disable-ethernet
uuid=35a68233-05e3-4ef0-9150-9a4099f32344
type=ethernet
autoconnect=false
permissions=
[ethernet]
mac-address-blacklist=
View huawei-gsm
[connection]
id=huawei-gsm
type=gsm
[gsm]
apn=rsaweb.mobi
[ipv4]
dns-search=
method=auto
@imrehg
imrehg / fixmig_pretty.js
Created November 22, 2018 14:53
prettified supervisor migrator
View fixmig_pretty.js
This file has been truncated, but you can view the full file.
!(function(e) {
var t = {};
function n(r) {
if (t[r]) return t[r].exports;
var i = (t[r] = { i: r, l: !1, exports: {} });
return e[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports;
}
(n.m = e),
(n.c = t),
(n.d = function(e, t, r) {