This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Cardamom Auction Data to WhatsApp", | |
"nodes": [ | |
{ | |
"parameters": { | |
"rule": { | |
"interval": [ | |
{ | |
"field": "hours", | |
"triggerAtHour": 18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exponentialBackoff = (fun, successFun, failureFun, exponent) => { | |
console.log("Retrying after" + Math.pow(2, exponent)); | |
const EXPONENTIAL_BACKOFF_TIME = Math.pow(2, exponent) + Math.random() * 1000; | |
setTimeout(async () => { | |
const res = await fun(); | |
if (res.data) { | |
console.log("success"); | |
successFun(); | |
} else if (exponent <= 10) { | |
exponentialBackoff(fun, successFun, failureFun, exponent + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
bash <(curl -L https://github.com/balena-io/wifi-connect/raw/master/scripts/raspbian-install.sh) | |
curl https://gist.githubusercontent.com/libbymiller/e8fe6821e122e0a0ac921c8e557320a9/raw/46138fb4d28b494728e66515e46bd7d736b19132/start.sh > /home/pi/start-wifi-connect.sh | |
cat > /lib/systemd/system/wifi-connect-start.service <<EOF | |
[Unit] | |
Description=Balena wifi connect service | |
After=NetworkManager.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cat > /etc/systemd/system/greengrass.service <<EOF | |
[Unit] | |
Description=Greengrass Daemon | |
[Service] | |
Type=forking | |
PIDFile=/var/run/greengrassd.pid |