Skip to content

Instantly share code, notes, and snippets.

Chaos Monkey

Gergely Imreh imrehg

Chaos Monkey
Block or report user

Report or block imrehg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View healthcheck
# 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 / disable-ethernet
Last active Mar 19, 2019
Network Manager disable ethernet
View disable-ethernet
View huawei-gsm
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),
IMG_SRC=$(curl --silent -H "Authorization: Bearer $AUTH_TOKEN" "\$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" "\$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"
View test.log
May 22 13:44:40 3ac63e7 systemd[1]: balena.service: Service hold-off time over, scheduling restart.
May 22 13:44:40 3ac63e7 systemd[1]: Stopped Balena Application Container Engine.
May 22 13:44:40 3ac63e7 systemd[1]: Starting Balena Application Container Engine...
May 22 13:44:40 3ac63e7 healthdog[15062]: time="2018-05-22T13:44:40Z" level=warning msg="Running experimental build"
May 22 13:44:40 3ac63e7 healthdog[15062]: time="2018-05-22T13:44:40.313203379Z" level=info msg="libcontainerd: new containerd process, pid: 15079"
May 22 13:44:40 3ac63e7 healthdog[15062]: time="2018-05-22T13:44:40.519566295Z" level=error msg="containerd: notify OOM events" error="open /proc/1350/cgroup: no such file or direct
May 22 13:44:41 3ac63e7 healthdog[15062]: time="2018-05-22T13:44:41.326064905Z" level=warning msg="libcontainerd: unknown container 5e85a5a91a0b88066d0fd3fda78d70d7626296566fdac9dda
May 22 13:44:41 3ac63e7 healthdog[15062]: unexpected fault address 0xffffffe8
May 22 13:44:41 3ac63e7 healthdog[15062]: fatal error
imrehg /
Last active Apr 10, 2018
Proxy testing for resinOS

HTTP Proxy Test


1) Proxy setup

Connect to the target device's host OS, and create the system-proxy directory:

mkdir -p /mnt/boot/system-proxy/
#the RESIN_API_KEY and RESIN_APP_ID is available in the application container, if enabled
curl -v -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${RESIN_API_KEY}" \

Supervisor update test through the API


This test checks if the update-resin-supervisor script correctly gets the supervisor information from the API.

  • connect to the host OS
  • copy and paste the below script into the shell to run it - it will take the device's credentials, calls the API for the supervisor for cross-check, update the API entry for this device, and calls the supervisor updater to check if it finds the updated info.
You can’t perform that action at this time.