5 tips - sinus-x/rubbergoddess GitHub Wiki
Webhooks
If you want to know that your hosting server has been rebooted (if it is locally hosted Raspberry Pi, for example), you can set up simple webhook that will notify you every time.
Go to Webhooks tab in text channel settings: Click Create Webhook, name it (so you know why it is there) and copy its URL.
You can use curl
to send json POST request to Discord servers with a simple script:
#!/bin/sh
# wait a bit, to make sure the network is up
sleep 20
# send payload
curl -H "Content-Type: application/json" -X POST -d '{"username": "Display username", "content": "Text of the message", "avatar_url": "https://example.com/avatar.jpg"}' https://discordapp.com/api/webhooks/...
Add it as a cron job (crontab -e
, use @reboot
prefix) and make sure the file is marked as executable.
Raspberry Pi: Full backup
From time to time, you may want to do complete backup of the system, in case the SD card gets corrupted. If your card partitions were mounted as /dev/sdc1 and /dev/sdc2:
sudo dd if=/dev/sdc bs=1M | pv | gzip > /path/to/backup.img.gz
To restore the backup, reverse it:
gzip -dc /path/to/backup.img.gz | pv | sudo dd of=/dev/sdc bs=1M