VPS backup script – automated Ubuntu

You’ve spent hours configuring your Virtual Private Server exactly the way you want. You have everything working, even that infuriating WSGI module in Apache to run multiple Python apps… Maybe I’ll do a write up of that soon. But for now what if your VPS provider has a bad day and loses everything? It would be silly to not backup your VPS. And it’s easy to do. I’ve written an automated script to take care of it. Let’s create a backup script. nano /home/username/scripts/backup.sh Alright. Lets put the following in the file. Tailor to your needs. I’ll explain after. #!/bin/bash […]

Dynamic DNS update from cron

We can use crontab to update our Dynamic DNS. It’s a nice feature and super easy. Who wants a whole application dedicated to telling a remote server your IP? Create a script, not necessary, can do it right in crontab, but why? make a script. If you don’t have a scripts folder in your home directory make one. mkdir scripts I’m not here to teach you basic bash commands. nano /home/username/scripts/update-dns.sh   Put the following in the script.   #!/bin/bash curl https://your-registrar-will-give-you-this.com/update?host=@&domain=xxxxxx.com&password=xxxx   OR, I use this one now, but same concept (the q tells it to be quiet and […]

NFS on Raspberry Pi with ufw, NTFS, and connect from KODI

So here was the problem. I have an NTFS external usb drive I wanted to connect to my RPi home server and share with NFS to an Amazon Fire TV with KODI. Couldn’t get it for the life of me. KODI wouldn’t even see the NFS server in browse. Finally figured it out. Firewall problem. So first part sets up regular NFS with an NTFS drive on an RPi suitable for NFSv4. The second part setups up for KODI devices. And finally I add Samba as a backup.   Part 1: Mount the drive.   Obviously plug in the harddrive. […]

Connecting a Sip Cisco 7940 IP Phone and Plivo

The time has come once again to share something that took me hours to fix. Most of the random projects I work on are really only useful to me when I finally have a breakthrough, but on rare occasion I do something that many boredom warriors have attempted, but been left with unanswered threads and no hope in sight. This is one of those occasions. I like to pay it forward in hopes that eventually this will help someone, somewhere in the future. The project? Hook a Cisco IP phone to a sip trunk. I decided I really don’t need […]

MSDN listing for recursive file search is incorrect.

The MSDN listing for how to recursively search files is incorrect. Their code (in C#, but it applies to all languages) is below. [This is for Directory.GetDirectories and Directory.GetFiles method only] void DirSearch(string sDir) { try { foreach (string d in Directory.GetDirectories(sDir)) { foreach (string f in Directory.GetFiles(d, txtFile.Text)) { lstFilesFound.Items.Add(f); } DirSearch(d); } } catch (System.Exception excpt) { Console.WriteLine(excpt.Message); } } The problem with this code may not be obvious, but if you look careful it takes in a directory, looks in that directory for sub-directories and then spits out the files in each sub-directory. It completely skips all […]