This file contains 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/bash | |
TIMESTAMP=$(date +"%s") | |
IMAGE=$(curl -s "https://nexusapi-us1.camera.home.nest.com/get_image?uuid=5a6a099c3d894d0284560626c7944d50&width=400&t=$TIMESTAMP" | base64) | |
cat << EOF | |
DUMBO 🚚 | |
--- | |
| href=https://www.datalot.com/dumbo-food-truck-cam/ image=$IMAGE | |
EOF |
This file contains 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
def my_task | |
while(true) do | |
begin | |
database_access_here | |
rescue Exception => ex | |
begin | |
ActiveRecord::Base.connection.reconnect! | |
rescue | |
sleep 10 | |
retry # will retry the reconnect |