The random rantings of a concerned programmer.

How To Survive In a Horror Flick

May 06th, 2009 | Category: Random

Or, what protagonists do wrong.

Seriously. Every fucking horror flick I watch pisses me off to no goddamn end. The protagonists are fucking stupid, with very few exceptions. There’s three fucking things that the writers always seem to fucking ignore (either because it would break the fucking plot or because they’re too fucking stupid, I don’t know).

1. EVERYTHING IS A WEAPON

Fucking seriously. Got something long and rigid? It’s a weapon. Got a mirror? It’s a weapon. Got a piece of furniture? It’s a weapon. Fuck got your little sister? She’s a fucking weapon too (though that lamp or that glassware or that beer bottle or HALF THE FUCKING THINGS IN THE ROOM WORK BETTER THAN WHATEVER THE PROTAGONIST IS WIELDING).

2. WHEN IN DOUBT SET SHIT ON FIRE

There’s nothing like A FUCKING INFERNO to confuse the fuck out of your predators. Trapped in a hotel room? FUCKING SET THE ROOM ON FIRE. Being chased around in a forest? FUCKING SET THE FOREST ON FIRE. Fucking everything is flammable; there’s no reason you can’t stop fucking crying and start fucking burning.

As an added bonus, it’ll attract the police.

3. IT’S EASY AS FUCK TO HIDE AT NIGHT

Unless the predator has bloodhounds, the nose of a bloodhound or fucking thermographic vision (ie, he’s pretty much JUST A NORMAL PERSON) he CAN’T SEE SHIT AT NIGHT. It’s FUCKING DARK OUT AFTER ALL. Need to hide somewhere at night? Just jump into a fucking bush. The bigger and leafier the better. I fucking guarantee you that if there are enough fucking bushes (and you’re not doing stupid shit like making farting noises or bawing your eyes out) no one is going to fucking find you until morning.

CONCLUSION

WHO THE FUCK WRITES THIS SHIT.

11 comments

(Untitled)

March 19th, 2009 | Category: Random

IT’S BEEN AWHILE SINCE MY LAST EMO POST SO I FIGURE IT’S ABOUT THAT TIME.

I’M SO FUCKING DRUNK JESUS CHRIST I FUCKING HATE THIS SHIT. WORK ALL DAY EARN LOTS OF MONEY COME HOME SIT AROUND DO RANDOM SHIT GO TO BED THEN GO TO WORK THE NEXT DAY. WHAT THE FUCK IS THE POINT OF THIS SHIT.

Fuck I know I’ve tooted this pipe before. I fucking hate this bullshit life thing, but I’m too cowardly to fucking off myself. Writing fucking code is the only goddamn thing I do remotely well (and I’m shit at it) and I fucking hate doing it. I fucking hate computers. I fucking hate how I subvert myself into a microcosm containing myself and a small 17″ screen.

And yet I obviously don’t fucking hate it since I don’t make any motions to get myself out of the grave I’ve fucking dug for myself. And I can’t honestly think of anything I’d rather be doing — everything is fucking mundane and boring. Maybe I should just join the army and volunteer to go to a war zone so I can just start killing people, then get shot and fucking end this pitiful pathetic existence.

UGH.

9 comments

Automatic, Jailed Package Building

February 20th, 2009 | Category: Random

WordPress 2.7 can bite my fucking ass. STOP FUCKING EATING MY POSTS YOU REEKING PILE OF SHIT!

Anyway. I’ve ranted a lot about using jails as a means of isolating potentially vulnerable services from compromising one another, but there’s a lot more you can do with jails. I’m working on a system right now which provides disposable on-demand development environments: when a developer wants to do some work, they just instantiate a clean mirror of our production system, hammer away, then commit changes and throw away the environment.

One part of this system is maintaining all of the software between both the production environment and the jail instances in which the devel stuff runs — a perfect application for packages. For purposes of easy management, I just want to have a text file with a list of ports, ie

editors/vim
lang/python
www/apache22

Then have a script go through that and build all the appropriate packages which then get picked up and installed automatically when a jail is instantiated (via ezjail, of course). Once you’ve got all of the packages, you can just serve them out over HTTP (by setting PACKAGE_SITE) or dump them into an ezjail flavor.

As much as I love ezjail, it didn’t exactly make this easy. The first catch is that you can’t actually build a package within an ezjail-instantiated jail because of the games it plays with the ports system (ie, the ports makefiles want to write the package tarball to /usr/ports, which is mounted as read-only). I kind of wanted the packages to be written outside of the jail anyway, since I just want to delete the jail when everything’s finished. Just the place for some mountpoint games –

# Change ezjail's symlink to a mountable directory
rm $BUILD_JAIL_PATH/usr/ports
mkdir $BUILD_JAIL_PATH/usr/ports

mount -t nullfs $JAIL_PATH/basejail/usr/ports $BUILD_JAIL_PATH/usr/ports
mount -t unionfs $PACKAGE_DIR_PATH $BUILD_DIR_PATH/usr/ports

The other nasty bit is actually building the packages within a jail from within an unjailed script. All it should take is a couple of for loops to configure and then package everything –

for PORT in $PACKAGE_LIST ; do
    cd /usr/ports/$PORT 
    make config-recursive
done

for PORT in $PACKAGE_LIST ; do
    cd /usr/ports/$PORT 
    make BATCH=yes package-recursive clean
done

Unfortunately, the ezjail-admin console command uses execvf to spawn a jailed process rather than sh -c (which is probably the way the jail command it uses internally does it), so you have to explicitly pass it the sh -c stuff, followed by the argument.

And I couldn’t figure out how the fuck to quote the nice big chunk of code properly, so I took a slightly different route — just cat it all into a file within the jail, then execute that script directly with ezjail-admin console. It’s retarded, but it works.

[source]

6 comments

(Untitled)

February 12th, 2009 | Category: Random

Oh man Katsucon is tomorrow — going to be a royal shitfest.

Anyway so I’m rewriting one of our websites in PHP (with Drupal). PHP is a pile of shit, but honestly if I were to write the thing in Haskell no one would be able to maintain it. And PHP is a big step up from what it’s currently written in — ColdFusion.

I had written a couple of little widgets in ColdFusion to pull feeds from a couple databases for shit, and I wanted to port those over to my Drupal installation. So I poke around in the ColdFusion code looking for it, and wtf my code isn’t there — it’s just static HTML once again (in the past, the “feeds” have always been updated by hand). A quick look in the svn log –

————————————————————————
r3717 | Coworker_A | 2009-01-29 10:42:50 -0500 (Thu, 29 Jan 2009) | 1 line

manually updating “Classes” section; Taro’s dynamic piece is not ready–Coworker_B needs to do a ColdFusion piece to go with it
————————————————————————
r3716 | Taro | 2009-01-29 10:30:27 -0500 (Thu, 29 Jan 2009) | 2 lines

Changed upcoming classes on the index page to dynamically pull the first three upcoming events from the database and display them on the page.

The “ColdFusion piece to go with it” wasn’t so much a piece as it was “please refactor I suck at ColdFusion”. The thing worked perfectly fine, and he just bloody wiped it out and replaced it with static HTML (the exact same HTML that the widget generated). So now I’m sitting around waiting for the checkout of revision 3716 to complete because I was too lazy to look up how to pull a single file from the repo to reference the code.

RAAAAAAGGGGGEEEEE

Comments are off for this post