Archive

Posts Tagged ‘news’

Not my work.

August 14th, 2009 No comments
IMMA FIRIN MY SPEECH

IMMA FIRIN MY SPEECH

Categories: news Tags: , , ,

Something’s been bugging me, re: Hammer.

July 17th, 2009 No comments

I will take Hammer at his word, and assume that he is in fact too legit to quit.  Given that one can be too legitimate to be able to quit, then it follows that at some level of legitimacy (not enough), one would be capable of quitting.  One would still be legitimate, but not legitimate enough to not quit.  However, being legitimate is a binary proposition.  From the dictionary:

le·git·i·mate

adj.

1. Being in compliance with the law; lawful: a legitimate business.

2. Being in accordance with established or accepted patterns and standards: legitimate advertising practices.

3. Based on logical reasoning; reasonable: a legitimate solution to the problem.

4. Authentic; genuine: a legitimate complaint.

5. Born of legally married parents: legitimate issue.

6. Of, relating to, or ruling by hereditary right: a legitimate monarch.

7. Of or relating to drama of high professional quality that excludes burlesque, vaudeville, and some forms of musical comedy: the legitimate theater.

All of the varying definitions and usages are “either/or.”  Something is legitimate in a certain way, or it is not.  Since there are not levels of legitimacy, by contradiction we can conclude that the central premise of being “too legit to quit” is necessarily false.

So what does that imply?  It cannot be said that Hammer would quit, since it cannot be proven (and in fact empirical evidence usually contradicts the proposition) that if one is not legitimate, one will quit.  And it follows that this does not imply any state of legitimacy on the part of Hammer since his quitting or refusal to do so cannot be tied to said legitimacy.  He has failed to make a convincing argument that the two are in any way related, and in doing so failed to tell us anything about his legitimacy or whether or not he will quit which, judging by the video, he desperately wants to convey.

At least with “Can’t Touch This” it was understood what “this” is (his ability to dance and rap) and what “touching” was (our ability to match his skill) and why we would not be able to do so.  The concept of “Hammertime” was a little vague but it can be assumed it was the time during which he would perform his dancing and rapping, and according to the song, a time during which we should cease other activities to watch lest we miss out.

Perhaps it was Hammer’s later inability to make a rational argument of his superiority that led to the decline of his musical career.  Communications skills are essential for any rapper.

Categories: news Tags: , ,

Wordpress permalink follow-up

May 5th, 2009 No comments

So regarding my previous post on generating pretty links with wordpress.  After reexamining the Apache way, and reading a bit more about how sun web server does rewriting and expressions, I finally figured out the “right” way to do it.

Behold the true form:

<If not -e"$path">
PathCheck fn="restart" uri="/index.php"
</If>

No wacky server.xml variables, no regular expressions, and no rewriting before we should.

First of all, I got rid of the expensive (?) ~= that matched everything after the first / in the uri.  In this case we don’t need it, because secondly, we always just want to redirect to /index.php.  Wordpress figures out the rest of the arguments from other magic variables that I don’t fully understand yet (probably PATH_INFO).  Thirdly, I changed it to a PathCheck fn=restart since at the PathCheck stage it is possible to determine if $path exists as a physical file.  We just restart the whole shebang with a new uri if it’s not.  And for cleanliness sake, fourthly, I switched from not -f and not -d to one simple not -e which accomplishes the same thing.

Hope this helps someone besides me.  I’m planning a follow up post describing some of the performance characteristics.  I’ve tried fastcgi vs the nsapi plugin with php and as a preview: the plugin is hella fast, but hella leaky as well, whereas the fastcgi is rock solid but can’t scale past the number of child processes I give it.  Also APC makes a HUGE difference, especially with the nsapi plugin.  Too bad about those leaks…

Rewritten Wordpress Pretty Permalinks under Sun/Open Webserver 7

April 26th, 2009 9 comments

aka, why bother?  but seriously folks…

Wordpress is blogging software.  This blog is powered by wordpress in fact.  It uses php and a database to construct web pages that then get served out.  One of the “features” it has is that it can use “pretty” links, or define permalinks such that the links will be the same for all time.  I won’t go into it in too much detail (see here) but what this means is, let’s say you write an article about your cat called “My cat is the super duper bestest stop making fun of him!”  The link to this individual post will look something like “http://mycatrules.com/?p=148″ or something else unintelligible.  But if you use the permalinks feature you can make it more sane and give the prospective reader a better idea of what the post is about.  Without rewriting, you can usually get as far as something like “http://mycatrules/index.php/my-cat-is-the-super-duper-bestest-stop-making-fun-of-him” which is okay, but that index.php leaves a lot to be desired.  What if you move your blog to something that isn’t running on php?  Plus it’s ugly.

So you need to change the url to get rid of the index.php, but that’s basically impossible to do within php (without including an index.php in a bunch of just-in-time created directories or something which would be a solution worse than the problem).  Fortunately web servers can help by rewriting the url internally.  If you were using apache, which is how 99.99999% of the wordpress setups in the world are doing this, you just need a .htaccess file that invokes the magic of mod_rewrite.  that .htaccess would look something like this, depending on just how pretty you wanted to make your links:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

What this does is basically convert your request for /archives/blah into a request for /index.php/archives/blah behind the scenes, where the /archives/blah parts are really arguments that get passed to index.php to be processed.  But only if /archives/blah doesn’t actually exist in the docroot as either a file or directory.  That way things like the actual html/images/css used by your theme, or the wp-admin interface, are served up as-is, but things that exist only in the weird world inside of the code for wordpress such as the concept of archives or tags, things for which there is no physical representation in the filesystem, are passed as arguments to index.php.

If however, you are running sun web server 7 (or now open web server?), it is slightly different.  The same idea applies but mod_rewrite doesn’t exist.  Instead there are “NameTrans” “SAFs” to handle rewriting/redirecting of urls based on criteria.  A full explanation of how this all works is beyond the scope of this post.  I’m not here to flame about which is better, mod_rewrite is certainly more popular, but from what I’ve read the sun web server can do it all and more and faster.  What I’m trying to do here is the simplest possible rewrite though, and they are both more than up to the task.  Plus if I was doing it with apache, this wouldn’t be much of a post since the work is already done and the howto can be found in 8 million places.

So what we want is, simply enough, the “rewrite” function.  So firstly let’s try the simple base case and see what happens.  In our virtual server’s obj.conf, define a rule that will map requests for /* to /index.php/* behind the scenes:

<If $uri =~ "^/(.*)">
NameTrans fn="rewrite" path="/index.php/$1"
</If>

Or in english “hey, if the request from the client matches the regular expression ^/(.*) (and all will), stick an /index.php in front of whatever (.*) matches (which is everything after the first slash).”  The uri and path variables are as defined here.  And this works!  Well, sort of.  Basically everything gets translated into /index.php/blah.  This prevents the theme from loading since that is componsed of  physical files in wp-content/theme/blah, but that gets translated into /index.php/wp-content/theme/blah which is gibberish.  But the home page will load, as will any permalink you set up, without /index.php in front of it!  So that’s some progress, and more or less what was expected.

So we need to fix the same problem that is handled by the RewriteCond lines in mod_rewrite from above.  The way to go about this is to modify the If in obj.conf to exclude files that actually do exist in the docroot.  And it even seems like there’s a variable to help us determine that, namely $ppath.  This is described as the physical path to the file in the request.  When combined with the -f and -d tests in the If syntax, we should be able to achieve the same thing as mod_rewrite.  So, second try:

<If $uri =~ "^/(.*)" and not -f $ppath and not -d $ppath>
NameTrans fn="rewrite" path="/index.php/$1"
</If>

Except, this doesn’t work either.  In fact it looks exactly like our more naive example from above.  Without being an expert on debugging the values of variables in the web server, I kind of banged my head against the wall for awhile on this one.  Eventually I just tried to manually put the full path to the request in like so:

<If $uri =~ "^/(.*)" and not -f "/var/SUNWwbsvr7/holcasaur.us/docs/$uri" and not -d "/var/SUNWwbsvr7/holcasaur.us/docs/$uri">
NameTrans fn="rewrite" path="/index.php/$1"
</If>

And it worked!  So $ppath must not be working as advertised.  Except it is.  From the variable reference:

$ppath:
Requested path (either URI, partial path, or file system path depending on stage).The predefined variable path is the value of pathrq->vars. If path isn’t set in rq->vars (for example, if NameTrans hasn’t completed), path gets the value of ppathrq->vars.

Notice that “depending on the stage” part.  Turns out, this is all happening in the NameTrans stage, whose whole purpose is to determine the actual physical path to the request (see the stages of request processing).  So we can’t use the physical path until it’s been determined, and that’s the last thing that happens so we can’t rewrite afterwards.

As glad as I am that the above is working, having absolute paths like that is ugly, kludgey, and will break if the actual docroot ever gets changed.  So surely we should be able to substitute some variable for the docroot.  I swear to you I have searched everywhere, and I am usually pretty good at searching, and this is just not possible.  There’s no $root or $docroot that can be used in our If.  So the only thing I can think of is to define one manually in server.xml.  You can actually do this through the admin interface so, assuming one were changing the actual docroot, as long as you were careful and also changed the variable definition of $docroot, you could leave obj.conf alone (always a good practice to leave as much configuration as possible alone).

Basically in server.xml we have:

<virtual-server>
<name>holcasaur.us</name>
...
<document-root>/var/SUNWwbsvr7/holcasaur.us/docs</document-root>
<variable>
<name>docroot</name>
<value>/var/SUNWwbsvr7/holcasaur.us/docs</value>
</variable>

This defines a variable, $docroot, that matches the document root as defined for the virtual server.  Then in obj.conf we can use it like so:

<If $uri =~ "^/(.*)" and not -f"$docroot$uri" and not -d"$docroot$uri">
NameTrans fn="rewrite" path="/index.php/$1"
</If>

And voila, everything works as expected!

I am almost positive there has to be a better way to do this.  Maybe something along the lines of using PathCheck fn=restart once $ppath gets defined properly (I tried this and got myself into a rewrite loop but it seems promising), or using objectype to define some custom logic, or going ahead with our rewrite then rewriting again later if ppath doesn’t actually exist or something, but I am not an expert on how it’s all supposed to work together, yet.  Please let me know if you know, though…

Categories: news Tags: , , , ,

Add South Carolina to the list…

March 6th, 2009 No comments

Again, someone not from DC, who doesn’t care nor understand anything about DC, who is directly affecting DC because of ideology.

Here’s what happens when you put residents of Nevada in charge of a place they don’t care about.

March 5th, 2009 No comments

Let’s say you’re from Texas.  How much would you like someone from Massachusetts to be entirely in charge of your county?  Or vice versa?

Well that’s what DC gets.

Please people, write to your representatives telling them to give DC the vote.

Categories: news Tags: , , , ,

DC Statehood: you’re welcome for my income tax, ‘merica

February 24th, 2009 No comments

Sure it’s highly unconstitutional, but looky here:

D.C. Voting Rights Bill Clears Senate Hurdle, 62-34

Can’t wait for it to go to the supreme court and get rejected.  Maybe then there will be enough momentum to go all the way and just amend the damn constitution.  The bill as-is only gives us a voting member of the house and EXPLICITLY PROHIBITS senate representation.  An amendment would fix the thing once and for all… the wording around the part in question has always been ridiculous but then again it comes from the same people who thought up the whole “3/5″ of a vote thing.

And no, becoming part of Maryland is not an option.  And no, we’re not too small to be a state.  We are as populous as Wyoming and almost as populous as Alaska (which, by the way, gets more federal money than anybody), only in 10 square miles.  Seriously, please be quiet.

For some more information on this:

Recent Slate article

Wikipedia entry on DC Statehood

Thanks for listening.  By the way, Eleanor Holmes Norton is hilarious.

Categories: news Tags: , , ,

Obligitory blog post about how long it’s been since I posted something to my blog

February 13th, 2009 No comments

Yeah, yeah, it’s been awhile. Leave me alone. I think I’m succumbing to twitter-ate-my-blog syndrome.

One thing I’ve been up to is grand jury duty. It is a real grab-bag of various things. At times, it’s completely boring. I’ve never done a sudoku puzzle in my life, but now I’m doing 4 a day on days when I have jury duty. Some of the stories and witnesses that come out of it are awesome and really worthy of being written about, but grand jury secrecy is one of the basic tenets of the whole operation. My fellow grand jurors are definitely a hoot. One of them is even famous-ish!

The best part of it all is what I’ve learned about DC law. No examples come to mind immediately though. Anyway, that’s all I’ve got.

Categories: news Tags: ,

Sun Web Server 7.0u4 and Wordpress 2.7

January 5th, 2009 No comments

Just in case anyone else is running into this…

Sun Web Server 7.0u4 includes a number of new features, including setting REQUEST_URI (which was a pain in the ass to not have before, thanks).  Unfortunately, it seems like wordpress 2.7 interacts with it badly.  They made a change to canonical.php or something.  Whatever the problem is, it puts my site in a redirect loop.  The relevant changeset is here.  Uncommenting the $original['path'] line fixed it.  To submit a bug or not to submit a bug…

I think if there are special cases for IIS in the wordpress code then they could at least try to support SJSWS.

Categories: news Tags: , ,

I. Could. Not. Agree. More.

November 10th, 2008 No comments

the periods are for extra emphasis.  and yes, this is referring to YOU.

Categories: news Tags: , ,