apocryph.org Notes to my future self

28Oct/090

Trying out new StackOverflow Careers

I’ve been playing with the new StackOverflow Careers beta. Today they released a bunch of new features, which makes it pretty cool. If it had the ability to generate Word and plain-text resume files from the site, I would abandon my Word-based resume entirely. Hopefully that’s coming.

You can see my resume here. When the employer side opens up (supposedly next month) my company will definitely be using it to look for programmers.

Filed under: Uncategorized No Comments
12Oct/090

Video from September 2-gun and 3-gun matches

I’m pretty late in posting the video from last month’s 2- and 3-gun matches at SEG, but better late than never.

9-September 2-gun

I didn’t do too well on this match. I placed 10th overall, most because of slowness than point penalties.

Stage 1 was a bitch, because it required several weak-side shots. I fired my rifle left-handed for the first time during that stage, which I guess speaks volumes about my rifle training. In any case:

On stage 2 I took my own advice and slowed down; in hindsight, probably too much. I was only down 1 point, but my time was 15 seconds slower than the winning time. Ouch:

On stage 3 I again shot fairly accurately, but very slowly. My time was 13.91; winning time was 9.15:

When I was watching the 7pm squad shoot stage 4, I thought to myself “I don’t get it; why are they shooting it so slowly?”. I then shoot it in 7.69 seconds for a score of 9.19. Best time was a blistering 5.72; winning score was 7.62. Ouch.

23-September 3-gun

This was the first 3-gun match I’ve ever shot, and the first at SEG as well. It was different from 2-gun in a few important ways:

1. Shotguns!
2. One long stage instead of four short ones
3. We each got to reshoot the stage one extra time

You’d think with a do-over that I’d turn in an awesome performance, and you’d be wrong. I placed 7th, with a time of 101.2 and 7 point penalties. Interestingly, I had the lowest penalties of everyone in the match, meaning I shot more accurately than any other shooter. You might think that means I’m a crack marksman inexplicably beaten by a bunch of hosers, but you’d be wrong again. A key aspect of winning in practical shooting matches (and, I assume, gunfights) is balancing speed with accuracy. It’s not that I was the only one in the match able to shoot as accurately as I did; I was the only one who traded speed for accuracy the way I did.

The winner of the match had only 10 points down, so not far from me. But I was also beaten by buys with 13, 18, and 21 points down, who nonetheless shot a fast enough time that even with penalties they still came out ahead. Every time I try to do that, I go too far in the other direction, and rack up alot of penalties without getting enough extra speed to balance it out, which is why I force myself to focus on accuracy and not speed. At some point hopefully I’ll be good enough I can pour on some speed and keep accuracy reasonable, but I’m not there yet.

Another thing I learned in this match is how to load a shotgun. Of course, I’ve loaded my shotgun before, but never on the clock. As you can see in my first run through, I dropped a shell and had to chase it all over the range, coming dangerously slow to breaking the 180. Gumbel was smart enough to just take the point penalty and skip that shot.

Anyway, here we go. Attempt number 1:

(Stupid shitty Flickr can’t decide if it supports video or not, so it stops at 90 seconds. WTF?)

Attempt number 2, sans slug fumble:

3Sep/092

Shoot IDPA at SEG Today; Did Poorly

Today was the monthly IDPA shoot at SEG. I did pretty poorly, and was even in danger of being beaten by Gumbel. I’m not sure why I shot so badly, but the whole night I was definitely off. I was missing easy shots, forgetting the course of fire, and generally doing stupid things.

I need a ton more practice with the new STI 1911 before I shoot it nearly as proficiently as I did my old Glock 19, but I’m committed to sticking with the STI, as it’s my daily carry gun and the Glock 19 is not.

The videos tell the sorry tale:

Here’s stage 1. It was actually a cool stage, with a reactive target rigged up so you shoot one target’s head, which then reveals another target. I rushed it, and I didn’t think clearly so I put a body shot into the target that required the head shot. Stupid, stupid, stupid.

On to stage 2, which involved some fairly long-range shooting. I did predictably badly on this, although mechanically I shot it fine.

Next came stage 3, which involved some shooting while retreating, and some shooting from cover. I flubbed a few of the shots from cover.

Finally, stage 4. Very simple, included one-handed shooting with strong and weak hand. I never shoot well with my weak hand, and this was no exception.

Overall, I was ashamed of my performance. I haven’t made it to the range to practice in two weeks, and boy does it show. I’ve GOT to get some practice in this weekend before next week’s 2-gun match.

Tagged as: , , 2 Comments
31Aug/091

Installing ‘pg’ gem with RubyInstaller 1.9.1 preview2

I’ve been running the latest RubyInstaller preview for Ruby 1.9.1 on my Windows boxes.  It’s way better than the old 1.8.x stuff, but some things are harder than others.  One thing that’s tricky is getting some gems installed that build from source.  I recently had cause to install the ‘pg’ gem to access PostgreSQL databases from my Ruby apps.  Here’s what I did:

I started with the RubyInstaller 1.9.1 preview2, which installed Ruby 1.9.1 P243.  I got it here.

I then downloaded the DevKit 3.4.5 r3 from the same page, and extracted the .7z file into the directory where I installed Ruby (c:\work\tools\Ruby19 if you care).

Next I opened up a command prompt with the Ruby environment already set up, using the ‘Start Command Prompt with Ruby’ shortcut.  If you instead launch your own command prompt, things probably won’t work right, as the paths won’t be tweaked appropriately.

After that, I tried gem install pg, which failed thusly:

Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

C:/work/tools/Ruby19/bin/ruby.exe extconf.rb
ERROR: can't find pg_config.
HINT: Make sure pg_config is in your PATH
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/work/tools/Ruby19/bin/ruby

Gem files will remain installed in C:/work/tools/Ruby19/lib/ruby/gems/1.9.1/gems/pg-0.8.0 for inspection.
Results logged to C:/work/tools/Ruby19/lib/ruby/gems/1.9.1/gems/pg-0.8.0/ext/gem_make.out

Doh! The PostgreSQL pg_config tool isn’t in my path.

I’m running PostgreSQL 8.4.0-1 installed with the One-Click Installer, installed in the default path C:\Program Files (x86)\PostgreSQL\8.4. The pg_config tool is in the bin subdirectory:

set "PATH=%PATH%;C:\Program Files (x86)\PostgreSQL\8.4\bin"

Note the double-quotes are important, since the PATH includes paths that contain spaces. I then tried gem install pg again:

Building native extensions.  This could take a while...
Successfully installed pg-0.8.0
1 gem installed
Installing ri documentation for pg-0.8.0...

Ok. Let’s test it:

irb(main):001:0> require 'pg'
=> true
irb(main):005:0> conn = PGconn.connect('pixel', 5432, '', '', 'testdb', 'test', 'test')
=> #

Yay! Nailed it!

Next up, getting it working with Rails.

Filed under: Uncategorized 1 Comment
23Aug/090

August IPSC and 2-gun results

The results are in for this month’s IPSC and 2-gun matches at SEG.

First IPSC:

This was the most fun IPSC match I’ve shot. Did it show in my scores? Well, not really. In my division (Single Stack) there were only four shooters. I placed second, behind an A class shooter, and ahead of a C class and a U class.

Overall, across divisions and classes, I placed 9th out of 28 shooters. That’s not my best showing to be sure, but most of the 8 shooters who finished ahead of me are serious trigger-pullers who I wouldn’t expect to beat. I am also getting better with the STI; my reloads were much smoother and my shot groups better. I need alot more practice, then I think my times will start going down.

Next, 2-gun:

Fortunately I forgot to bring my camera, because that 2-gun match was a disaster. I started hosing; I’d see the guy before me shoot the stage real fast, and I’d feel like I should too, so I’d hose down the targets with multiple shots in rapid succession, but I went too fast and accuracy suffered. Badly. On the fourth stage I force myself to slow down, and did much better accuracy-wise (but shot it in a glacial 7+ seconds).

I came in 5th overall out of 29 shooters, so I guess alot of other guys had a bad night too. Again, everyone who beat me is a great shooter whom I wouldn’t expect to beat, as are some of the guys who placed after me, so as much as I was dissatisfied with my performance, apparently it could’ve been worse.

The 2-gun results are here

Filed under: Uncategorized No Comments
23Aug/092

Moved from FutureHosting to Linode

Yesterday I finally snapped. I grew weary of all the problems I’ve had with FutureHosting. From niggling annoyances to serious issues, I’ve not had fun with FutureHosting. I currently have two VPS instances with them: one is a web server, and the other a database server. They host apocryph.org and a couple of side projects. Even one of those instances would be way overkill for the load I put on them; I got two because that was the cheapest way to get more space, which in the end I didn’t need anyway.

Let me recount some of the indignities:

Indignities of FutureHosting

Their ‘managed’ VPS instances all come with some sort of web-based control panel.  At first I went with DirectAdmin because I didn’t know better.  I didn’t like that.  I then was running cPanel.  There are two blog posts on apocryph.org regarding the extent to which cPanel blows, so draw your own conclusion about how that went.  But even setting aside the suckiness of particular web-based control panels, these boxes weren’t set up the way I like, and since they’re managed you can’t exactly rip them apart and put them together again.  It’s partly my fault for going with a managed instance, but it’s also their fault to building images that are so constrictive.  They are clearly meant for end users running web sites with little to no sysadmin background, not developers who like to hack their own shit all the time.

Then there are little annoyances.  Like, when I sudo on one of their boxes, this warning comes up: audit_log_user_command(): Connection refused.  Why does that happen?  I have no idea, but it’s the way the images were built.  Or the fact that there are approximately a million different web-based systems for doing different things.  Want to add a domain to your site?  Well, log in to Parallels and add the domain so their DNS infrastructure knows about it.  Then log in to the panel on the web server box to provision an account there.  Then log into the panel on the database server to provision a database.  Did that fail?  Log in to the support system to open a ticket, then log in to the WHM panel on the box to restart apache.  For the love of God, how many disparate web systems can you patch together?

Tickets ‘EMS-417155′ and ’JJT-975910′, in which seemly at random I would find my web server ‘raz’ unable to connect to the MySQL server ‘lio’.  This went on for  days, and got escalated up to the CEO.  It turned out much later that when I fiddled with the firewall controls I fiddled with the Parallels firewall not the built-in Linux APF firewall, and these don’t go well together.  Before they figured this out, I moved lio to another instance, this one running Ubuntu and without any control panel.  That was a fun hassle.

Ticket ‘BYG-486778′ nicely summarizes what it’s like to work with FutureHosting support.  For the most part they are able to solve problems quickly, but when my server suddenly stops working, I want to know more than ‘it’s fixed now’; I want to know what happened, and if it was my fault how I can avoid doing it again.  Getting that from FutureHosting is like pulling teeth.  Here’s the exchange from that ticket:

Adam Nelson (Mr. Adam Nelson)
Posted On: 03 Mar 2009 02:53 PM

I’m experiencing an outage on port 80 for apocryph.org and the other domains hosted on raz. I ran into this over the weekend, and cleared it up with a reboot, but it has returned and I want to determine the root cause.

I’ve already tried disabling the APF firewall with apf -f, and the problem remains. To see the problem, go to http://apocryph.org. For me, the request times out.

I’ve checked resources on the box; everything seems fine. I didn’t see anything untoward in the logs either. I’m pretty sure a reboot will fix this, but I want a root cause explanation.

Thanks,
Adam

Nate
Posted On: 03 Mar 2009 04:02 PM

Dear Adam,

This has been taken care of. Please check http://72.44.80.85.

Let us know, if you need any further assistance.

—-
Apache is functioning normally
—-
Best Regards,

Nate

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

www.fhstatus.com is an off-network site which will provide system status for all nodes. If there is a problem with a node or network issue, it is updated with any information available from our technicians.

Please keep one issue per ticket to avoid any potential errors.

Although we maintain backups of standard VPSs, you should always make backups of all your data.

Nate
Posted On: 03 Mar 2009 04:16 PM

Dear Adam,

I have forgot to explain you the fix. The previous instance of apache was hung and I have killed the process ID of apache and restarted apache.

PS : I haven’t rebooted the server.

Best Regards,

Nate

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

www.fhstatus.com is an off-network site which will provide system status for all nodes. If there is a problem with a node or network issue, it is updated with any information available from our technicians.

Please keep one issue per ticket to avoid any potential errors.

Although we maintain backups of standard VPSs, you should always make backups of all your data.

Adam Nelson (Mr. Adam Nelson)
Posted On: 03 Mar 2009 05:34 PM

Ok, thanks for the update.

Why would apache hang and how can I keep that from happening? I’m also surprised I didn’t get an outage alert since I thought the HTTP monitor was still active from my last serious problem that Vik was helping with.

Nate
Posted On: 03 Mar 2009 05:47 PM

Dear Adam,

Apache was not down on the server, It was hung. So, you haven’t received the outage mail.

It might have occurred due to high access or something like that.
Best Regards,

Nate

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

www.fhstatus.com is an off-network site which will provide system status for all nodes. If there is a problem with a node or network issue, it is updated with any information available from our technicians.

Please keep one issue per ticket to avoid any potential errors.

Although we maintain backups of standard VPSs, you should always make backups of all your data.

Adam Nelson (Mr. Adam Nelson)
Posted On: 06 Mar 2009 04:34 PM

My site appears to be down again. This is becoming untenable. I need to know what is causing the hang, and I REALLY need to understand why a tool that monitors for web site outages would not detect an outage that takes the form of a hung web server.

Any assistance is appreciated.

Thanks,
Adam

Nate
Posted On: 06 Mar 2009 04:37 PM

Dear Adam,

Your ticket has been assigned and is being reviewed. An update will be available shortly.

Best Regards,

Nate

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

www.fhstatus.com is an off-network site which will provide system status for all nodes. If there is a problem with a node or network issue, it is updated with any information available from our technicians.

Please keep one issue per ticket to avoid any potential errors.

Although we maintain backups of standard VPSs, you should always make backups of all your data.

Nate
Posted On: 06 Mar 2009 05:49 PM

Dear Adam,

Httpd is up now. I am investigating the detailed cause and will keep you updated.
Best Regards,

Nate

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

www.fhstatus.com is an off-network site which will provide system status for all nodes. If there is a problem with a node or network issue, it is updated with any information available from our technicians.

Please keep one issue per ticket to avoid any potential errors.

Although we maintain backups of standard VPSs, you should always make backups of all your data.

Nate
Posted On: 06 Mar 2009 07:01 PM

Dear Adam,

The listen variable was set in correct in the apache configuration file. I have corrected it now and also there were some semaphore arrays on the server, have killed it now.

Apache is running fine now. Let us know, if the problem persists.

Best Regards,

Nate

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

www.fhstatus.com is an off-network site which will provide system status for all nodes. If there is a problem with a node or network issue, it is updated with any information available from our technicians.

Please keep one issue per ticket to avoid any potential errors.

Although we maintain backups of standard VPSs, you should always make backups of all your data.

Adam Nelson (Mr. Adam Nelson)
Posted On: 18 Mar 2009 11:33 AM

This has happened twice since the ticket was closed. I restarted apache myself last time, but this has become unacceptable. I need to know two things from support:

1. Why is Apache hanging? It didn’t do this for months until now. What’s changed?

2. Why is your supposed HTTP monitoring not noticing that my website is going down? It’s not a high-traffic site, so it could have been down for days. What good is HTTP monitoring that only detects closed ports and not hung services?

I hate to be difficult about this, but this is completely unacceptable. Please address both concerns above. If they are not addressed, be advised I will take them up with Vik Patel directly.

Nick
Posted On: 18 Mar 2009 12:30 PM

Hello Adam,

I will look into this and get back to you with updates.

Best Regards,

Nick

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

Nick
Posted On: 18 Mar 2009 12:44 PM

Hello Adam,

Another process was using port 80 hence apache was not starting. I have killed that process to start apache.
Please let us know the ticket ID of your monitoring ticket. I am not able to find monitoring ticket for your VPS.

Best Regards,

Nick

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

Adam Nelson (Mr. Adam Nelson)
Posted On: 18 Mar 2009 01:32 PM

Nick:
I’m sorry but that is not acceptable. What other process? Why was it using port 80? How did it take over port 80 while httpd was listening on it? Most importantly, how do I make this stop happening?

I don’t think there’s a monitoring ticket. Vik put monitoring on the box when I was having problems with the firewall interfering with MySQL connections a while back.

Nick
Posted On: 18 Mar 2009 02:35 PM

Hello Adam,

I can understand your concern. It generally happens when httpd tried to start, some other process was already listening on 80. But that process shows as httpd*. The multiple instances of httpd running is normal.

It should not happen again. If the problem persists then we will recompile apache.

Regarding monitoring, Vik must have enabled monitoring for mysql and not apache. I will suggest you to enable free apache monitoring. Please open new ticket for monitoring with following details. This ticket will keep the record of your apache monitoring.

As you have a managed VPS, included as part of the managed service is monitoring for apache failures. If you have ordered an upgraded monitoring package to monitor other services please provide us with a list of services you would like monitored.

The basic monitoring package included with managed VPSs will monitor Apache only via the primary IP address. If you would like a domain name monitored or other services, such as MySQL, DNS, POP3, SMTP, IMAP, please order an upgraded monitoring package.

If you have selected an upgraded monitoring package for more than one service, please update this ticket with the services you would like monitored.

Please note, it takes up to 48 hours for the VPS to be added to our monitoring system.

Please submit the following information:

IP of server:
Hostname of server:
Root password of server:
Control Panel URL:
Control Panel Password:
If upgraded monitoring, what services do you want monitored? (i.e. apache, ftp, dns, mysql, domain):

Note: If you change your root password at anytime, update this ticket with the new password.

Best Regards,

Nick

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

Adam Nelson (Mr. Adam Nelson)
Posted On: 18 Mar 2009 03:38 PM

I’ve opened a new ticket to request monitoring.

I’m going to need more root cause analysis than that. You say multiple httpd processes are normal (which I understand), and yet an ‘httpd*’ process took over port 80. Why?

You say this should not happen again, yet it’s been happening for weeks. What did you change and why do you think that will fix it? Why do you think recompiling apache will fix it?

I’m trying to be civil, but sometimes getting detailed answers from support is like pulling teeth. Is there anyone you can escalate this to?

Steve
Posted On: 18 Mar 2009 05:26 PM

Hello,

Recompiling Apache will updated server software and it will reset Apache to work on port 80. Your apocryph.org is working fine. I will have my senior admin to look into this if still the issue is persists.

Please let me know if you have any other questions regarding this.

Thank you,

Steve

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

There you have it.  I still don’t know what happened.  They did set up HTTP monitoring, and every month or two it reports an outage and they bounce the service.  Why does it hang?  No idea.  Who cares, really, since bouncing it solves the problem?  I mean, why investigate the root cause of a repeated outage when you can just bounce the service and hope it doesn’t happen again?

The ticket that finally pushed me over the edge was ‘YXN-886538′.  I discovered apocryph.org was failing to load with an error establishing database connection.  Nevermind their monitoring was supposed to check the text of the response to detect this case; I’m used to that sort of disappointment.  Here’s the blow-by-blow:

Adam Nelson (Mr. Adam Nelson)
Posted On: 19 Aug 2009 01:15 PM

My personal website, apocryph.org, hosted on my VPS raz.bulshytt.com, is once again failing to load with “Error establishing a database connection” errors. I thought there was a monitor in place to detect this condition.

I noticed I got two alerts last night about both raz and lio going down, but they are both up now. The only problem I can see is apocryph.org being down.

George
Posted On: 19 Aug 2009 01:18 PM

Dear Adam,

I am checking this now and will get back to you shortly.

Thank you,

George

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

George
Posted On: 19 Aug 2009 02:06 PM

Dear Adam,

I can see apocryph.org is a wordpress site which is using the “anelson_apocryphwp”database but I couldn’t find any such database in mysql.

Please upload the backup of the database anelson_apocryphwp to your home directory so that we shall restore it.

Thank you,

George

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

Adam Nelson (Mr. Adam Nelson)
Posted On: 19 Aug 2009 02:14 PM

That is incorrect; I have verified once again that the database exists.

As I noted in the ticket, the database is not hosted on raz. WordPress runs on raz, and points to a MySQL database on lio. I just logged in to verify the database is there.

Whatever the problem is, it’s not a missing database.

George
Posted On: 19 Aug 2009 03:01 PM

Dear Adam,

Thanks for the update. I am working this issue and will get back to you shortly.

Thank you,

George

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

George
Posted On: 19 Aug 2009 04:14 PM

Dear Adam,

The issue should be fixed now. The webpage apocryph.org is pulling up fine from our end.

Please verify it from your end and let us know if you need any further assistance.

Thank you,

George

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

Adam Nelson
Posted On: 19 Aug 2009 05:35 PM

Thanks George, I can confirm it’s fixed now.

Can you explain what happened that took it down? I’d like to
understand the failure case.

Adam

On Wed, Aug 19, 2009 at 5:14 PM, George wrote:
> Dear Adam,
>
> The issue should be fixed now. The webpage apocryph.org is pulling up fine
> from our end.
>
> Please verify it from your end and let us know if you need any further
> assistance.
>
>
> Thank you,
>
> George
>
> Please complete our customer satisfaction survey:
http://survey.futurehosting.biz
>
> Customers with unmanaged VPSs will receive only hardware and network
> support.
>
> Please keep one issue per ticket to avoid any potential errors.
>
> Remember, you should always make backups of all your data.
>
> Ticket Details
> Ticket ID: YXN-886538
> Department: Support
> Priority: Important
> Status: On Hold
>

George
Posted On: 19 Aug 2009 05:45 PM

Dear Adam,

Thanks for the update.

I have granted the privileges to the database anelson_apocryphwp for the database user anelson_apowp in the server. So the website is pulling up fine now.

Please let us know if you need any further assistance.

Thank you,

George

Please complete our customer satisfaction survey:
http://survey.futurehosting.biz

Customers with unmanaged VPSs will receive only hardware and network support.

Please keep one issue per ticket to avoid any potential errors.

Remember, you should always make backups of all your data.

It should be noted that I am not retarded.  Specifically, I know how to grant privs on a database to a MySQL user.  That’s how come apocryph.org was working for weeks prior to my opening this ticket.  I hadn’t so much as logged in to the cPanel instance, so it’s unlikely I fucked something up.  And yet, for no reason, the database connection started failing.

I figured out later after support closed this ticket that their stupid Parallels system for adding domain names to their DNS has an awesome feature whereby the RDNS entry for a given host’s IP address is whatever domain you added last.  One thing I did to recently was add a few of my domain names to their DNS.  I had meant to provision virtual hosts for them but didn’t get around to it; all I changed was adding these domains and some A entries to their DNS infrastructure.

Unfortunately, MySQL is a craptastic clusterfuck of stupid design decisions, the most awesomest of which being host-based authentication.  The user ‘mysqlblows’@'localhost’ is a completely different account from ‘mysqlblows’@'apocryph.org’.  Because of this, when MySQL gets a connection from another host, it does a reverse DNS lookup to get that host’s name, then uses that to figure out what user account is being used.  When I added these domains, that stopped being ‘wordpress’@'raz.bulshytt.com’, and started to be ‘wordpress’@’someotherdomain’, hence the failure.

It’s not FutureHosting’s fault that MySQL blows.  But it is their fault that their DNS system is so fubar, and it’s definitely their fault that their support guys don’t factor this in when dealing with a customer’s MySQL connectivity problems.

Once I discovered this, I opened another ticket to have them fix RDNS.  Their tech initially claimed there was some web-based control panel where I could configure my own RDNS.  When I asked him where it was, he realized that, in fact, individual users cannot control their RDNS entries, and a ticket is required instead.

Moving to Linode

Originally I wanted to go with Slicehost.  They are clearly developer-oriented, and they wrote their own admin panel so everything is integrated.  They did all this in Rails, which I like.  However, Rackspace acquired them back in ‘08, and I didn’t hear as rave reviews on WHT after that.  Every time I did see someone talk about Slicehost, they mentioned Linode in the same breath, so I took a peek at them.  Wow.

It was like going from a patchwork of old DOS boxes to a fancy Google datacenter.  They also have a hand-rolled web interface, and man is it sweet.  They have a great rep, and discount offers are impossible to find, which tells me they don’t need to race to the bottom on price like discount hosters do.  They even have a frickin’ API with which you can provision and de-provision instances.  They effectively have day-by-day billing, so I could clone my box to another instance, try out a patch or bit of code or whatever, then drop the instance on the same day, paying only for that day’s use.  It’s like EC2 with a bit more hosting infrastructure in place.

I also took the opportunity to stop paying $70/mo for two boxes when I don’t need them.  Now I’m on a $38/mo plan that gives me 300GB of transfer a month, 25GB of storage, and 540MB of RAM.  This is actually more expensive than FutureHosting; I was paying more because I foolishly bought more capacity than I realistically needed and didn’t want the hassle of combining the two instances together.  Still, it’s not that much more than FutureHosting considering what you get.

So what do you get, besides a neat web panel and a frickin’ API?  Well, when I provisioned my instance, I got to pick from tons of distros.  I went with Ubuntu Jaunty x64, but there were tons of 32- and 64-bit options.  The box provisioned in approximately 3 seconds, and then I was in.  And it was amazing.  Apache wasn’t there.  MySQL wasn’t there.  Freaking ‘dig’ wasn’t there.  The box was completely barren.  It had vi and the binutils; that was pretty much it.  I hadn’t had this degree of freedom since I had a colo box.  I could configure the box exactly to my tastes.

This might sound like a downgrade.  Why pay more for a VPS that you have to setup and configure yourself?  Why not use a easy pointy-clicky dick-hosting web panel like cPanel?  For the majority of commodity web hosting consumers, there’s no good answer; go with what’s cheap and easy.  However, for developers and guys who like to run their own boxes, it’s a breath of fresh air.  Back on FutureHosting I _hated_ the way domains and subdomains were implemented for a user, but I couldn’t change it or cPanel would have a stroke.  Here, I can set things up however I want.

I’m also back to the command line.  There’s no shitty web GUI to provision databases, or users, or virtual hosts.  I use the web interface to provision instances, add domains to their DNS infrastructure, change RDNS entries (HA!  you hear that FutureHosting?), and open tickets.  Everything on the box, I do over an SSH shell the way God intended.

Sure, I could buy a cPanel license and install it on my box.  If I was retarded.

I’ve been on Linode for about 24 hours.  It’s entirely possible I could discover all sorts of horrible gotchas and problems in the future.  But for right now, life is good.

19Aug/090

August IPSC at SEG

It’s Wednesday, and that means another shooting event at SEG.  Tonight was IPSC, and I felt good about my performance. All the stages tonight were more elaborate and fun than usual; I had a great time.

Here I am shooting stage 1, which included four pepper poppers painted into some cardboard. It’s something different anyway. I think I cleaned this one:

Next up is stage 2, which covered alot of ground and 12 targets. It was a blast, even without the pun:

Stage 3 was also neat, as it involved two reloads and lots of shooting from the kneeling position.

Sadly stage 4 didn’t get filmed due to a camera glitch. It was a quick stage starting from a seated position with an unloaded gun. I had to load while running to the firing line, then shoot around a wall at four targets. I almost cleaned it but got one charlie.

Filed under: Uncategorized No Comments
19Aug/094

Getting FXRuby going with Ruby 1.9.1 and the new RubyInstaller

I’ve long resented the fact that the Ruby one-click installer for Windows uses Ruby binaries built with Visual C++ 6.0, which being ancient AND broken is very much teh suck. Thankfully, Luis Lavena is working on a new Windows installer for Ruby 1.9.x, the so-called RubyInstaller, which uses binaries built with MinGW. I wish he’d use the free version of Visual C++ 2008, since that IS the definitive compiler for Windows, but there are some licensing gotchas there to worry about, and anything is better than VC6.

Anyway, I downloaded the latest preview release of the installer, and the separate DevKit tarball, which I extracted into my Ruby install directory (which is _not_ c:\ruby; I hate dumping stuff in the root of the file system). I then wanted to get FXRuby, the Ruby bindings for the FOX GUI toolkit, working in this environment. Not easy. My experience follows.

Directories

I use a non-standard directory layout.  I’ll make reference to it in the steps below.  You obviously don’t have to use my layout.

c:\work – Where it all happens

c:\work\sourcecode – Where I extract source tarballs.  For example, zlib-1.2.3 is extracted to c:\work\sourcecode\zlib-1.2.3

c:\work\tools – Where I install the built libraries.  For example, zlib-1.2.3 is installed to c:\work\tools\zlib-1-2.3 (with make install creating subdirectories like lib and include).

c:\work\tools\ruby19 – Where I installed Ruby 1.9

Installing Ruby

I grabbed the latest preview1 installer here. At the time of this writing, it was ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32].

I also grabbed the DevKit tarball from the same location. At the time, it was Development Kit 3.4.5r3 (MinGW 3.4.5 + MSYS 1.0.11)

I ran the installer and installed to c:\work\tools\ruby19. Note this non-standard install path; it bites me in the ass later.

Downloading FOX source

I grabbed the latest stable FOX source tarball, 1.6.36, and extracted it to c:\work\tools\fox-1.6.36. I have to get FOX built before I can even think about the FXruby bindings. The challenge is I need to build it using the MinGW environment that’s part of the Ruby DevKit I downloaded. I’ve never used MinGW, so this should be interesting.

Running Build Environment

Unless otherwise specified, all the subsequent commands are run from the Ruby build environment, which can be accessed by the ‘Start Command Prompt With Ruby’ shortcut.

Building FOX Dependencies

I put all the dependencies for FOX in C:\work\sourcecode.  I’ll build them one by one

zlib

sh configure --prefix=c:/work/tools/zlib-1.2.3
make
make install

jpeg

mkdir c:\work\tools\jpeg-6b\bin
mkdir c:\work\tools\jpeg-6b\man\man1
mkdir c:\work\tools\jpeg-6b\include
mkdir c:\work\tools\jpeg-6b\lib
sh configure --prefix=c:/work/tools/jpeg-6b --enable-shared --enable-static
make
make install (this fails with an error trying to install the library)
copy libjpeg.a c:\work\tools\jpeg-6b\lib\libjpeg.a

libpng

set CPPFLAGS=-Ic:/work/tools/zlib-1.2.3/include
set LDFLAGS=-Lc:/work/tools/zlib-1.2.3/lib
sh configure --prefix=c:/work/tools/libpng-1.2.16
make
make install

tiff

sh configure --prefix=c:/work/tools/tiff-3.8.2 --with-zlib-include-dir=c:/work/tools/zlib-1.2.3/include --with-zlib-lib-dir=c:/work/tools/zlib-1.2.3/lib --with-jpeg-include-dir=c:/work/tools/jpeg-6b/include --with-jpeg-lib-dir=c:/work/tools/jpeg-6b/lib
make
make install

Building FOX 1.6 itself

Brace yourself.  The FOX build is REALLY SLOW.  As in, start it at night and check on it in the morning slow.


set "CPPFLAGS=-Ic:/work/tools/jpeg-6b/include -Ic:/work/tools/libpng-1.2.16/include -Ic:/work/tools/tiff-3.8.2/include -Ic:/work/tools/zlib-1.2.3/include"
set "LDFLAGS=-Lc:/work/tools/jpeg-6b/lib -Lc:/work/tools/libpng-1.2.16/lib -Lc:/work/tools/tiff-3.8.2/lib -Lc:/work/tools/zlib-1.2.3/lib"
sh configure --enable-jpeg --enable-png --enable-tiff --enable-zlib
make
make install prefix=c:/work/tools/fox-1.6.36

Preparing FXRuby gem

Of course, there is no binary gem for FXRuby compiled for MinGW, so you must build it from source.  Unfortunately, the source gem as of this writing is not compatible with MinGW.  If you try to install it, you’ll get this:


In file included from c:/work/Tools/ruby19/include/ruby-1.9.1/ruby/missing.h:22,
from c:/work/Tools/ruby19/include/ruby-1.9.1/ruby/ruby.h:1125,
from c:/work/Tools/ruby19/include/ruby-1.9.1/ruby.h:32,
from librb.c:355:
c:/work/Tools/ruby19/devkit/gcc/3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/time.h:27: error: redefinition of `struct timezone'
c:/work/Tools/ruby19/devkit/gcc/3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/time.h:40: error: conflicting types for 'gettimeofday'
c:/work/Tools/ruby19/include/ruby-1.9.1/ruby/win32.h:248: error: previous declaration of 'gettimeofday' was here
c:/work/Tools/ruby19/devkit/gcc/3.4.5/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/time.h:40: error: conflicting types for 'gettimeofday'
c:/work/Tools/ruby19/include/ruby-1.9.1/ruby/win32.h:248: error: previous declaration of 'gettimeofday' was here
make: *** [librb.o] Error 1

Fortunately, it’s very easy to patch.

First, download the FXRuby 1.6.19 source tarball (NOT source gem; as noted it won’t work).  I extracted it toc:\work\sourcecode\fxruby-1.6.19.

In that directory, edit the ext/fox16/extconf.rb file.  Find the do_cygwin_setup method (around line 80).  Find this line:

have_header("sys/time.h")

And comment it out, so it looks like this:

#have_header("sys/time.h")

Then find the line:

dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib')

and under it add the following:

# Need to add this so it can find dependent libs under Windows
dir_config('zlib')
dir_config('tiff')
dir_config('jpeg')
dir_config('png')

Next, edit the FXRuby.cpp file in the same directory. Find the line:

extern "C" void Init_fox16(void) {

and change it to:

extern "C" void __declspec(dllexport) Init_fox16(void) {

Then build the source gem from the fxruby-1.6.19 directory:

rake build_src_gem

This will create fxruby-1.6.19.gem. Install it now:


gem install fxruby-1.6.19.gem -- --with-fox-include=c:/work/tools/fox-1.6.36/include/fox-1.6 --with-fox-lib=c:/work/tools/fox-1.6.36/lib --with-zlib-include=c:/work/tools/zlib-1.2.3/include --with-zlib-lib=c:/work/tools/zlib-1.2.3/lib --with-tiff-include=c:/work/tools/tiff-3.8.2/include --with-tiff-lib=c:/work/tools/tiff-3.8.2/lib --with-png-include=c:/work/tools/libpng-1.2.16/include --with-png-lib=c:/work/tools/libpng-1.2.16/lib --with-jpeg-include=c:/work/tools/jpeg-6b/include --with-jpeg-lib=c:/work/tools/jpeg-6b/lib

The gem doesn’t copy the dependent files into the right place, so you have to do that yourself:

copy c:\work\tools\libpng-1.2.16\bin\libpng-3.dll c:\work\Tools\ruby19\bin
copy c:\work\tools\tiff-3.8.2\bin\libtiff-3.dll c:\work\Tools\ruby19\bin

Once the gem is installed, run one of the samples to make sure it worked:

ruby examples/hello.rb

If you’re lucky and the planets are in alignment, you’ll get a little window with “Hello World” in it. Yay.

10Aug/090

2-gun and IDPA results

The results are finally up for the July 2-gun and August IDPA matches.

My first 2-gun match went well. I placed 4th overall (there were no divisions or classes; this was an outlaw IDPA-style match), behind some really good shooters. I was happy.

The IDPA match was the first time I ran my STI Ranger II, and it showed. I wasn’t as controlled with followup shots, and I was slow on reloads. I just need more practice, though; it’s a great gun. I took 1st place in my class (Unclassified) and division (ESP), out of a handful of shooters. Looking at times across divisions (which officially IDPA doesn’t do) I see 7 out of nearly 50 shooters who shot faster times than me. I could’ve done better, but I was down alot of points due to aforementioned lack of practice with the new gun.

2-gun results: 22 July 2009 SEG 2-gun match results. IDPA results: 5 August 2009 SEG IDPA match results.

Tagged as: , No Comments
9Aug/090

July 2-gun and August IDPA shoot videos

I’ve started shooting video of myself shooting (that sounds awkward), to help me review my performance and identify areas for improvement (basically all of them at this point).  I’ve uploaded them to Flickr.

22 July 2009 2-gun match

Stage 1. I didn’t shoot this very well. It was the first stage I ever shot in rifle competition, and as usual I rushed it:

Stage 2. I did a bit better on this one I think.

Stage 3. I shot this fast and I cleaned it (down 0). No one was more surprised than me:

Stage 4. I could’ve hustled a bit more, and towards the end I hesitated while deciding to take additional shots, which hurt my time:

Here’s a still I captured, which I think I’ll use for a profile pic:
MVI_2482

5-August IDPA match

Stage 1. I ran this one pretty fast, but accuracy was marginal. I need to slow down:

Stage 2. This one was pretty good:

Stage 3. This stage was really fun:

Stage 4. El Presidente. I balls this stage up bad. I was in such a rush, I forgot to put the second round in the second target, so I had to go back. S-L-O-W DOWN!

Tagged as: No Comments

Delicious Bookmarks

Recent Posts

Meta

Current Location