rkresha / rk_scripts Goto Github PK
View Code? Open in Web Editor NEWScripts in support of rk_loop
License: MIT License
Scripts in support of rk_loop
License: MIT License
To show whether the loop was successful or not
add more info on first preflight failure... echo "First preflight failed... trying again before usb reset"
Backup *.sh and *.ini in the home dir and scripts dir on a success loop (overwrite current one) to help protect file from getting null'd out on a FS full condition.
http://blog.terminal.com/using-daemon-to-daemonize-your-programs/
for x in (x y z)
do
(${0} ) &
done`
wait
Adding a "wait-for-silence" alias so that multiple rigs can run simultaneously (Optional)
openaps alias add wait-for-silence '! bash -c "echo -n "Listening: "; for i in seq 1 40
; do echo -n .; ~/mmeowlink-source/bin/mmeowlink-any-pump-comms.py --port [INSERT PORT PATH HERE WITHOUT BRACKETS] --wait-for 20 2>/dev/null | egrep -v subg | egrep No && break; done"'. If you add this as the first command in your preflight, this will check to see if there are any other current mmeowlink communications with your pump, and step aside if there are. Users have used this to run multiple rigs simultaneously. May require adding a sleep [some number] command at the beginning of your preflight for one rig to stagger things a bit.
Create a new file that tracks the number of consecutive failed loops. At 5, reboot, but first add a line into crontab to fire the loop again on restart. Also on restart null out the file that is tracking the failed loops. Also null out the file on successful runs of the loop
Allow the retry of individual reports up to 3 times before failing entire loop
> Eric Jensen @elnjensen Aug 09 22:39
> In case it's useful, here's a script I wrote to have the Raspberry Pi push out its IP address once it boots, using Pushbullet - I took the example that @cjo20 gave earlier and adapted it to this purpose:
> #!/bin/bash
>
> # Sleep a bit to make sure that we have time to get
> # an IP address before running
> sleep 30
>
> # Set API key for Pushbullet
> export API="Your API key goes here"
>
> # Set a variable to IP address of wireless device:
> export IP=`hostname -I`
>
> # Push to devices:
> echo '{"type": "note", "title":"Rasp. Pi IP is' "$IP" '", "body":"' "$IP" '"}' |
> curl -u ${API}: -X POST https://api.pushbullet.com/v2/pushes \
> --header 'Content-Type: application/json' --data-binary @-
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.