Updating the Backup Scripts

So, it’s been awhile since I actually looked at the code for my Backup Scripts.. I had been using them religiously for quite some time, but when I got rid of the server cluster that I had, I stopped using them.

Recently, I setup a server in the Azure cloud to run this website and a few others on. I figured, what a perfect use for the scripts!

Upon firing them up, I found several (no, really, pretty much every bit of code) pieces of the script needed overhauling as errors were thrown all over the place.

First thing I started with is the home-backup script. I used a really handy website called ShellCheck that assisted in the ‘QA’ of the code.

I think, it’s about time to start versioning the script, instead of just making changes whenever. I’m not sure what version it’ll start with, but compared to the original, there will be a lot of improvements.

First, I’m working on enabling the ability to call flags on the command, for example: “./home-backup -d /some/backup/dir -u some_user”. Which will make it easy to setup single user backups, instead of backing up everything.

Second, Error handling. Right now, the script doesn’t have any error handling at all. Since it’s a backup script, the only risk is, the script fails and no backup is taken. I’m building error handling around the backup destination, so that if the directory doesn’t exist, it will prompt you to create the directory. I”ll likely work into the script an automatic creation when using a flag.

Now, the mysql-backup script, will mimic the home-backup because they both go through the same paces.

So, the home-restore script.. This is one I haven’t really dug into yet. Obviously, the first thing that needs to be done is error handling and a “rollback” feature. Right now, it expects that all conditions are met, and just goes. This one, may take quite a bit longer to be “ready”.

For now, I’ve put the WebUI portion of this project on the shelf. Somewhere down the line, I might pick it backup and actually make it happen. But, for now, it’s on the shelf.

If you’ve got any bash experience, and wish to lend a hand, please by all means contact me!

Thanks for reading!

Dan

Hackers Diet – WordPress Plugin

Quite some time ago, a guy named Keith ‘afex’ Thornhill created the WordPress plugin for The Hackers Diet (http://wordpress.org/plugins/the-hackers-diet/) and it appears as though he has abandoned the plugin, I love the plugin and how it works, but you can’t install it on newer versions of WordPress, you have to download the last known version it worked with and then upgrade through the different versions until you’re current. Even then it’s a little shaky. So, in my free time, I will be attempting to make the plugin work with newer versions of WordPress and hopefully get it updated. 🙂

PBX Stuff

So, awhile back I used an old computer (AMD Duron 900mhz) as a PBX, I used PBX in a Flash to get it all setup, bought a Cisco IP Phone off ebay and was ready to roll. Setup Google Voice within the PBX to allow for inbound and outbound calls, but they’ve since removed the ability to make free calls. I stand corrected, Google has made calls within the U.S. and Canada Free through 2013. 🙂

I used it for awhile and it worked great. I even setup a number for the Occupy Vancouver group to use as a phone tree. But when Google announced they were taking away the free calls, I took the pbx down and it sat unused for a long time. That is until yesterday, I had to find a way to stay up late as my work shift is changing, so i started playing around with the PBX again, I hooked it up and found a lot of issues with it, so I tore it apart and installed the PBX on a slightly newer but still old computer (Intel Duo 2ghz) which has been sitting unused since I upgraded my computer.

The PBX side of things is very interesting to me, I think it’s awesome to have my own phone system that I can control. Through SIP Solutions, you can buy a SIP Trunk for $24 a month with unlimited inbound and outbound calls, then you can buy a DID (the actual phone number) for $1 dollar a month, so basically for $25 dollars a month, you’ve got a full featured phone system. Custom everything if you know how to rig it up. The only downfall is that you need a decent internet connection. There are ways to rigging up an actual phone line into the PBX so you can use a legit phone line from the phone company, but I haven’t played with that side of it yet.

When my wife and I get a house, the first thing I’m doing is wiring the house for Ethernet and setting up a PBX, with 1 phone line from the phone company and a second line from SIP Solutions, that would equal two trunks, meaning two calls at the same time from any phone.

One draw back is you have to buy IP Phones that uses the SIP protocol, which can be a little spendy, but can you imagine the possibilities of what you could do? Tired of a phone number calling you? Blocked. You could even have hold music if you wanted to!

When someone calls and leaves a voice message, you can get an email with the voice message attached, so if you’re not home, you still get the message 😀

The best part is, once you have several IP Phones rigged up (if they have this feature) you can use them as intercoms, to communicate without having to scream across the house.

One really big requirement for all of this though, you need to know how to maintain a PBX and how to handle certain issues.

But aside from that, you’d be in complete control of your own phone system. Just like they do in an office.

http://en.wikipedia.org/wiki/Asterisk_(PBX)

Thanks for reading.

Dan

Renewable Energy Project

For sometime now, I have been looking at ways of generating electricity on a small scale, for things such as camping, or if there is a power outage and you need to keep something powered on or a battery charged up. I’ve looked Wind Power Generators and recently found a neat one that uses rare earth magnets and generates 1000w of power. I’ve even looked at Solar Panels.

I think my first project will be a wind turbine. Not the 1000w one at first, because those magnets can get REALLY expensive.  But the only thing I want to look at is, making the unit easily portable and possibly with adjustable height. The key problem with adjusting height is the force the wind will be putting on the turbine during wind gusts, the adjustable height may snap the whole rig in half.

My biggest issue may be building the charging unit, I am horrible at reading schematics, and would need to build a unit that will both charge a battery and then once the battery has a full charge stop sending a charge, and possibly have a second output linked to another battery.

I will want to look into the option of having multiple inputs, so if I have two turbines or a turbine and a solar panel (or two of anything really), I can charge with both without needing a second charging unit and battery.

Bad part is, since my plate is already pretty full, this whole idea may take a back seat for awhile, which may be a good thing since I will need time to learn how to read and understand schematics.  If you can assist me in this quest, please contact me dwalker@merval.org

Thanks for reading!

May The Fourth Be With You!

Since today is “Star Wars Day”… It is only right that I share my favorite Lightsaber battle. Viewed more than 6 millions times… I give you, Ryan Vs. Dorkman.

[youtube https://www.youtube.com/watch?v=8NE5elL30w4]

AND Ryan Vs. Dorkman 2 HD

[youtube https://www.youtube.com/watch?v=RATMJ8JH1qo]