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
@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"
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
imrehg / http_connect_proxy_test.md
Last active Apr 10, 2018
Proxy testing for resinOS
View http_connect_proxy_test.md

HTTP Proxy Test

Test

1) Proxy setup

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

mkdir -p /mnt/boot/system-proxy/
View services.sh
#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}" \
'https://api.resin.io/v4/service?$filter=application%20eq%20'${RESIN_APP_ID}'&$select=id,service_name'
View supervisor_test_api.md

Supervisor update test through the API

Test

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.
@imrehg
imrehg / redsocks.conf
Created Dec 12, 2017
resinOS socks proxy example
View redsocks.conf
base {
log_debug = off;
log_info = on;
log = stderr;
daemon = off;
redirector = iptables;
}
redsocks {
type = socks5;
View openvpn-connman.log
openvpn log:
Oct 23 11:50:24 raspberrypi3 openvpn[415]: [[1;39m[server] Inactivity timeout (--ping-restart), restarting[[0m
Oct 23 11:50:24 raspberrypi3 openvpn[415]: [[1;39m/etc/openvpn/downscript.sh resin-vpn 1500 1544 10.2.6.167 52.4.252.97 restart[[0m
Oct 23 11:50:24 raspberrypi3 openvpn[415]: [[1;39mSIGUSR1[soft,ping-restart] received, process restarting[[0m
Oct 23 11:50:24 raspberrypi3 openvpn[415]: [[1;39mRestart pause, 10 second(s)[[0m
Oct 23 11:50:34 raspberrypi3 openvpn[415]: [[1;39mNOTE: the current --script-security setting may allow this configuration to call user-defined scripts[[0m
Oct 23 11:50:34 raspberrypi3 openvpn[415]: [[1;39mSocket Buffers: R=[87380->87380] S=[16384->16384][[0m
Oct 23 11:50:35 raspberrypi3 openvpn[415]: [[1;39mAttempting to establish TCP connection with [AF_INET]52.5.48.142:443 [nonblock][[0m
Oct 23 11:50:36 raspberrypi3 openvpn[415]: [[1;39mTCP connection established with [AF_INET]52.5.48.142:443[[0m
You can’t perform that action at this time.