The random rantings of a concerned programmer.

Archive for March, 2009


March 30th, 2009 | Category: Random

So, I’ve been working on my Haskell Web Framework shit (oh god). My current project is rewriting the abortion of a codebase, LulzBB, in Haskell. LulzBB is a PhpBB clone written in PHP. It was born after I got so sick and tired of maintaining shittons of modifications to the PhpBB codebase (which is an even bigger failed abortion, if that’s possible).

One of the “FUCK THAT WAS A TERRIBLE IDEA”s in the original version of LulzBB was keeping the same ill-conceived database schema as PhpBB. Instead, I’m going to use one that isn’t absolute shit (and going to use PostGRES instead of MySQL, though that’s more of a deployment difference since HDBC is awesome).

Anyway it’s still a shitty web forum and it’s gonna have the same shitty features as every other fucking forum software except it’ll be in Haskell and isn’t that great. Also I’m toying around with git, so if you want to see how shitty my code actually is (spoiler: it’s really shitty) you can visually molest your eyes at github.



March 29th, 2009 | Category: Random

Those drives came in and I installed them (and the motherboard and shit scavenged from another machine) in the case. I then came to the realization that, fuck, I have neither a FreeBSD boot ISO nor a blank CD.

But that’s okay, because FreeBSD can be installed over a network. It took a solid 5 hours to buildworld on my shitty laptop, but I got everything set up and ready to go. And then I noticed that the ATX board I installed into the 2U case doesn’t have onboard video, so I can’t hook a monitor up to the machine.

But that’s okay, because riser cards were invented for a reason. I go over to my shelf and dig around for a riser card, but all I can find are really old ISA cards. Then I remembered that I had bought a PCI riser card for an older file server which is now under my bed. So I pull it out, and sure enough the IDE controller is still plugged into a riser card. And then I noticed that the riser card is a right-hand and I need a left-hand card.

But that’s okay, because serial consoles were invented for a reason. And then I noticed that my laptop doesn’t have a serial port, that I have no DB9F-DB9F connectors, and ordering a USB-to-serial adapter and the adapter is going to cost like $25 (with shipping) and 3 days to arrive.

I think I’ll just order that riser card instead.


Serving Packages Locally

March 27th, 2009 | Category: Random

I’m setting up a virtualized development environment for webdev stuff, so that we can easily instantiate our web stuff for each developer. There are some fun DNS tricks to provide a nice interface to it, but I’ll get around to talking about those in a later post (since I haven’t built and configured Lighttpd 1.5, which I’m going to use to proxy requests). A more pressing and basic issue is package management on the jail instances.

Jails will probably be created on-demand — someone will want to do something, so they’ll click a button and boom! a jail is created and it has SSH running and all the software they need installed. Naturally, this means that building ports is not an option — everything will have to be installed via packages. Even then, fetching packages is really slow (and sometimes they’re not available). There are some other catches (“We need version X of this package because that’s what’s in production”). One solution for both is to build the packages locally, in a jail.

The next trick is getting them to serve properly. I added an extra line into that build script –

find ${PACKAGE_DIR_PATH} -name '*.tbz' | xargs -I '{}' -n 1 cp '{}' ${PACKAGE_SERVE_PATH}

And have a jailed Lighttpd instance running in the bot-packages jail, serving /usr/local/www as the document root.

There’s a bitch of a catch here — you must put all your package tarballs in a directory named ‘All’. The pkg_install code is horrendous — when it processes the package dependencies, it takes the URL of the parent packages, lops off the filename and directory, then appends “All/” and the dependent package name. The logic is inconsistent with that of the behavior of pkg_add, so shit breaks.

You can fix this behavior with a patch I whipped up (but it’s easier to just work around the hacky system) –

--- usr.sbin/pkg_install/lib/url.c.orig 2009-03-26 19:56:12. +0000
+++ usr.sbin/pkg_install/lib/url.c      2009-03-26 20:41:44. +0000
@@ -57,7 +57,21 @@
        * to construct a composite one out of that and the basename we were
        * handed as a dependency.
-       if (base) {
+       if (getenv("PACKAGESITE")) {
+               if (strlcpy(fname, getenv("PACKAGESITE"), sizeof(fname))
+                       >= sizeof(fname)) {
+                       return NULL;
+               }
+               if (strlcat(fname, spec, sizeof(fname))
+                       >= sizeof(fname)) {
+                       return NULL;
+               }
+               if (strlcat(fname, ".tbz", sizeof(fname))
+                       >= sizeof(fname)) {
+                       return NULL;
+               }
+       }
+       else if (base) {
           strcpy(fname, base);
            * Advance back two slashes to get to the root of the package

Anyway, once you’ve either got that patch applied to your base source (ugh) or have all your package tarballs served from a directory named “All/”, you can easily install them in the jails by setting the PACKAGESITE environment variable to the base URI of the package directory before running pkg_add -r -

root@test> setenv PACKAGESITE
root@test> pkg_add -r lighttpd-1.4.22
Fetching Done.
Fetching Done.

You can probably integrate this into ezjail’s flavor system, but I have to write an interface to manage the jail instances anyway, so I’ll probably just hack the package installation process into that.

Someone needs to rewrite pkg_install. The code is PIG DISGUSTING!

Comments are off for this post


March 25th, 2009 | Category: Random


So I’m sitting at my desk this morning setting up ezjail on a machine that I just wiped Fedora Core off of when one of my semi/non-technical colleagues comes up behind me with a question: “what happened to the uploaded blog files?”

After some digging around, I finally figured out that when we switched from over 9000 unmaintained WordPress instances to a single centralized multi-user WordPress instance I had kept all of the old uploads in the same place (so no links broke) while letting MUWP put all the new uploads in separate directories for each blog. So I whipped him up a directory with a bunch of symlinks pointing to all the data so he could see all of it.

His next question was “where is all the text data”. I just kind of stared at him for a minute, trying to figure out what the fuck he’s trying to do. After a barrage of questions, I finally get out of him that he’s trying to get the excerpts of the most recent posts to put a newsletter together or some shit like that. I decide “FUCK IT I’M JUST WAITING FOR NAGIOS TO FUCKING COMPILE ANYWAY”, grab the HTML template off him and write a quick Python script to generate the gross HTML newsletter.

I talk to him later about it “hey you got my email you’re all set now right?” and he can’t fucking figure out what to do with it. He can’t figure out what the fuck he’s supposed to do at all. Seriously, it pissed me off so much — I don’t know what the fuck he’s supposed to be doing, and he comes to me like I can somehow magically make his mysterious work come together when he can’t even explain what the high-level tasks are.

From my discernment, they’re simply

  1. Make all the recent posts publically visible (ie, click some buttons on the web form).
  2. Mail the email I generated to a mailing list.

I asked him if that’s what needed to be done and he was like “I don’t know.”

This guy’s worked here for fucking like 25 years and doesn’t have a fucking clue. SERIOUSLY I CAN’T DO YOUR FUCKING JOB FOR YOU IF YOU CAN’T EVEN EXPLAIN TO ME WHAT YOUR GODDAMN JOB IS MOTHERFUCK.

As an unrelated aside, this is some expert-level trolling. It almost got me.

1 comment


March 25th, 2009 | Category: Random

oh god I have no money and I just ordered 4 1TB WD drives (and put the $400 bill on my credit card). Going to throw them in the case I bought over a year ago with an E7200, then run vinum + geli on them (with UFS, I think — I still don’t trust the ENTERPRISE-QUALITY ZFS). (Noting quietly that an improved version of vinum with RAID5 support is going into CURRENT soon).

According to my pay schedule, I should be back in the black on the 31st.

I was lying shit-faced in bed last night and realized, hey, I don’t ever have much fun with money. I’m a fucking tightwad. And I’m a tech guy — I should have all kinds of crazy tech bullshit lying around (instead of just a beaten-up Dell laptop from 2004). I figure a beefy fileserver is probably a good start.

Now I just need to download 3TB of pornography.


Next Page »