Wednesday, December 31, 2008

Happy New Year!

I have lot of stuff planned for 2009 such as the start and completion of a total revamp of Age of Valor, as well as the completion of ServerWeave and the start of a small hosting company on the side for extra cash.

I might even open up a SBBS file in notepad++ and MAYBE change some code.

Seriously, I need to finish that one day. It has lot of features other free forums don't have. I just got tied up with other application projects and lost interest.

As for tonight, it turned into a super boring NYE. I even took an earlier shift (usually work 12:30-9:00) so I can be home early. But I should of just sticked with the 9:00pm shift. We're doing absolutely nothing this year. Normally we at least rent a movie, or maybe visit family or go out to the restaurant. This year, my mom is cleaning the house. AGAIN! She is obsessed, it's brutal - HOURS of vacuuming not to mention all the chemicals. Nothing worse then hearing a 10,000rpm AC motor for hours on end, combined with the torturous smell of all sorts of chemicals.

The house was cleaned not even a week ago, it's already clean, sit down or something. geez.

But other then that, all is good, and I wish everyone a happy new year! Don't drink too much, and if you drink anything at all, don't drive!

Tuesday, December 30, 2008

Serverweave progress update

Some good news!

I just got my first sign of functionality out of the system. There is now a task that runs every 15 minutes to regenerate the config files for apache (and all other daemons once I get there). It works. I can now set virtual hosts and they get written to the config file. Later on I can add more options to assign vhosts to a port/IP but for now I'm staying basic.

I will soon be able to move on to DNS, which should be fairly easy.

The tough one will be email. Once those 3 work, I will pretty much have a basic web hosting system going. From there I'll setup FTP and SSH. Mysql in there somewhere.

The system is at 3448 lines of code and 122 files now.

In other news I registered as well which in the future may be used for a client portion of serverweave. I will eventually add in some features such as deployment, backup and other tasks that could affect workstations, so there may be a lightweight system that will be installed on windows clients to make them easier to manage. We'll see. No official plans yet.

Friday, December 26, 2008

Merry Christmas!

Hope everyone had a good one!

Christmas time is great to visit family that we don't see often, and enjoy giving gifts, and of course, to remember the #1 reason we even celebrate it: Jesus our savior being born so he could die on the Cross to take our place so we can go to heaven. For all have sinned and fall short to the glory of God (Romans 3:23), but God's gift to us is Jesus taking our place. For God so loved the world, that He gave His only begotten Son, that whoever believes in Him shall not perish, but have eternal life. (John 3:16)

Tuesday, December 23, 2008

How to turn a 2 lane road into a 4 lane road

Q: How to turn a 2 lane road into a 4 lane road

A: Remove the snow banks!

I was going to post pictures of the snow banks, but they kind of removed them this morning. I managed to get a pic of some of the equipment they use. Basically a giant snow blower and line ups of dump trucks. I've seen as many as 5 dump trucks lined up so they just seamlessly move to next as one fills up.

Have no idea where they bring this snow but it must be a seriously huge mountain after doing all the streets. They usually do our street about 3-4 times a year. Some streets randomly get neglected for kicks.

Sunday, December 21, 2008

Sunny with cloudy periods

It's sunny with cloudy periods right now.

Sounds like a nice day doesn't it...

Weather Report

No snow either!

That's not the coldest it's been recently.

Saturday, December 20, 2008

More snow pics

For you southerners that think -5 is cold. :P

More to come later, and I'll try to get some of the 6 foot snow banks during the day tomorrow or Monday but the snow blower might pass, since it's overdue. We'll see.

Thursday, December 18, 2008

Serverweave update!

Been caught up writing a date/time class. Now that the class is usable, I have some nicely enhanced output. ;)

Recompiling [g++ -o serverweave serverweave.cpp -g -pthread -save-temps -lmysqlpp -L/usr/lib/mysql -lmysqlclient -I/usr/local/include/mysql++ -I/usr/include/mysql] ...

Completed. Relaunching...

Using host libthread_db library "/lib/i686/nosegneg/".
[Thread debugging using libthread_db enabled]
[New Thread -1208203552 (LWP 27596)]
Dec-18-2008 11:58:48pm (1) Starting the program...
Dec-18-2008 11:58:48pm (2) Checking for config file...
Dec-18-2008 11:58:48pm (2) Config file found. Initializing...
Dec-18-2008 11:58:48pm (2) Using module: apache
Dec-18-2008 11:58:48pm (2) Using module: bind
Dec-18-2008 11:58:48pm (2) Loading Core...
Dec-18-2008 11:58:48pm (2) MySQL[1] Successfully connected to DB (srv: [localhost] usr: [root])
Dec-18-2008 11:58:48pm (2) MySQL[1] Selecting DB serverweave
Dec-18-2008 11:58:48pm (2) Loading modules [2]...
Dec-18-2008 11:58:48pm (3) Modload: apache
Dec-18-2008 11:58:48pm (4) MySQL[1] Performing SQL query: SELECT * FROM generalsettings WHERE gmodule='apache';
Dec-18-2008 11:58:48pm (3) Modload: bind
Dec-18-2008 11:58:48pm (4) MySQL[1] Performing SQL query: SELECT * FROM generalsettings WHERE gmodule='bind';
Dec-18-2008 11:58:48pm (3) Module load completed
Dec-18-2008 11:58:48pm (1) Listening on port 10000
Dec-18-2008 11:58:48pm (2) Added task, type:Core Save
[New Thread -1208206448 (LWP 27600)]
Dec-18-2008 11:58:48pm (1) Program loaded, now in main program loop.
Dec-18-2008 11:58:53pm (4) Running task: Core Save; (last run: [never])
Dec-18-2008 11:58:53pm (2) Saving all configuration...
Dec-18-2008 11:58:53pm (3) Module: apache
Dec-18-2008 11:58:53pm (3) Module: bind
Dec-18-2008 11:58:53pm (2) Done saving all configuration.
TEST:Dec-19-2008 12:13:53am
Dec-18-2008 11:58:53pm (4) Finished task: Core Save; (Next run: Dec-19-2008 12:13:53am, interval: 00:15:00)

Saturday, December 13, 2008

Uptime: It's not rocket science, volume 2

Ok another rant about uptime. More specificly, Server/Application maintenance planning.

I see this all the time. Someone decides to perform an upgrade to a system, be it a forum, game server, or any other service. Great, new stuff. Cool.

But WHY should any type of upgrade require the service to be down while the upgrade is being performed? I've seen sites or part of sites go down for MONTHS for upgrade. I can understand a data transition phase, but that should not take more then a few minutes in most cases, if done properly. Anything that requires no data transition phase should be instant or if it requires a recompile, then only take a few minutes depending on how long it takes to compile.

How it should be done
I run several websites and a game server. NEVER have I taken any of those services down for an upgrade. I do the upgrade on a local test server, when it's ready to go, I upload it all in one shot, replacing the old site. Someone can be on the site, click on a link, BOOM, they see the new site and everything is functional. At worse, they may get a php or other error if it's not done uploading. Now sure it happens where something wont work out as expected but this should not mean the entire service is down. (ex: uploaded wrong config file so paths are wrong - just upload the right one and good to go)

As for my game server Age of Valor, it is scheduled to reboot every day at 8:00 then comes back up after a few minutes. This does two things. 1: clears any possibly leaked memory, 2: Performs any required upgrades. So the server gets a few minutes of downtime per day, and that's constant and expected by players, they know it's coming and know it will be back up very shortly.

So say I do a major change to the game server, such as totally revamping a core system or something simple like adding a new monster. I do it all locally, test it, validate it, and test it some more. Once it's ready I do a patch, upload it to the proper folder on the live game server (which is running normally during this whole time). When it reboots it applies the patch, et voila! performed server upgrade with no irregular downtime. Well scripts have to recompile, so add maybe a minute or two but if compiles took longer I could easily arrange so I don't even have to have that happen.

What about data migration
Ah yes, glad you asked. Yes, that is a bit trickier.

Basically say you have a HUGE sql database that needs to be migrated to work with a brand new system, you can't really have the migration happen while it's live or it may cause problems. BUT, the system that USES the data CAN be done while server is live. Use test data (such as a backup copy of the database from live) to do testing and coding locally.

Once it's ready to go, here's what you do. If it takes less then 5 minutes I say just go ahead and do it. In most cases a forum site or what not should not take that long.

Now if it takes more then that, say a few hours, one option is to set the old system in a read only mode so people can at least view the data, and put a notice up that it's being upgraded. Perform data migration.

For stuff where read only does not apply (such as a game server) then downtime may be the only way to go, but this is strictly migrating the data over - the actual system should be done already. I really can't picture any data migration taking too long if it's properly done. Mysql is very fast, even flat files can be fast. A forum with millions of topics being converted to a different table format should take less than an hour I would imagine.

But out of all instances where I seen a service go down, from a forum to a game server, there was no data migration required, its just a system change but the data is not changed in any way. Those type of upgrades should be instant.

What about physical server move?
Ok you really got me now, maybe there IS a reason for a service to be down.... NOPE. There are ways to prevent downtime even in a server migration.

1: Get new server ready to go, with old data from the existing server's system.
2: Test it very well
3: Since we're talking servers the key here is DNS. Set TTL very low on server's zone (do this a few days in advance)
4: Put old server systemin read only mode if applies
5: move data to new server (This really depends on connection and amount of data but should not take THAT long - in case of mysql, dump db, compress to tar.gz, transfer over, uncompress, apply to db)
6: Switch DNS IP to new server, remove system from old server and leave with a placeholder page that DNS will propagate shortly, possibly instructing users to put something in their host file to force the DNS to change for them.

This applies more or less to a website move but really could apply to anything such as a email server. I'm also assuming there is no failover/cluster setup. IF there is, well this is 10 times easier... A AD Domain controller for example is very easy to migrate to a new server if you have two servers. Just take it offline, as easy as that.

Some specialized applications may also have something that makes it easier to transfer to a new server. It may not be meant for that but it's just a design "feature" that will help. Use such things to your advantage. Use your imagination.

True story

When I moved Age of Valor from a P4 to a quad Xeon, a lot of preparation was involved, most if all of it happened while players were playing normally, as if it was a normal day.

These are in brief, steps I had to take, all doable while server is fully operational:

1: Get server provisioned
2: Log on to server, configure security stuff like firewall, root password, user accounts etc... In most cases this is just copy and paste from old server, but here I was actually migrating from pure windows server to Linux, using a VM for windows. (game server only runs on Windows).
3: Install VMware on server, create a fresh Windows VM.
4: Configure secure remote access to the windows VM. This involves setting to NAT network mode, forwarding the ports on the virtual router, then establishing a SSH tunnel to that private port. RDP can only be accessed if I'm SSHed in the server.
5: With windows up, and me RDPed to it, start configuring windows specific aspects of security and other "new install" tasks.
6: To avoid possible latency by running game packets through the virtual vmware nat, create a new interface that is bridged.
7: Get a second static IP provisioned from provider and use it for this new nic.
8: Forward proper ports through the windows firewall so game server is accessible through this IP.
9: Take latest copy of game server system and data and begin uploading. Now this takes a fair while as the maps alone are almost 1GB. I did it from old server to new, within same data center, so I got decent speeds.
10: Run new game server, fully test to ensure all is working.
11: Configure tasks such as backups and test while game server is running.

Now this is where it got VERY interesting. This is a good example of a very well planned service/data move. Given I don't have the latest data I obviously can't just point DNS to the server right now, right? No problem.

12: I shut off game server for now on new server and I waited for the scheduled server reboot on the old server.
13: Old server rebooted (by reboot, I mean just the game server engine itself, not the OS). Stop game service from starting back up.
14: With both game servers stopped, transfer data from old server to new, while it transfers, switch over DNS, AND modify old server scripts to point to new server should someone be connecting by IP instead of hostname.
15: An extra minute of downtime later, start up server on NEW machine.
16: Watch in amazement as everyone starts logging on, as if nothing ever happened.

This is a good example of using a specific application design at full advantage. The way Ultima Online works is when you log in, you are presented by a server list. That list is simply a list of name, IP, and port. Yep, you guessed it. That script change I made on old server while the files were copying to new, was to make it so the list points to the NEW ip.

I have to admit, that was by far the smoothest server migration I ever did. Literally, it took no less then 5 minutes, as far as user's are concerned. I worked for a few days behind the scenes on this, but all while the server was running live.

I also don't want to sound like I'm bragging because I'm not. This is just how it SHOULD be. There is little to no reason to take a service offline for so long while performing an upgrade or migration.

And this is how the cookie crumbles.

Mmmm, cookies.

Speaking of food, If I need to transfer all the food to a new fridge, should I make all the food inaccessible during this time?

Wednesday, December 10, 2008

Why are people such retards?

I'm sure if you have half a brain you are aware of the Hallmark fake egreeting card virus that's going around.

I work at a Help Desk and one of our customers is a school board. We have gotten many cases of this virus. It's not the kids opening them. It's the TEACHERS. Yes, they are supose to be the people who educate today's children, but yet they cannot operate a computer using some half common sense.

Viruses are so 1990. Why do people STILL fall for them?

Funny thing is, I got this email in my inbox, one of those chain letters.

You should be alert during the next few days. Do not open any message with an attachment entitled 'POSTCARD FROM HALLMARK,' regardless of who sent it to you.

It is a virus which opens A POSTCARD IMAGE - it 'burns' the entire hard disc C.

This virus will be received from someone who has your e-mail address in their contact list.

This is the reason why you must send this e-mail to all your contacts. It is better to receive this message multiple times than to receive the virus and open it.

If you receive mail called' POSTCARD,' even though sent to you by a friend, do not open it! Shut down your computer immediately

This is the worst virus announced by CNN. It has been classified by Microsoft as the most destructive virus ever.

McAfee discovered this virus yesterday, and there is no repair yet for this kind of virus.

This virus destroys the Zero Sector of the Hard Disc, where the vital information is kept.



Now those type of emails are exagerative and all, but you'd think that with those being sent, people would not open viruses. But they STILL open them.

Out of all people, my Grandma is the one that sent that email. She's not that computer savvy as computers are fairly new and complicated for someone that age, but even SHE knows not to open a virus, yet teachers that are suppose to be up to date and educated, still open viruses.

Not to pick on teachers, there are many other retards out there who still open viruses, though teachers should be the last people to do that...

Saturday, December 6, 2008


Just watched the movie. Was decent, BUT, why is it every single good action movie has to be ruined with a love story line?

The movie was great at the start when there was lot of destruction and action and even the part where he goes to jail then the girl steps in and ruins it! Isn't that what always happens? Even Star Wars was ruined like this. Keep love out of action movies (unless it's a different kind of action, the type that falls in xxx category, then it's ok :P)

My $0.03 (Our dollar is worth less now so should be worth $0.02 USD or so)

More snow!

Now it's looking a bit more like Christmas time!

Thursday, December 4, 2008


They make crappy software, they also have a crappy website. It's Galileo!

Give me my data!


Tuesday, December 2, 2008

Uptime: It's not rocket science

I've always been stumped at how some people just have trouble keeping a server up, worse yet, those that don't have a proper plan if it goes down, which happens.

In the past, 2 days, I've witnessed two Ultima Online servers go down, for hours. :O

There is no reason for a server to be down that long. If a HDD fails and it's not a raid, then there should be a very good plan to recover as fast as possible. 1-2 hours MAX. With raid, there is no reason why it should take more then an hour if something else goes wrong.

I will admit, my online production server has NO raid, however, I have everything documented in the case of a failure, so I can be up and running ASAP.

Also, backups are your friends. Automatic backups. No excuse.

That said, this is my uptime.

I'm aiming to pass 1 year. This server has been rebooted once, and it was the day after it was deployed. I did a reboot to test that everything works properly after a reboot, so I don't get any surprises in the future if I do have to reboot. (such as a service not set to start, and it reboots when I'm not around).

This server is hosted at The Planet and their service and support have been great.