Category: perl

  • Power blip in Tukwila – everything’s okay.

    There’s been a lot of weather here in Seattle this week. It looks like the Tukwila DC’s power blipped this morning. It gave me an excuse to update some configs on a few of the OpenVPN endpoints, re-configure some of the shorewall6 stuff, and enter a bunch of hosts and IPs into the BIG-IP’s node list. It gives me a quick way to know what needs fixing first when things start breaking and is a lot easier to configure than NAGIOS. If I really wanted to get fancy, I could even write me some hot external monitoring scripts in perl. I am growing fond of this machine.

  • Migrating VMs from pure paravirt hypervisor to hvm-capable hypervisor

    I’m also changing all of my disk layouts from being block devices per each guest partition to one block device hypervisor side per each /dev/xvd* guest side. The block devices all live on a single storage server and are being served via iSCSI. One of the guests is making use of AoE, but I’m thinking I’m going to move it to iSCSI, too, so there’s one less dæmon I need to maintain.

    It’s currently xen on squeeze. I want to experiment with kvm. I will miss xen-create-image, though.

    Okay. Zelda wants to watch a movie, so I’m going to stop blathering now.

    Moo,

    C.J.

  • The Very Model of a Poster to CLPM

    So, in 2002 I attended my first SPUG meeting. Also in attendance were Randal, Tim, J.P. (I think) and quite a few of the other usual suspects. The guest speaker was the inestimable Dr. Damian Conway. This night might be the single most important event in my career as a builder of the internets. I was already set in my ways regarding my operating system, and I knew enough perl to get by, but I wasn’t in touch with any users groups until then.

    The crown jewel of the night was Damian’s recital in full of his poem, “I Am The Very Model of A Poster To CLPM” (sung to the tune of that song from Pirates of Penzance). I must admit that I’d never heard of CLPM and that it all sounded like gobble-de-gook at the time. If I recall correctly, this happened just after he took about 10 minutes to teach us all to pronounce the name of then-Pumpking, Jarkko Hietaniemi. This was the same year that the following video was made…

    With that in mind, there’s one more thing I need to share with you before disclosing the lyrics. This piece was developed during a time when it was common for members of the perl community to flame one another on news feeds, take their anger and frustration out on newbies and generally be the bane of most of the internet. I like to think that it helped to shape me into a kinder, gentler perl programmer, debian user and general netizen over the years. I would also like to think that it will do the same for future members of our communities.

    And so, without further ado, Damian Conway’s


    I Am The Very Model of a Poster to CLPM

    Now everything I need to know about the Perl community
    I learned in kindergarten when I was a little lad of three
    And in these next few minutes I’ll relate those five apothegm
    For I am the very model of a poster to c.l.p.m.

    The first truism I was ever taught upon my mother’s knee
    Was that our dad’s a better dad than their’s could ever hope to be.
    His name is Larry Wall, and that’s determinism nom’native
    Since of the mural attributes he demonstrates proof positive.

    He’s eight feet tall and ten feet wide; of granite-like solidity.
    He wards us from the serpent’s tabs and coffee bean’s stupidity.
    He guards us from that Gallic tower’s B&D urbanity,
    And makes sure we don’t see sharp code that might cut loose our sanity.

    He watches over each of us, like Odin of the Norse belief —
    The stern All-Father figure and, at times, the comical relief.
    So, if you vaunt our patriarch’s supreme linguistic acumen,
    You are a model sychophantic poster to c.l.p.m.

    The second tenet that I learned concerns, of course, the fairer sex
    And why they are in short supply, while geek-boy JAPHs are multiplex.
    As every schoolboy knows each conversation has single aim:
    To raise one’s own significance, whilst razing others down in flame.

    And thus good men and true who hold this principle as sacrosanct
    Will all pursue beligerence as though they were from Mars. Or tanked.
    It is the tenor of your newgroup posts that she from Venus flies:
    Because most threads devolve into comparisons of…..meanness, guys.

    When every post affronts their own collaborative sorority
    It must exasperate them, for it renders the majority
    Of female Perl geeks absent, till we’re forced to rename blonde Dutch men
    To act as female models of a poster to c.l.p.m.

    The third grand aphorism that was drummed into my youthful head
    Was: if you can’t say something nice about someone, you should instead
    Say every nasty thing you can impart, imagine, or invent
    In any public forum that it happens you should both frequent.

    This goes especially for the young, and new, and shy, and innocent.
    To flame a newbie is a joy, t’will make you feel omnipotent.
    To watch them squirm and bleat and bleed and scurry back into their hole,
    The surge of ecstasy it brings is worth the way it eats your soul.

    So never hesitate to turn the wrath of your vocabul’ry
    Upon the hapless supplicant for Perl epistomology
    And if you flame each FAQ, and every question that’s beneath you then
    You’ll be the very model of curmudg’nly R.T.F.M.

    The next point I should like to make’s the obverse of the previous
    For while it’s true that to be newbie is a sin most grieveous
    It ain’t as bad as being old and greyed and staid and tedious
    And sitting at the keys all day dispensing thoughts invidious.

    What right have you to tell me not to ask about my CGI???
    I thought that Perl was all about website development, and I
    Expect that you’d extend to me the simple human courtesy
    Of dropping everything so you can do this homework now for me.

    The Internet exists so I need never read the manual
    And so my inane questioning can form a stream continual
    While pleading for an email since I never read this group, as well
    As posting them in jeopardy, in caps, and in HTML.

    The rule I learned in kinder that explains where this approach springs from
    Is fundamental to a certain class of Gen-X hackerdom
    The single principle that guides their Internet activity
    Is: “me, me, me, me, me, me, me, me, me, me, me, me, me, me, ME!”

    So if you are prepared to treat the Net as your god-given right
    And suck the newsgroups dry like some goodwill-devouring parasite
    And use them as a help-desk and a perldoc substitute, well then
    You are the very model clueless poster to c.l.p.m.

    The final precept that my pre-school inculcated in my head
    Is one I would commend as antithetical to all I’ve said.
    It is a noble concept that once used to garner more elan
    The idea that, when I grow up…..I want to be a fireman.

    The fire-fighter’s job’s to help, despite the inconvenience
    And spare the inexperienced the cost of their own ignorance
    And put out fires when the flames ignite the common living space
    And through it all maintain an air of competence and skill and grace.

    And this, my friends, I recommend to all of our community
    That rather than a careless match or carefully lit incendiary
    You spray out knowledge, patience, and a gentle stream of good advice
    And save the newbies from themselves, and oldies from their prejudice.

    And be yea more as Larry is, a fire-Wall against the threat
    Of ignorance and arrogance, with both of which we’re still beset.
    For if you choose to help your fellow JAPHs instead of scorching them,
    You’ll be the next burnt offering we spit-roast on c.l.p.m. ;-)

    [edit]

  • Perl interface to processing / querying NIST’s NVD feed

    For a work project, I wrote a library in perl that can be used to query the NVD feed that NIST publishes here:

    http://nvd.nist.gov/download.cfm

    Here’s a snippit from the perldoc:

    use NIST::NVD::Query;
     
    # use convert_nvdcve to generate these files from the XML dumps at
    # http://nvd.nist.gov/download.cfm
     
    my( $path_to_db, $path_to_idx_cpe ) = @ARGV;
     
    my $q = NIST::NVD::Query->new( database => $path_to_db,
                                   idx_cpe  => $path_to_idx_cpe,
                                  );
     
    # Given a Common Platform Enumeration urn, returns a list of known
    # CVE IDs
     
    my $cve_id_list = $q->cve_for_cpe( cpe => 'cpe:/a:zaal:tgt:1.0.6' );
     
    my @entry;
     
    foreach my $cve_id ( @$cve_id_list ){
     
      # Given a CVE ID, returns a CVE entry
     
      my $entry = $q->cve( cve_id => $cve_id );
      push( @entry, $entry );
     
      print $entry->{'vuln:summary'};
    }
    
  • GSoC 2010

    Earlier this month, I applied to the Mono Project (and the University of Washington, and Ubuntu, and Debian, and The Perl Foundation) requesting a mentor to get Perl6 hosted on the DLR.

    Last Tuesday, Miguel contacted me and asked that I chat with Michael Hutchinson about possibly taking up a different project. It seems that the group did not have any mentors who felt comfortable mentoring the Perl6 project. After a bit of consideration, I agreed to modify my application and take up a project to revive the regular expression compiler from 2.2.

    Today, the project was officially accepted, and I met with my mentor for the first time (hi Rodrigo!).

    I will also be working with Matthew Wilson (aka @diakopter), since he has purportedly implemented a number of regex-to-IL compilers ;) He also offered to mentor me if The Perl Foundation had accepted my application, and since he has already implemented a perl6 compiler in javascript, I have been looking forward to poking some code with him.

    Although the GSoC doesn’t officially get started until 5/24, I’m making a git-svn checkout now. I’ve always committed the code directly to svn, but I’ve enjoyed working with git, and it seems about time to start contributing via git-svn. It will be easier to have local branches this way, too.

    Anyway, I’m looking forward to it ;)

  • John Hodgman is using software that I helped to write

    A recent blog post by The Hodg Man mentions that he uses (AND ENJOYS) a product I’ve helped to build. Yay.

    ***

    FULL DISCLOSURE NUMBER TWO

    FAITHFUL READERS OF THIS IMITATION BLOG know that, having crashed my own website repeatedly while linking to it Twitterphonically, I experimented with NEW INTERNET TECHNOLOGY to try to fix this problem.

    SPECIFICALLY, my host, LiquidWeb, called and offered their cloud computing solution STORM ON DEMAND. I think this means that instead of being stored on a single regular computer, my whole website is instead stored on dozens of semi-mechanical, murderous black clouds on various uncharted islands.

    Cloud Computing at Work

    THIS EXPERIMENT WAS SUCCESSFUL. So, in the spirit of full disclosure,

    I AM USING STORM ON DEMAND FOR A REDUCED PRICE, and unless it grabs me and pulls me in to the woods to murder me, I will continue to USE AND ENJOY IT.

    ***

  • I’ve disabled my user approve plugin

    Sorry for the inconvenience folks. I was annoyed by having to mark so many comments as spam, but the plugin interface was so klugy that I had no idea how to find the users who would contribute useful posts. So. Feel free to comment… Nao!

  • A quick update – I’m a grad student!

    Hey all!

    I’m sorry I haven’t been very active with my packages recently. I all-of-a-sudden started grad school and have been swamped with studying. I also started a contract and have been busy trying to learn a new codebase while contributing something other than snark.

    I promise I’ll get back to packaging IronRuby and IronPython on Mono for Debian as soon as things start settling down. Getting an A in the class is higher priority, though, sorry…

    Don’t worry. I haven’t forgotten about you ;)

    Cheers,

    C.J.

    PS, I am implementing a Perl library to exercise my understanding of the class. You can follow along at the search.cpan.org page for Lingua::HPSG or by cloning the git repo:

    $ git clone git://karma.colliertech.org/colliertech/langparser

  • Randal Schwartz interviews Michael Foord about IronPython

    The FLOSS Weekly folks (including my homie, Randal) just published this week’s interview. It is with Michael Foord, who I just met a couple weeks ago. He published a book about IronPython. He mentions Mono, the DLR and IronRuby, too ;)

  • Parsing English Language (if you consider IRC logs to qualify)

    Haha. I wrote this on October 3rd, 2006. I started logging IRC conversations in 2005. I’ve got lots from #perl and #mono. I wonder if the n’ere-do-wells who frequent those channels will mind me using their public commentary to build an english language parser. I’ll make it “open source,” of course. Erhm, I mean Free Software.

    So… I’ve been trying to parse english language (text) for a while. I haven’t quite done it yet. My new idea involves IRC bots. We have lots and lots of conversations happen in public IRC channels every day. The conversations usually involve transmission of ideas in textual format. These transmissions are quite often (but not always) understood by the receiving party. The transmissions are expected to have been intercepted by the general public, so having a bot intercept and attempt to interpret should not offend anybody :) It will anyway, of course, but we’ll pretend that this 0.00001% minority doesn’t mind being marginalized for the time being.

    So the idea is this: split the words on the standard word boundaries and do a dictionary lookup on each of them. Cache the results locally so a network hit isn’t incurred for each word we look up. The info we will take from the dictionary lookup is the “part of speech” that the word falls into. In the english language, this is not often a scalar value. Computers are getting fast, so I think that this shouldn’t be too much of a problem.

    So now we have a list of words and the parts of speech for each of these words. These words are assumed to combine in such a way that they form a coherent idea.

    At this point, we can create an XML document from these word elements, for instance:

    <sentence>
      <article>the</article>                                                                                                                             
      <noun plurality="plural">cats</noun>                                                                                                               
      <verb>are</verb>                                                                                                                                   
      <adjective>cute</adjective>                                                                                                                        
    </sentence>
    

    There would need to be an XSD or DTD against which to test this document in order to determine whether these parts of speech can be combined in this way to make a valid, gramatically correct, sentence.