Bring The Pain

I got pwn3d.

One of my closest friends is getting married, and as his best man, it fell to me to plan the bachelor party. One of the planned events was paintball at Canobie Paintball in Windham, NH.

I was a bit nervous to play, as the weather reports were not looking favorable and we were going to be drinking quite heavily the night before. However, plans were made and we were resolved to shoot each other.

After a few hours of sleep (and cleaning up a huge puddle of vomit), we made our way south to the paintball field. Canobie Paintball rates a 5 out of 10 on my scale of paintball fields. After having been told over the phone that we would definitely have private games just for our group, it turned out that this was not the case.

It worked out okay, but as far as I am concerned, if you are going to run a business you should make sure all your employees know what's going on. It worked out okay because there weren't a lot of walk-ons, but I was fairly pissed anyway.

Another thing that pissed me off was the staff. They were very pushy, and really rushed us from game to game. We were given seven minutes to refill on air and paintballs, clean paint off masks, get a drink or a snack, or simply take a breather. Due to the lack of people there, I am not sure what the rush was.

The games were also a little rushed, simply due to the size of the fields. Almost all the fields were kind of short, with the exception of one open field that had all kinds of bunkers and obstacles. I am sure that Canobie Paintball is somewhat restricted due to lack of real estate, but they probably could have consolidated two courses into one. Aside from all the bitching, we really did have a good time.

Our last game pitted the bachelor and myself against everyone else. The rules were simple - we had to kill everyone twice, but they could not kill us - hits on us did not count. It was basically a chance for everyone to engage in severely anti-social behavior and hurt us as much as possible. I have no idea how long it lasted.

It felt like ten minutes perhaps, but when you are getting peppered by dozens of 68 caliber paintballs travelling at 275 feet per second, time seems to slow.

At least I didn't cry.

[tags]bachelor, canobie, drinking, nh, paintball, party, vomit, windham[/tags]

Vote for Mindset X

I do web and graphics design for a great hard rock band, Mindset X, who is in the wildcard round for the BODOG Battle of the Bands. The band deserves a spot, and needs as many votes as possible. If you support the local music scene, please help by clicking the link below and voting. It only takes a minute...

CLICK RIGHT HERE for the BODOG Battle of the Bands - Mindset X Page and vote for them!!!

[tags][/tags]

Prototype and onComplete

My first big project at my new job has been to rewrite the forward-facing part of our booking engine. The old design used very static page structures with a lot of form submits, and was not navigation-friendly. Moving through the process required a lot of submit and back actions, with the associated page loads that go along with that - very time consuming and frustrating.
The calendar portion of the page was an ugly behemoth in and of itself, consisting of an HTML table element (with borders!) embedded in an iframe. Woof. I definitely wanted to get away from the page refreshes, as well as provide a much easier method of selecting unit types, dates, and length of stay. Enter AJAX and Prototype.

AJAX stands for Asynchronous Javascript And XML, and Prototype is the javascript library I am using for this functionality. With AJAX, calls to the database happen behind the scenes and update content on the page without having to refresh the page. However, I ran into a minor difficulty while working on this project, namely, that certain functions have to be executed upon completion of the AJAX call.

Prototype provides a way to specify what happens after the AJAX call has finished, and that method is onComplete.

[js]var params = 'function=getAvailsByWeekNumber&invID=101';
try { var myAjax = new Ajax.Request(strURL, {method:'get', parameters: params, asynchronous: true, onComplete: function(request) {
// Call some function
someFunction(request.responseText);
},
onException: function(req,exception) {
alert("The request had a fatal exception thrown.nn" + exception);
},
onFailure: function(request) { return reloadPage(); }
});
}
catch(Exception) {alert("Exception detected: " + Exception); }[/js]

In this example, I am calling someFunction upon completion of the AJAX request, and I am passing the result of the AJAX call to the function. But what if I needed to pass something else to the function, like the inventory ID defined in the query string?

As it turns out, IE and Firefox behave differently when it comes to doing this (go figure...). In Firefox, the following works:

[js]onComplete: function(request)

{

// Get the parameter property of the Ajax.Request object

var params = this.parameters;

// Parse the key/value pairs and pass to function

}[/js]

This fails in IE, because this.parameters is undefined. However, the params variable defined from above the try/catch block is available, where in Firefox it is not.

Hopefully, this helps someone out...

[tags]Prototype, AJAX, Web+2.0, javascript, XML, asynchronous, Firefox, IE, Internet+Explorer, onComplete, ResortScope, Ajax.Request, code, programming, Beyrent[/tags]

Press Announcement

RESORTSCOPE.COM IS PLEASED TO ANNOUNCE THE APPOINTMENT OF ERICH BEYRENT AS DIRECTOR OF TECHNOLOGY
LINCOLN, NH 05/22/06 – ResortScope.com, offering a Total Internet Marketing Solution for Timeshare, has appointed Erich Beyrent to the position of Director of Technology. Beyrent’s responsibilities with ResortScope.com will be focused on overseeing all aspects of web development, including the research and implementation of current technological advancements.
"Erich has been working contractually as a lead web programmer for the past year and is now joining ResortScope.com as chief of the technology department. His efforts and successes in the last year have paved the way for site enhancements leading to improved distribution and increased revenue,” said Mark LaClair, president of ResortScope.com. “We are delighted that he accepts this responsibility as we move ResortScope.com in the direction of full automation"

With over six years experience in software development, graphic design, and database administration, Beyrent comes to ResortScope.com from Plymouth State University, located in Plymouth, NH, where he managed over four hundred public computers and seventeen servers. His experience centers around Linux/Apache/MySQL/PHP (LAMP), and web services. Beyrent also runs Beyrent Web Design, a web development consulting company specializing in solutions for small businesses.

About ResortScope.com
ResortScope.com has quickly proven itself as a leading Internet marketer in the timeshare tour generation and rental business. Purpose-built for the needs of industry executives, ResortScope maximizes yield and reduces marketing costs by employing the latest in target-marketing techniques. For more information, visit www.ResortScope.com

Database Migration

I recently migrated from Drupal to Wordpress on this site, and needed to migrate all of my old content to the new database. However, One of the problems with migrating the data from one content management system to another is dealing with the differences in database schema.

Drupal stores content timestamps as an int(11) field, which represents the number of seconds since epoch (midnight, January 1st 1970). Wordpress uses a datetime field. As the two formats are completely different, a conversion must take place. Drupal stores content in the node table, and the field that stores the content creation date is called created. We'll need to select that field, and use the MySQL function FROM_UNIXTIME() to convert the date. Here's how you do it:
mysql> SELECT title,type,FROM_UNIXTIME(created) as created,body FROM
> node ORDER BY created;

+-----------------------------------+--------+---------------------+
| title | type | created |
+-----------------------------------+--------+---------------------+
| Story1 | story | 2005-03-10 11:28:22 |
| Story2 | story | 2005-03-11 16:25:14 |
| A New Story | story | 2005-03-11 16:31:18 |
+-----------------------------------+--------+---------------------+
The FROM_UNIXTIME() function also supports formatting of the result:
mysql> SELECT FROM_UNIXTIME(created, '%Y %D %M %h:%i:%s %x');
+--------------------------------------------------------------+
| FROM_UNIXTIME(created, '%Y %D %M %h:%i:%s %x') |
+--------------------------------------------------------------+
| 2005 10th March 11:05:32 2005 |
+--------------------------------------------------------------+
To reverse the conversion, you would use the UNIX_TIMESTAMP() function to convert your datetime field to a Drupal-style int(11) timestamp.
[tags]MySQL, Drupal, Wordpress, database, migration, data+conversion, date+functions,from_unixtime(),content+management+system[/tags]

New Website Format

Hi everyone!

In case you haven't noticed, things look a bit different around here. I am in the process of migrating the website content from a Drupal content management system to a Wordpress installation. This will allow me to emphasize the content provided here without having to work quite so hard on presentation issues.

Please be patient while I finish the migration, and check back often for updates!

[tags]beyrent, drupal, website, wordpress[/tags]

Reinstalling Internet Explorer

We had a situation at work where a Windows XP computer had a completely corrupted installation of Internet Explorer - the browser simply was broken.  It is not incredibly obvious, but it is possible to reinstall Internet Explorer without having to try and fix the operating system itself.

From the Start menu, select "Run" and entering the following command:

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\Inf\ie.inf

You will need to have your XP CD available.

This command line is not the easiest thing in the world to type, so for those with weak typing skills, a small VBScript that will execute the command for you can be downloaded here.

Save the file to your hard drive and double click it to run IE Setup.

Of further interest:

[tags]Windows, XP, Internet+Explorer, repair[/tags]

Microsoft Alternatives

Recently, I came across Redmond Magazine, which is geared towards people who administer Microsoft Windows on a daily basis.  Columnist Doug Barney wrote an editorial regarding Microsoft alternatives in the desktop arena in the March 2006 issue (pp. 4), which I have to take issue with.

Barney compared Macintosh OS X and Red Hat Linux to Windows XP, which I do not feel is a fair comparison.  Red Hat Linux is not, nor was it designed to be, a desktop operating system.  Red Hat's biggest strength is the server market, and because of this, does not require the crutches that a normal desktop environment must provide to help people with all skill levels accomplish their goals.

A much more suitable comparison would have been Ubuntu Linux, which is specifically geared for the end-user experience.  I have been a Windows user for a very long time, and I can honestly say, I have never seen a Linux operating system as easy and fun to use as Ubuntu.  Installation is extremely easy, and the mechanisms provided for installing software from the desktop is top-notch.  I feel that novice computer users could easily use this operating system, as the interface is very intuitive.

It comes prepackaged with OpenOffice2, which is a very capable (and free) Office replacement.  Firefox is installed by default, as is applications for businesses, the arts, and home productivity.

It seems that a big portion of the media only considers Red Hat as a viable Linux operating system, which could not be further from the truth.  I urge you to take a look at Ubuntu (website) and give it a fair review.

[tags]Redmond, Microsoft, Windows, XP, Linux, Red+Hat, Ubuntu, OS+X, Macintosh, operating+system, desktop+environment, OpenOffice[/tags]

Configuring Vonage Redux

So now I finally have things working with my new Vonage service, but it required some additional configuration.

In my previous post, I made some changes to IP addresses on my routers to get everything connected.  However, something was not quite right - when talking on the phone, the sound would fade in and out, and was basically unusable.  I also noticed that I could only get DHCP addresses on one of my routers, and only if I was directly connected to it.  Clearly, this was no good.

So, to recap, my network layout is like this:

I have a cable modem, addressed at 192.168.1.1.  Directly attached to it is a Linksys WRT54GX wireless router, addressed at 192.168.1.3.  I have another router, a Linksys BEFSR41 addressed at 192.168.1.2 connected to the wireless router via cross-over cable, and the Vonage Linksys RTP300 router also connected to the wireless router via cross-over cable.  Its address is 192.168.2.3.

I logged into the BEFSR41 router, and disabled DHCP.  I was getting conflicts by having two DHCP servers on the same subnet dishing out address to multiple clients.  At this point, I could only get an address if I was physically connected to the wireless router, which still had DHCP enabled.  That's when I discovered the Advanced settings on the BEFSR41 router.

First, I had to go the Dynamic Routing table, and set the working mode from Gateway to Router.  I then set Dynamic Routing TX and RX to RIP2.  This changed the behavior of the router, and made it act more like a switch, leaving my wireless router to act as the sole gateway on my home network.

Surprisingly, I discovered that my Vonage phone service suddenly became usable.  The sound quality was fantastic, there was no dropped sound, and no chirpiness to the sound quality.

Life is once again happy.

Vonage, routing, Linksys, gateway, DHCP, switch, RIP2, dynamic, VoIP

Configuring Vonage

After speaking with friends and colleagues, I recently was convinced that Vonage was a stable enough product to switch phone service to.  For those of you who don't know what Vonage is, it's a complete phone service provider, over the internet instead of traditional phone lines.  This technology is known as VoIP, which stands for Voice Over Internet Protocol, and Vonage charges half of what more of the traditional phone carriers are charging.

About five days after signing up for the service, I received my Vonage router in the mail, which is basically a Linksys router branded by Vonage (cable or DSL broadband access is required by Vonage).  The router itself has four LAN ports, two phone ports, and a dedicated port for connecting to the cable modem.

The router comes pre-configured with a standard class C IP address of 192.168.15.1.  Vonage expects that in most cases, the user will simply connect the router to the cable modem and all will be well.  However, I am running a wireless 802.11G router with SRX400 technology, and when I connected the two routers together via crossover cable, I was unable to ping either device, and could not get on the internet.

I quickly decided to change the IP address on the Vonage router to be 192.168.1.4, keeping my wireless router at 192.168.1.3.  This failed to change the level of connectivity.  The documentation made mention of configuring static routes on the Vonage router in the case of multi-router configurations.  However, I had no success with this either.

After fooling around with the settings for about two weeks off and on, I finally broke down and called the Vonage tech support, and ended up speaking with Samesh in Bangalore, India.  After learning my tiny network topography, Samesh instructed me to change the IP address on my Vonage router to be 192.168.2.3.  She then told me to go to the MAC Address Clone tab in the router configuration utility, and clone the MAC address of the router.

Once the router rebooted, I was instantly connected.  Because of my pedestrian understanding of networking principles, I don't understand why that specific IP address works and is able to connect.  I also don't understand why I cannot ping the Vonage router or otherwise connect to it while connected to my wireless network.  If anyone can provide a concise explanation of the reason for this, I would love to post your comments as a follow up.

Vonage, networking, class+C+network, Bangalore, tech+support, VoIP, wireless

About Erich

Erich is a web developer and a native New Englander who is passionate about life, the universe, and everything.

He is currently a senior Drupal developer at Harvard University, working on the IQSS OpenScholar project.  Prior to joining the team at Harvard, he was the engineering manager at CommonPlaces e-Solutions, in Hampstead, NH, contributing as the lead engineer on the Greenopolis.com and Twolia.com.

Erich is active in the Drupal community, having contributed modules and patches to the community. He presented at DrupalCon in Szeged Hungary, and co-presented at DrupalCon 2009 in Washington, DC.

Erich lives in New Hampshire with his wife, two sons, and two weimaraners.  When not writing code, Erich enjoys landscaping and woodworking.

Faceted search

Categories

Content type

Project types

Artwork Type

Artwork Tags

Recent comments

Activity Stream

May 18, 2010

  • Twitter ebeyrent tweeted "#drupal Permissions API #module now comes with #drush support: http://drupal.org/node/802256" 11:43am #
  • Twitter ebeyrent tweeted "Working on building a #solr server on #rhel for @openscholar" 8:56am #
  • Twitter ebeyrent tweeted "@DamienMcKenna I used to love that cartoon as a kid! One of the best cartoons most people have never heard of!" 7:41am #

May 17, 2010

  • Twitter ebeyrent tweeted "@bymiche Still waiting for Sprint version. Maybe June or July..." 8:04am #
  • Twitter ebeyrent tweeted "Can't seem to wake up today..." 7:49am #

May 16, 2010

  • Twitter ebeyrent tweeted "What the?! This is sick! http://benfirshman.com/projects/jsnes/ #awesomesauce" 6:27pm #
  • Twitter ebeyrent tweeted "@DamienMcKenna Thanks - fortunately, just a bad sprain. Just got to keep an active 4 year old inactive... :)" 5:13pm #
  • Twitter ebeyrent tweeted "Youngest son goes to ER for x-rays on his foot. Great way to spend a Sunday morning. #fatherhood" 2:07pm #

May 13, 2010

  • Twitter ebeyrent tweeted "RT @cpliakas: Awesome! Have a chunk of facets working for Search / Search Lucene API / Apache Solr in my "Facet API" concept module." 8:05am #
  • Twitter ebeyrent tweeted "Finished reading "The 900 Days" - unimaginable horror. #history #wwII #russia" 8:04am #

May 12, 2010

May 10, 2010

  • Twitter ebeyrent tweeted "Interesting reasons to not use cron for #drupal RT: @cpliakas: "Drop that cron; use Hudson instead" by @DavidStrauss http://bit.ly/9wAvU9" 9:20am #

May 7, 2010