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!


Adding on to backup bash scripts

So, ages ago, I wrote up a couple of bash scripts that automated the backup process on a server. It’s all text based, so you’d have to be logged into a terminal or be ssh’d into the box.

Today, I got to thinking, I should give it a pretty web gui that makes the process easier and functions through a web gui.

It’s still really early in the through process, but I’m intrigued by the project and will start working on it soon.

Original Post: http://www.merval.org/2012/03/bash-scripts/

Github: https://github.com/merval/BackupScripts

Apple Wireless Keyboard [Review]

I bought this keyboard on Christmas Day 2013, off Amazon. It was delivered on January 2nd. Considering the Holidays, that’s pretty good. So, first thing I noticed with this keyboard is the size. It’s literally the same keyboard you get with a Macbook or Macbook Pro. I actually lined it up with my Macbook keyboard and it’s exactly the same.

The keyboard doesn’t weigh much either, Apple says it weighs in at 8 ounces. All of the weight is from the batteries (two AA batteries). But it very, very light. It also has these skid guards on the bottom of it, I’m not sure if they are suppose to prevent you from pushing it around when typing, but it doesn’t really do much other than keep the bottom of the keyboard from rubbing the desk.


With the keyboard only coming in at 12.8 x 1.4 x 7.3 inches in size, it’s pretty compact, and I have giant hands. I first came across this keyboard while working on a computer for a family friend. At first, I was taken back by how small the keyboard really is and how big my hands were compared to it. I had a bit of a hard time trying to figure out how to make my fingers work on such a small keyboard. But once I got the hang of it, it actually felt pretty nice.

The idea of taking a keyboard from a Macbook and making it into a bluetooth keyboard is pretty ingenious. The only thing I miss from the old Windows keyboard I used prior to this, is the 10 key.

This keyboard has all the buttons the Macbooks have, including controls for iTunes and screen brightness (need to have a compatible monitor).

The best part about this keyboard is that when I got it, I put batteries in and started using it. That was on January 2nd. Today is May 28th, and I just switched out the batteries. I use the computer, A LOT. So for the batteries to last nearly five months, is staggering. Well done Apple.


I’ve been ranting and raving about this keyboard for long enough… Now for the things that bug me.

I don’t use Caps Lock very often so, I didn’t catch this right away, but the button doesn’t seem to notice it’s being pressed, I sometimes have to press it two or three times before the light kicks on showing Caps Lock is one.

When I type, I don’t think of myself as one of those people who is smacking the keyboard as hard as they can. But with this keyboard, for some reason, as I type it makes this vibration sound, as if the alignment is off, just a hair. The area below the spacebar tends to have a little room that bounces off my desk as I type and makes this terrible sound. But, I usually have headphones on and don’t hear it.

I would love to be able to sync the keyboard with multiple devices, and have the power button act as switch between devices, but instead, I have to either completely disconnect the bluetooth on one device or have the device forget the keyboard to switch to another one.


All in all, I have really enjoyed this keyboard. The nice part is, where I work, we use Windows 7 and going from this keyboard to a Windows keyboard, isn’t as difficult as I thought it was going to be. Seeing as with OS X you have several keyboard shortcuts that don’t mesh up with Windows keyboards. But on a subconscious level, because the keyboards are so different, when I sit down at my desk at work, I don’t even miss a beat.

So, with the few cons I have, I’m giving this keyboard a 9.6 out of 10 stars.


2014 Garden Season

I toned it down a little bit this year and planted more of what we eat the most of, Tomatoes, Corn and Green Beans. But I’m going to be planting two kinds of cucumbers this weekend but in planters, not in the garden.

For this season, I decided to go with three varieties of tomatoes: Juliet, Roma and Big Beef. I’ve put them at the end of the garden so they get the most of the evening sun as they can. Behind that is Corn and behind that is three bamboo teepee trellis setups for the green beans.

I did use a trick that I learned from my Grandpa, when planting my tomatoes, I added about an inch of manure and then an inch of soil, and then planted my tomato plants. Makes them big and hearty. 🙂

I’ve added berries to the mix too, although I don’t expect to see them until next year. I’ve got Blueberries, Raspberries and Grapes. I’ve also got a few strawberries planted, which already have a few little strawberries on them.

All in all, this looks like it’s going to be a great season.



The Hacker’s Diet 0.9.9b

I’ve completed the updates for The Hacker’s Diet 0.9.9b. Please check it out and give it a go! The Hacker’s Diet 0.9.9b

The Hackers Diet, WordPress plugin

Awhile back, I started looking into fixing the hackers diet wordpress plugin and publishing it for the world to use. Here recently I finally started towards that goal. I reached out to the original creator and got his blessings to go forward.


So, first on the todo list, is to figure out the series of errors that keep showing up. I was able to correct the installation issues that were showing up. The biggest issue now is, when you enter your weight and save it, a whole slough of errors show up.

Second on the list is to update the jquery graphing, to one a bit more aesthetically pleasing.

With any luck, I will be able to give this plugin a new life and add a few features in the process.

When @afex wrote the original code, he laid the groundwork for a widget, which I completed and it works perfectly. Another issue that I ran into was, when entering a weight on a given day, it always rolled back a day. I got that fixed as well.

Thanks for reading, until next time.



The Movie ‘Noah’ (Possible Spoilers)

There has been a lot of talk about the movie ‘Noah’. Most of the talk is about how the movie doesn’t accurately tell the story, or twists the story.

After watching the movie, I came home and read the story of Noah in the Bible. Had they made a movie on what is in the Bible,  the movie would have likely been about 15 minutes long. The story of Noah starts in Genesis 6 and by the time we reach Genesis 9, the flood is overwith and God is confirming his covenant with Noah.

So, clearly creative expression had to be taken. Behind every movie there is always a writer, who tells a story. This movie is loosely based on the story in the Bible. BUT, it stays close enough to the biblical story, that it doesn’t feel completely fabricated.

Now here are a few things I want to point out.

The director of this film is a self proclaimed Atheist.

In the movie there are giant rock creatures that are called “The Watchers”.  According to the movie, The Watchers were originally entities of Light that watched over the Garden of Eden and were cast upon Earth as a punishment for not preventing Eve from eating from the forbidden tree.

The movie shows Shem as the only son with a wife, when according to the Bible, Shem, Ham and Japheth all had wives.

Emma Watson’s character Ila never existed in the Bible, at least her story wasn’t written about.

Tubal-Cain never got onto the Ark, and Noah never killed him.

According to the Bible, Noah never took his family on a long journey to find Methuselah to sort out the visions of flooding and death, which on this Journey in the movie is when Noah finds Ila the future wife of Shem.

I will stop here, because I don’t want to ruin the movie for anybody. You have to go into this movie with an open frame of mind, the biblical story isn’t long enough and doesn’t contain enough details to create a 2 hour film. The film is inspired by the biblical story, and shouldn’t be taken as a factual story of true events.

So please, stop going on and on about it, and just enjoy an amazing movie!


The Bank-less Era

If you haven’t heard of Crypto-Currencies, then you’ve been under a rock somewhere. 2013 was the year of Cyrpto-Currency, Bitcoin and Litecoin took the world by storm. Because they’re both open-source, anybody can modify the source and make their own coin. Boy have they! I’ve lost track of all the coins. In the world of Crypto, Bitcoin is the Gold and Litecoin is the Silver, everything else is an “Alt-Coin” or Alternate Coin. Some have greater value than others, mainly due to a supply and demand exchange.

So, why are crypto’s taking the world by storm? There are a few reason, first, you can send money anywhere in the world for much, much less than a bank or other money transfer system. I’ll take Bitcoin as an example. Lets say you have 1 BTC (Bitcoin) and you want to send .5 BTC to someone half way across the world, instantly. Right now Bitcoin is valued at $634 dollars, so if we were going to send .5 BTC we’d be sending $317 dollars. Because of the way Bitcoin works, the transaction fee is only 0.0001 BTC which is $0.06. That’s six cents. You just sent $317 dollars worth of Bitcoin for $0.06.

Second reason, there is no middle man taking their cut off the transaction. You send the money from your wallet, to their wallet. Safely, Securely and for pennies on the dollar.

Places like Tigerdirect.com and Overstock.com are accepting Bitcoin, which means mainstream business are realizing the benefit to Crypto. For businesses like TigerDirect and Overstock, where the profit of margin is usually pretty tight, then you add in the fees from Credit Card companies and that just got tighter. Now imagine Bitcoin coming in the mix, they don’t pay that fee to the Credit Card company, instead they keep more of the money you spend. Making for a stronger and healthier company overall.

Something else that is amazing is the advent of Bitcoin ATM’s which will make accessing Bitcoin much easier for the masses. If you haven’t had a chance to get informed, you might want to get onboard the Crypto train early. Things are just really getting started!

Thanks for reading, catch ya on the flip side!


(P.S. If you would be so kind as to donate, you can do so below)

Our education system is obsolete.

If you look at our education system from kindergarten to 12th grade. It’s based on learning repetition. Learning how to formulate a math problem, to find x. Reading a book or essay and then, writing an essay or a paper containing a specific number of words or pages. When I say it’s based on repetition, I mean it’s the same process over and over again. Enter class, listen to the teacher talk about something, open book to specific spot, study and then repeat the information you studied back onto paper in the form of a test. The only questions you ask are based on the topic you are being taught.

In the 10 years since I graduated from High School, I have learned countless numbers of things that I should have learned in High School, but the reason I didn’t learn it in school is because of one thing. Our teachers are forced to stick with a curriculum that reflects the state standardized testing, which then in turn creates the ability for the state to leverage how much money goes to schools. You’re not being taught useful, life topics. You’re being taught only the information required to pass a test, and not only pass the test but do quite well on the test so that more money will be introduced into the budget.

I am a product of that system, as I am sure most of you are. I am not sure what other states call it, or even what Washington State calls the test now, but when I was in school it was called the W.A.S.L. or the Washington Assessment of Student Learning. Through the years of my time in public school, we were given a couple of practice tests, one while we were in elementary school, another in 7th grade and then finally the actual test in 10th grade. It got to the point that Vancouver Public Schools decided that starting with the Class of 2004 (a year after I graduated) that passing the test as a sophomore would be a requirement for graduation. As if graduating was an easy endeavor, they needed to make it even more difficult. The W.A.S.L. doesn’t exist anymore and I’m not sure what the current requirements there are for graduating.

The problem with this kind of system is, we have removed the ability for children to learn. We are teaching them only what they need to pass a test, not function in society. I don’t about you, but in regular everyday life, I personally, have never walked into a coffee shop and the barista has shouted out, “POP QUIZ! 10 minutes to finish it, no calculators”. Life doesn’t revolve around testing, it’s quite opposite. Life is about adapting to the environment and having the brain power to understand what is changing around you so that you can keep up with the events.

I just watched a talk on TED, about a system called, “Self Organized Learning Environment” or S.O.L.E. and the basis of the system is that the teacher doesn’t teach, the teacher asks the big question and then lets the kids talk about it and come to the conclusion. The talk was presented by Sugata Mitra (find more on him here) he is an education researcher and did an experiment where he left a computer in a village in India for 2 months to see what would happen. Children who had no idea what it was or how to use it flocked to the computer to figure out what it was. He returned in 2 months to find the kids had began to learn how to use the system and browse the computer.


If children are left to teach themselves, amazing things come from it. Our current education system is obsolete because we don’t need to create people who can pass tests, but we need smart, intelligent, intuitive and curious people. People who challenge themselves to climb higher. Teachers shouldn’t be standing in the front of a classroom rambling on and on, teachers should act as more of a moderator in the learning process of the children.

Being a computer nerd/geek, There have been things I thought I could never understand because they seemed to complicated. Take math for example, through school I was horrible at math. Only in my Junior year did I finally being to understand math, I lost it all the next year when I stopped using it. But when I began to write PHP code, I was unaware of the existence of math within the code I was writing. I thought of it was simply code that performed the function I was writing it to do. Then with the help of my therapist, I began to see the math within the code. Math, something I hated doing because it was confusing and intimidating, was now something I could do, because what I was doing was fun.

This isn’t to say that I suddenly understood math, because I still struggle with basic multiplication and division. What I think is amazing, is that without even knowing it, I was doing what I was told is “high level math”, writing code to compare variables and determine if one or multiples were less than, greater than, or equal to another. If allowed to, children will start to learn simply through curiosity. The teacher should simply be there to keep the conversation going in one direction and assist where needed.

Our children will benefit greatly from a system where curiosity is the driver of education. Not the way our system currently works. I know that when my Wife and I have kids, I will teach them through curiosity, and because of this, their imagination will take them to amazing places and do monumental things.


The case of the MacBook LCD issue.

So, My wife’s uncle gave me a Macbook of his that worked, but the LCD panel was not working, or so I thought. I proceeded to do a full tear down on it, attempting to locate the problem, having found what I thought the issue was, a pinched display cable (which turned out to be incorrect). I took the macbook to the Apple store to see if they could assist, granted the macbook wasn’t in one piece anymore. The Apple rep explained, because I had taken the whole laptop apart, they were unable to service it and suggested I take the computer to the MacStore. Which I happily did, in hopes they would solve my problem.

We arrived at the MacStore and explained my problem. Which was that when you opened the macbook the screen would light up briefly but then turn off again once opened past at 15 degree angle. They agreed to do a diagnoses on the computer for me. A day or so later, the tech calls me and explains the LCD panel is faulty and the clutch cover was broken and needed to be replaced. All told, repairs would be over $400 dollars. I declined the repair and brought the computer home. Having been told the LCD panel was bad and the bezel (the part that goes around the panel covering the screws) was broken in half, I opted to buy a whole LCD assembly, for only $85 on ebay. I got the assembly but quickly realized the inverter cable was wrong, so without a thought, I swapped out the cable for the one on the other LCD panel. Got everything screwed together and was just about done when I decided, before I lock it all down, I had better do a test run to ensure I haven’t forgotten any cables.

I plugged in the power and hit the switch. The screen didn’t light up. I double and triple checked all my connection, ensuring everything was correct, I thought, “I wonder what will happen if I close the lid to a 15 degree angle..”. Son-of-a-bitch! The thing lights up at a 15 degree angle. How the hell could I have TWO faulty LCD panels that only work at 15 degrees? Then I investigated further. I had swapped out the inverter cable when I first got this assembly, so I started inspecting the cable, and I’ll be damned, there is a small cut in the cable and one of the wires were separated.

So, out of curiosity I started moving the cable around. Before I knew it, I had found the sweet spot, the LCD panel was completely light up and I could see everything! The LCD wasn’t BAD, the little cable was faulty. Now the MacStore had charged me $49 for the diagnostic, which after I had discovered the faulty cable, I called them and asked for a full refund of my money because their tech didn’t catch the cable issue. They provided me in-store credit. Which works out nicely, my Wife found an iPad Mini case there that she really liked.

So to wrap this whole thing up, I went on ebay and found a guy selling the exact cable I need, for $10 ($12 after shipping).

This was my second time opening this particular Macbook model, my wife and I actually have this exact macbook model (Only it’s the white model and this one is the black one) and I had opened the case up awhile back to clean out some dust and more recently replace the isight camera.

I’m actually starting to become quite comfortable cracking these macbooks open and fixing problems. The only thing I really need to get my hands on is a magnetic screw organizer. Macbooks have an insane amount of screws. And most of them are tiny and very easy to lose.

So, anyway. Hopefully by Monday or Tuesday I’ll have my inverter cable and a fully functional Macbook! (it works now but only through an external Monitor.)

When I got the macbook it had 4GB of RAM. I decided to divvy up the RAM between both macbooks and gave swapped one of the sticks in each, bringing both to 3GB. I’m hoping to upgrade my macbook to a 1TB HD. 🙂 It may be a mid-2007 macbook, but I’m gonna milk every ounce of possible out of this puppy!

Thanks for reading!

Catch ya next time!

– Dan

Powered by WordPress | New Free WordPress Themes | Thanks to Business Opportunity, WordPress Themes and Premium WordPress Themes