Back your stuff up

Geekin' out, Random Crap, Seattle, Useful bits of info June 5th, 2008

A couple weeks ago a board on my dads site was hacked and pretty much demolished. Apparently it was hacked into on Tuesday/Wednsday. I didn’t find out until Thursday night when my aunt mentioned it in passing.

Friday after work I went and took a look at it real quick. I opened up the url to the board and it wasn’t functioning at all, php errors all over the place. At right about that time I got a call from Helen asking if I could pick someone up from the bus station and give them a ride down to tacoma for a board meeting they had this weekend. Faced with the decision of what was obviously going to be a long process that would stretch late into the night vs hanging out with Helen and the Circle K district board, I opted to go hang out with them.

Saturday morning rolled around. I got up extra early to work on it, I remoted into the server and started poking around. Files were moved around, odd names were all over the place. A quick check of the bash history showed they hadn’t gotten the password for the account. I changed the ftp password on the board account just to be safe. Right after that I got a phone call. Was an odd one, the number was 12 digits long. I answered it anyways. Turned out to be the man who ran the forum, he was in the UAE. I spoke to him briefly, he had a database backup from May 9, he was going to upload it so I could do a restore. I emailed him the new password (not very secure, but what the hell) and he started
to work on uploading it. I had a full site-backup from April 27 that I had made for kicks, since we didn’t have anything really backed up, it included logs, built-in mail account, site backups, databases, everything. I considered using the database backup in that one, but didn’t, since he forum admin had a more recent backup.

I continued to poke around the files, everything was in complete disarray. I restored the board files using my April 27 backup, so all that was needed was a database. I poked around a little, then bummed for a bit while I waited. I got an email from motasim, he was having trouble transferring the file up. the ftp client kept timing out. I recommended a few clients and he tried them all with no luck. Finally I suggested he compress it with winrar. He grabbed the client, compressed and uploaded the file quickly.

This is where the fun began. Everytime I tried restoring the database, I would get a duplicate line error message from mysql. I spent literally 2 whole days trying to get that database to restore. Finally Sunday night I grabbed my April 27 backup and tried that one.

Worked flawlessly.

Suddenly we had a perfectly functional forum. But motasim wanted to have the most up to date backup, so I tried merging the two databases. It sort of worked. The threads were all there but there were more php errors caused by incomplete tables and entries. Finally, I restored the April 27 database, uploaded it somewhere motasim could get it and let him play with it.

He finally settled for the April 27 backup. I posted on the forum softwares support site, contacted their support, after speaking with them it was apparent that Motasims May 9 backup was corrupt, there wasn’t anything we could do about that.

After having dealt with all of that, I started reading up on creating backups. I setup my own backup procedures overnight and implemented them. I quickly found out that bluehosts cron doesn’t like the $ $(date). I posted on their forum and someone helped me whip up a perl script. I’ll post it here in case someone stumbles upon this post devastated by their website having gone down without backups:

#!/usr/bin/perl
use strict;
use warnings;


my $fileOrFolder = $ARGV[0] or die “You forgot to specify a file or folder name!”; #The name of the file or folder provided during execution of the script
my $upper = “U$fileOrFolder”; #Convert the file or folder name to uppercase for the label

my $date = `date +%Y_%m_%d`; #Store the date in a variable
chomp($date); #Remove the new line that gets added at the end

print `tar—cvvzhlf “/foo/backups/$fileOrFolder-$date.tar.gz” /foo/$fileOrFolder—atime-preserve—label $upper`;


Simply put, I set it up to backup the individual sites based on the folder I specified when the script ran. I use another one slightly modified for full backups, and another for sql backups. There were a few hiccups with getting them running, but they’re working beautifully.

Unfortunately, one side-effect I hadn’t considered was that when these backups ran, they created gigabytes of backups. Our account was on a server that had a 50GB limitation. We had setup this account several years ago, and Bluehost had since upgraded the plan we were on with more generous limitations. The most recent being unlimited disk space. If we had wanted, we could contact bluehost and have them move us to another server.

The disadvantage of that would be downtime, so I never bothered with that. However, apparently when the backups ran, they got an alert of some sort. So without any warning, they moved us to a new server last night around midnight. All our domains went down for a good 8 hours, and when they finally came back up, php wasn’t functioning properly for another 4.

So the moral of this story? Schedule your backups, and make sure your host doesn’t decide to randomly upgrade you without warning by making sure you don’t randomly create gigabytes of files in the course of a day.

(No Ratings Yet)

Public Demonstration against bush?

Random Crap, Useful bits of info August 22nd, 2006

I had this idea last week, and it’s been rolling around in my head, so I thought I would voice it here.

After recent events, it seems as though we’re slowly entering a hitler-esque regime. Bush is only halfway through his term, and things are already pretty bad. We can have hope that this falls elections will end the Republican control in congress and bring sanity back to our nation, but I’m tired of waiting.

Too many people have stood by, hoping that things would get better, that someone else would stand up and say something, that another person would react, that someone would stand up and say “No, I don’t want this”

Well, it’s not going to happen, why? Because you’re waiting for that to happen. If we keep waiting, our freedom (the oh so overused word that’s been sadly mis-represented, marred, and taken out of context and constitution (in spirit)) will fade, if not dissapear.

Franklin D. Roosevelt once said “Only Thing We Have to Fear Is Fear Itself” Powerful words from a great man. Unfortunately it appears as though the “fearing only fear” era is over. And nobody has really taken notice.
Why? Because everyone is too scared to react to the atrocities (yet another word used in excess when speaking of the Bush Administration) done by George W. Bush and his toads.

Well, I think it’s time to do something.
What do I want to do? Well, as I mentioned at the beginning, I thought of something last week. It’s becoming clearer everyday that everyone wants to isolate the Muslims, or anyone who looks muslim, and put them in a cage. Why? Because nobody knows what a terrorist looks like.
The world around, people who are or appear to be middle eastern, are being in many ways.
A recent
Gallup Poll showed that 2 out of 5 americans believe that muslims should be required to wear a special I.D.

Gee, this reminds of something…..what was it…..

Oh Yeah! the holocaust!

Yes, yes, I know I’m probably being a tad on the extreme side, but messed up times call for messed up measures.

My plan, is to stage a silent protest by wearing badges. and what badge would that be?

You guessed it! The yellow badge.
I want to stage this protest in the most provocative manner I can think of, let me get arrested, I’m exercising my free speech (what’s left of it) damnit! Although it won’t be the yellow badge, as everyone has already seen it so much, the symbol has been desensitized enough, so something of a more clever design shall be made.

Anyone who is interested in doing this or has any thoughts about this, please feel free to comment about it. I want to get as many people as possible to participate in this as possible, I want everyone to hear about this, let them know that there is at least one person who won’t sit by and let this happen. I’m not going to write a letter and hope someone reads it, I want them to hear about it.

If you would like to participate, send an email to badge(at)chipnick.com to show your interest.

(55 votes, average: 2.84 out of 5)

Random linux advice!

Geekin' out, Useful bits of info May 28th, 2006

It’s time for some random advice when it comes to linux!

In firefox, they have this really annoying feature, it’s this middle-click search function.
If you highlight some text in a page and middle-click anywhere on the page, it will take you to a random page! This is incredibly annoying, I searched around and found out that you turn it off by going into about:config and searching for “clipboard.autocopy” you turn that off, restart firefox, and it’s gone!
This will fix the problem with middle-click on links, however if you want to disable the annoying clipboard feature, check The firefox mouse feature list for how to turn it off completely.

Also, if you ever have a problem with X not starting, run “dpkg-reconfigure xserver-xfree86” to reconfigure X. And if for some reason gdm starts instead of kdm when you start X, just type kdm instead!

(80 votes, average: 2.9 out of 5)

Linux Orgasm!

Bellevue, College, Geekin' out, Useful bits of info May 27th, 2006

Woo! Guess what I’m posting from?

Read the rest of this entry »
(78 votes, average: 3.1 out of 5)

Internet Neutrality

Geekin' out, Random Crap, Useful bits of info May 3rd, 2006

This issue has probably been discussed dozens of times, but I found this particular Article s to be quite interesting.
If you don’t know what Internet Neutrality is, read the article!

(73 votes, average: 2.9 out of 5)

Performancing Firefox

Geekin' out, Random Crap, Useful bits of info March 15th, 2006

I’ve downloaded a cool firefox extension called Performancing for Firefox. It’s pretty cool, like a little blog editor for firefox, but it works kinda spiffy-like.

You should check it out.

(96 votes, average: 3.17 out of 5)

Linux Kernel info

Geekin' out, Random Crap, Useful bits of info March 13th, 2006

Grabbed this off, digg. It’s kinda like a mini-help for the kernel, but way more then that!

Linux Kernel Configuration

(89 votes, average: 2.73 out of 5)

Shoe Lace Glue doesn’t work :(

Random Crap, Useful bits of info January 11th, 2006

So I posted awhile back about a solution for frayed shoe laces.
Well, the glue didn’t work too well. It did for awhile, but since the thread inside the lace itself was really glued in, I decided to try a different method;

Stapling them.

Yup, I grabbed my stapler and have stapled my shoelace ends. So far it’s working better since it’s going straight through them :)

Please note: When doing this, staple them seperately ;)

(79 votes, average: 3.01 out of 5)

Meh

Random Crap, Useful bits of info January 9th, 2006

I turned user registration back on, so if you really want to, you can register an account for yourself.

(85 votes, average: 2.95 out of 5)

Phew

Useful bits of info January 1st, 2006

Note to self:

When going to Bellingham, Make sure one has a ride back from Bellingham.

Bone gave me a ride down to Marysville, which helped me out a lot (got me into king county, so I wouldn’t have to get a bus ticket and just use Sound Transit buses), and then I took a bus from Marysville to Seattle, and then to Bellevue.

I rode a total of 4 buses, 1 from marysville to everett bus station, 1 from there to Downtown Seattle, 1 from downtown seattle to Bellevue, and 1 from bellevue transit station to Lake Hills Blvd.

Right as I got off the last bus, I saw the other bus I could have taken that would take me right to my house leave that stop. So I just walked the last mile home.

(97 votes, average: 2.88 out of 5)