Skip to content

Instantly share code, notes, and snippets.

solusipse / crontab
Created Mar 21, 2016
Simple backup solution - rsnapshot
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
# 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.
sshfs root@$TARGET:/backup/disk /root/mnt
if [ $# -eq 0 ]; then
echo "Run with argument: daily, weekly or monthly."
# remember to set local to trust in pg_hba.conf
sudo -u postgres pg_dumpall | gzip -c > /backup/db.sql
if [ $RESULT -ne 0 ]; then
echo "Database backup failed at!" | mail -s "Backup error"
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
solusipse /
Created Aug 12, 2015
ESP8266: connect to access point
AT+CWLAP # scan for wireless networks
AT+CWJAP? # check if connected
AT+CIFSR # get ip

Rasbperry PI DS18b20 in parasitic mode (2 wires only)

Add to /boot/config.txt following line:

solusipse /
Created Jun 28, 2015
Geovision camera (GV-MFD520) RTSP streaming to linux machine

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:// I used cron to execute script with such line every 10 minutes: avconv -i rtsp:// -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

solusipse /
Created Jun 22, 2015
Own DDNS service on Digital Ocean
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:
solusipse / grubmanual
Last active Aug 29, 2015
manual booting with grub
View grubmanual
set root='(hd0,1)'
linux /boot/vmlinuz-linux root=/dev/sda1
initrd /boot/initramfs-linux.img
solusipse / gist:fe4e29a190f625297726
Created Oct 25, 2014
delete old mails from junk
View gist:fe4e29a190f625297726
find /home/vmail/*/*/.Junk/cur/* -mtime +14 -exec rm {} \;