The random rantings of a concerned programmer.

(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

JQuery and GreaseMoneky

January 10th, 2009 | Category: Random

I’m writing a tiny GreaseMonkey script for something, and I’m not going to lie — I fucking hate JavaScript. If I can’t use JQuery (which makes DOM manipulations somewhat reasonable), I’ll just fucking give up. Naturally, this means that, to effectively use GreaseMoneky, I need to load in JQuery.

And naturally, this means that there are only stupid bullshit ways to do that. Injecting a script element into the DOM is stupid. Embedding the entire JQuery library in your GreaseMoneky script is stupid. We want to fetch the fucking script and fucking run it:

GM_xmlhttpRequest({
    'method' : 'GET',
    'url' : 'http://code.jquery.com/jquery-latest.js',
    'onload' : function(jq) {
        eval(jq.responseText);

        /* ...JQuery shit here... */
    }
});

Now was that so bloody hard?

Also one of my housemates got me a couple fake cigarettes as a late Christmas gift. They’re effectively just pieces of cardboard and some painted copper (which reflects the light in such a way that it looks like it’s glowing) but they’re surprisingly realistic. I think I might start taking “smoke” breaks at my new job and see how long it takes them to notice that these aren’t actually cigarettes.

EDIT: WHEN THE FUCK DID I TURN INTO A FUCKING WEB DEVELOPER.

3 comments

(Untitled)

January 12th, 2008 | Category: Random

Bah, turns out that the replacement PSU isn’t scheduled to arrive until next Friday, which means another week until I can assemble my new machine and ensure that everything runs in the final configuration. Kind of frustrating, but I’m really excited that all the parts are (at least) bought and paid for, if still in the mail.

Again, the goal is to be able to run several (at least 3) instances of a virtual machine to simulate a networked environment for distributed computing stuff. I’m not sure I actually have enough RAM to do it very well (I got 2GB to start with, probably going to end up ordering another 4GB in the coming weeks), but since I’m going to be running naked FreeBSD installs, I don’t think it’ll be too big of a deal.

So, I was thinking on some random tangent about registering for classes. At UVA, we have a registration system called ISIS, which is nasty and prone to crashing. It hasn’t been as bad this year as it has been in the past, but that may be partly because I never try to enroll in courses until a month or two after the system opens.

Anyway. I was thinking about how you’d go about improving such a system. It isn’t necessarily a poorly-designed system, it just gets hammered with immense loads when it opens up, and just doesn’t tend to cope well. These loads consist of hundreds to thousands of students all slamming the site at once, essentially acting as a DDoS attack. To design a better system, you’d have to be able to replicate the production environment, which means simulating a couple thousand people enrolling in courses.

Therein lies the problem: how do you simulate such a thing in a manner loyal to the real environment? They keep most of the specs of the ISIS system kind of secretive, so I can’t say for sure which parts are causing the bottlenecking problems; but I think it’s safe to say that an unfaithful simulation will probably produce invalid results. And a faithful simulation would require somewhere around 50-100 machines scattered around the network, each representing 10-50 students. The way I figure it, this makes sense: the way the network is structured 1 machine can easily represent 10 students, since each of the 10 students’ connections are being routed through the same switches because they’ll all be living in dorms, or other similarly-networked areas.

Another problem results from this: how do you control that many machines? Sure, you can write a series of scripts and send a command to each machine to execute it, but this doesn’t provide much granularity. Another method would be to write a client-server infrastructure which allows you to control each machine’s requests from a central node, but this is somewhat heavyweight and timeconsuming.

One solution I’ve found is to use something like Omnitty, which is a SSH multiplexer. And for the context of the above problem, it’d probably be more than enough (actually, just handing a script to each machine would probably be enough…), but I have a feeling Omnitty sacrifices a lot of control when working with a large quantity of machines (50-100), since it seems to behave like a tabbed client with extra features.

tl;dr, I kind of want to make a meta-shell for interacting with large quantities of machines over a wide area. The meta-shell would have something like the following features:

  • Automatic Redundant Command Hierarchy Structuring: lol that spells out “ARCHS”, completely unintentional. The idea is that you need to send commands out to a wide area of machines across potentially unstable network links and other unknown network hassles, and that you should simply start up a daemon on each machine and it’ll automatically find peers on the network and build up a command structure.

    The other reason to use a tree-like hierarchy is that it eases the end-user in accessing the state of the network, since it provides some meaningful ordering to the children machines.

  • Query-based Execution Model: You’re going to be operating with a large volume of machines, so you’ll need some method of interacting with them all in a logical manner. Each machine should maintain some notion of it’s state to allow the end-user to send a conditional command which is only responded to by machines matching the criteria.

    This is useful, I think, for two things: first, because you’re going to be dealing with a heterogeneous body of hardware. You can’t make any assumptions about what you’re actually dealing with; you wouldn’t want to have a cluster of machines start fetching a webpage if some of them don’t even have internet access. Some machines may not have a hard drive, or might be slow as fuck.

    The other reason you might conditionally select machines is based on their location within the hierarchy. Maybe you only want to assign a task to one branch, or to the non-leaf nodes in the tree.

    In any case, I think a query-based model would be useful for both fetching information about the network, and sending commands to it, simply because you’re essentially working with a large dataset.

  • Public Key-Based Authentication and Encryption: This is pretty straightforward: you don’t want people using your nodes for their own tasks. Each node when started should have the public key of the master node, and only respond to commands encrypted with the master’s private key. Any sensitive information returned should be encrypted with the master’s public key. And other random things like sequence numbers within communications to prevent replay attacks, etc. Might be too much overhead and just degenerate into a shared-key based authentication system though, if I ever bother to write this software.

Anyway, tl;dr something that I’ll probably never get around to even bothering to write, lawds.

No comments