Archive for April, 2006

Getting rid of unused option cruft in search queries

Friday, April 21st, 2006

So I have a form with a lot of options. It’s a search form, so it’s a GET, meaning it goes into a URL and is reusable, as it should be. However, at any one time most of those options are unused. This means I get lots of &option1=&option2= cruft in the url.

So, what’s the best method of getting rid of that? Client-side removal of the extras on submission? HTTP 302 Found? HTTP 303 See Other?

Need help with Apache, MultiViews, PHP, and the Content-Type header

Sunday, April 16th, 2006

I’m finally getting into PHP, and have it set up on my computer, but I’m having a problem with Content-Type. Without PHP, if I do, say,

AddType application/xhtml+xml pxhtml
AddType text/html phtml

I’ll get .phtml files served as html and .pxhtml files served as xml. But when I tell it to route them through PHP (with AddHandler php5-script phtml pxhtml), PHP undoes that and rewrites it with its own, always as text/html.

I found the default_mimetype setting in php.ini, but it’s not helping. If I set it to something, all files are served that way, so I can’t distinguish between html and xhtml. If I don’t set it at all, it falls back to the default of text/html. And if I set it to the empty string, it still sets everything to text/html, probably meaning it’s just falling back on the default.

So how can I make it respect MultiViews’ setting?

Trust paths through OpenID

Thursday, April 13th, 2006

Okay. So you know how OpenID is an actually viable identification system? And you know how PGP/GnuPG have a concept of signing other people’s keys to establish trust paths?

Well, I was just thinking about blog comments, and a) how now that I have them re-enabled, I’m getting spam, and b) I’d like to enable OpenID, and I got an idea (which, if you read the first paragraph, you’ve probably already figured out). Why not extend OpenID to also allow trust paths? Basically, if I trust Anne to be a real person and not a spammer, and he trusts Ian, I can be pretty sure that Ian’s not a spammer. And if Ian’s server is compromised and a spammer starts sending stuff as him, or if he’s paid off by the Evil Spam Operators to “trust” them, then I can either blacklist Anne, blacklist Ian, nofollow Anne (so I trust him but don’t trust his contacts), or even just wait for Anne to take care of it.

Obviously it could be fleshed out a bit more (max depth for trust paths?) and in implementations too (temporary blacklist: blacklist Anne for 24 hours and renew automatically if I got any comments through his trust path that looked like spam, else re-trust), but it looks like a start.

Thoughts?

Making Apache work

Thursday, April 13th, 2006

Note to future self:the reason your Apache configuration isn’t working is that Gentoo has stupid defaults and puts up extra walls in the name of “security”. You need to edit /etc/apache2/vhosts.d/00_default_vhost.conf and switch the AllowOverride None to All.

Blog upgraded, comments now work

Wednesday, April 12th, 2006

I needed to fix comments here, so I had a few choices. a) Figure out what was wrong, or b) just upgrade and let that fix it.

I upgraded. That fixed it.

As a downside, I no longer have the comment validation plugin. Someone should write a plugin that parses all input as HTML 5 and re-serializes it as valid whatever-language-you’re-using.

Edit: And let the blogspam begin! I’m holding all comments for moderation now. I think you can get around that by registering an account here or something (?) but I basically don’t care yet. Maybe I’ll look into it once I actually understand enough PHP to make changes.

If Content-Type is dead… now what?

Tuesday, April 11th, 2006

Okay, so Content-Type is dead. But in a perfect universe, what would there be? Should we try to revive it? Should we let filenames matter? Should we rely on content type sniffing? Should we try to standardize a metadata wrapper for files? Nothing looks appetizing here, but Content-Type is the least bad.

Tuesday, April 11th, 2006

Oh. I guess the reason no one’s left a comment on my blog in ages is that there isn’t a comments form.

I should fix that… today, probably. Right now I’m tired.

Yay! Cairo on Linux!

Wednesday, April 5th, 2006

Yay! Cairo on Linux!

link, link, link

Per-application sound volume?

Sunday, April 2nd, 2006

Does anyone know if/how I can (in Linux, of course) control sound volume per application? So I can, e.g., turn down the sound coming from a flash game in Firefox, but let Rhythmbox play my music at normal volume?