Skip to content

Instantly share code, notes, and snippets.

Avatar
🐒
Chaos Monkey

Gergely Imreh imrehg

🐒
Chaos Monkey
View GitHub Profile
@imrehg
imrehg / 00_README.md
Last active Aug 7, 2020
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 work-around while the Platform implements 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 Mar 10, 2020
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 Aug 20, 2019
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 Mar 19, 2019
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 Nov 22, 2018
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),
View delta_test.sh
AUTH_TOKEN=
SRC_RELEASE_ID=
DEST_RELEASE_ID=
IMG_SRC=$(curl --silent -H "Authorization: Bearer $AUTH_TOKEN" "https://api.balena-cloud.com/v4/image?\$filter=is_part_of__release/release%20eq%20${SRC_RELEASE_ID}" | jq -r '.d[0].id')
IMG_DEST=$(curl --silent -H "Authorization: Bearer $AUTH_TOKEN" "https://api.balena-cloud.com/v4/image?\$filter=is_part_of__release/release%20eq%20${DEST_RELEASE_ID}" | jq -r '.d[0].id')
echo "Source Image -> Destination Image"
echo "$IMG_SRC -> $IMG_DEST"
You can’t perform that action at this time.