View crontab
# on backup server
0 */4 * * * /usr/bin/rsnapshot hourly
30 3 * * * /usr/bin/rsnapshot daily
0 3 * * 1 /usr/bin/rsnapshot weekly
30 2 1 * * /usr/bin/rsnapshot monthly
View backup.sh
# This is a very simple script for performing whole disk backups. Rotation scheme: 3 daily backups, 2 weekly and 2 monthly.
# Edit to suit your needs. The only non-standard requirement is sshfs.
TARGET="1.1.1.1"
MAIL="my@mail.com"
sshfs root@$TARGET:/backup/disk /root/mnt
if [ $# -eq 0 ]; then
echo "Run with argument: daily, weekly or monthly."
exit
View pgsql_backup.sh
#!/bin/bash
# remember to set local to trust in pg_hba.conf
sudo -u postgres pg_dumpall | gzip -c > /backup/db.sql
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "Database backup failed at domain.com!" | mail -s "Backup error" your@address.com
fi
chmod 0600 /backup/db.sql
date > /backup/last.txt
View gist:b3a13e6578d97db97c27
Cause code Name
0 IllegalInstructionCause
1 SyscallCause
2 InstructionFetchErrorCause
3 LoadStoreErrorCause
4 Level1InterruptCause
5 AllocaCause
6 IntegerDivideByZeroCause
7
View esp8266-connect-to-ap.md
AT
AT+CWMODE=1
AT+CWLAP # scan for wireless networks
AT+CWJAP="ssid","password"
AT+CWJAP? # check if connected
AT+CIFSR # get ip
View 1wire.md

Rasbperry PI DS18b20 in parasitic mode (2 wires only)

Add to /boot/config.txt following line:

dtoverlay=w1-gpio,gpiopin=4,pullup=on
View geovision.md

For a while, I used an ftp connection to download videos from my geovision camera (used in home surveillance system). But due to often power outages in place where I live, I had constantly repeating problems with an sd card which was used as an intermediary between camera and linux-powered station. It made me to look for other solutions. I switched to RTSP protocol and now it works flawless. If you're a geovision camera owner and building your own recording station, you might find that draft helpful. First of all, you have to enable RTSP server in your camera's panel. Then you can for example use VLC to check if it works properly. In my case proper address of stream was: rtsp://192.168.1.73:8554/CH001.sdp I used cron to execute script with such line every 10 minutes: avconv -i rtsp://192.168.1.73:8554/CH001.sdp -c copy -t 610 /mnt/videos/$(date "+%d-%m-%Y-%H:%M:%S").mp4 610 is for time here (610 seconds). Extra 10 seconds are just in case, sometimes first 3-5 seconds are broken. I also configured nginx to

View doddns.py
'''
doddns
This script was made for using a Digital Ocean's droplet as a ddns service.
[!] Remember to put your credentials below.
[!] Script needs requests library. To install it use pip: pip install requests.
Before you'll start, check if it works properly with your config. Simply run it:
python doddns.py
View grubmanual
set root='(hd0,1)'
linux /boot/vmlinuz-linux root=/dev/sda1
initrd /boot/initramfs-linux.img
boot
View gist:fe4e29a190f625297726
find /home/vmail/*/*/.Junk/cur/* -mtime +14 -exec rm {} \;