Saturday, May 19, 2007

Ego++

Typically, I'm not one to toot my own horn too much, but I'm rather excited about this. Because of my earlier post, two things happened:

  1. The APE was changed to support HTTP status 204 No Content, and
  2. the APP draft specification was changed to clarify (via text and examples) that non-200 OK responses for PUT/DELETE were acceptable.

I think it's awesome that I could (somewhat indirectly) influence a standard like that. At the very least, it gives the ol' ego a little boost.

Wednesday, May 16, 2007

ANN: Gentoo Bazaar Overlay at Launchpad

After a suggestion by a commenter, I've registered a project on Launchpad for my Gentoo overlay of Bazaar-related ebuilds. If you have any patches or bundles, don't hesitate to submit a bug there.

(As an aside, I made the logo by combining the SVG logos of Gentoo and Bazaar in Inkscape; it's much easier than you'd think.)

Monday, April 30, 2007

Report: Linuxfest Northwest, Saturday

After hearing about it from a friend (specificallly, that I could get there for free courtesy of Pogo Linux), I decided to go to an actual Linux...fest... and take in the nerd atmosphere without getting some sort of otaku or gamer disease. Unfortunately, I could only go on Saturday. I would have loved to hear Brad Fitzpatrick talk about how LiveJournal scales their databases, among other things.

The bus left promptly at 8:06AM. The movie they were showing on those little screens scattered throughout the bus was the X-Files movie, which I have no intention of watching, so I caught up on some reading for one of my classes. One amusing thing that I noticed on the way up was that there was a "Lychee Buffet" restaurant at the freeway exit for the college. If you think about it, it sounds rather disturbing.

I had roughly 15 minutes between the time that the bus arrived and the first presentations. In that time, I got a bunch of CDs from the Ubuntu and Oracle tables (it was like the Oracle table was having a fire sale - I got an Oracle DVD and an Oracle Linux DVD), and some stickers from the FSF table, including the "Bad Vista" one.

The first talk that I heard was on copyright and open source, by Karl Fogel (of CVS/SVN fame). It was really interesting, given my affinity for history (especially regarding science and technology). He talked about the parallels between the era of the printing press and the present-day. I didn't realize that copyright (or proto-copyright) was created as a censorship/printing restriction tool by the official guild of printers.

The second talk I attended was on strong authentication, in particular multi-factor authentication. It was very informative, especially in regards to how those one-time password keyfobs work.

Presentation number three was about practical honeypots. I wasn't really impressed with it overall. It was rather high-level, and the presenter admitted that he had only started working on it that morning. A lot of it seemed like common sense, like being preemptive, only concentrating on exploits that are relevant to your particular systems, etc.

The last talk I observed was on scaling web services, by a lead developer from Real Networks. He reminded me of Penn from Penn & Teller. It was a very engaging talk, and it gave me a new perspective on scalability, that is, it's essentially an organizational problem, as opposed to a technological problem.

A closing thought: I would have loved to have gotten one of those stuffed SuSE lizards...it would have fit in well with the Tux I got in Canada several years ago.

Tuesday, April 17, 2007

Re: Genshi Filters for Venus; Genshi + Trac-AtomPP

This news is excellent. One of my side projects (although, it was pretty low on my list) was to figure out how to use Genshi templates in Venus. I started out by copying the Django template code/unit tests and adapted them for Genshi. However, I got stuck getting some of the unit tests to pass (_item_title and _config_context). Perhaps sometime this weekend I can see how this particular implementation works.

Speaking of Genshi, I just noticed that they had released version 0.4. Hopefully, this will help me resolve the last APE error in my Trac-AtomPP plugin — adding app:edited elements to relevant entries and sorting by that property.

While I'm thinking about it (this really seems to be turning into a stream of consciousness post), I'm not exactly sure how to page the collection efficiently, considering that Trac creates the wiki page list via a generator. Right now I'm just putting everything into one feed, but obviously that doesn't scale very well.

Sunday, April 15, 2007

HOWTO run the APE (or any jruby script) via Apache CGI

In my previous post, I was running the APE via the command line because I couldn't figure out how I could run it as a CGI in Apache. I don't really want to run Tomcat just for this, and I've had bad experiences with Tomcat administration both for school and for work (which I guess is basically the same thing at this point). So after a bout of searching the Internets, I had found a post on JRuby on Rails which helped me greatly in configuring it. So, without further ado, here's the relevant apache configuration snippet:


SetEnv JRUBY_HOME /usr/share/jruby[1]
SetEnv JAVA_HOME /usr/lib/jvm/sun-jdk-1.5[1]
# Jing dependencies
SetEnv CLASSPATH ...[2]
AddHandler cgi-script .rb
Options +ExecCGI

Notes:

  1. These values are Gentoo-specific. For JAVA_HOME, I used Java 5 as a precaution, because I wouldn't be surprised if it didn't work in version 1.4.x.
  2. On Gentoo, they put all of the third-party jars in separate directories so that their java-config utility can manage them all separately for the system and the users. So, the value I had here (which I didn't want to reproduce here because it's way too long) was the result of java-config -d -p jing. You probably don't have to put this line in if jruby can find jing by itself.

For the APE, I had to add #!/bin/bash /usr/bin/jruby to the top of it. For some reason, CGI complains if you leave out the /bin/bash part of it.

Saturday, April 14, 2007

trac-atompp progress; APE questions

I'm working on (among other things) finishing up wiki support in my trac-atompp plugin. I'm nearly done, I think. In order to make sure it's "valid", I'm using Tim Bray's APE (albeit from CVS). However, I've got a few questions about some of the errors:

  1. ! 53 of 53 entries in Page 1 of Entry collection lack app:date elements.

From the source, it looks like it should actually say app:edited. But, why is it giving an error? According to draft 14, section 10.2, Atom Entry elements in Collection documents SHOULD contain one "app:edited" element, and MUST NOT contain more than one. Perhaps the messages should conform to RFC 2119 instead of lumping in all of the SHOULDs with the MUSTs, or something.

  1. ? Can't update new entry with PUT: No Content [Dialog]
  2. ! Couldn't delete the entry that was posted: No Content [Dialog]

I don't really understand why HTTP status code 204 (No Content) isn't allowed for either PUT or DELETE, seeing as RFC 2616 says that it is a perfectly valid response for both actions.

Thursday, April 12, 2007

HOWTO restrict ssh access by IP and user

There's a way to restrict access to a user account or set of user accounts via PAM (and by extension, SSH)—the obviously named pam_access module. It's available on Gentoo Linux in sys-libs/pam, and on Debian Linux (and I assume the derivatives) in libpam-modules.

In order to enable this module for SSH, you have to edit the SSH's PAM file (Gentoo: /etc/pam.d/sshd; Debian: /etc/pam.d/ssh) to enable the access module: account required pam_access.so

There's some pretty good documentation in /etc/security/access.conf (at least, in the default distribution of it) on how to configure the file, but one thing that it doesn't say explicitly is that you can use IP address blocks in CIDR notation to denote access privileges. For instance, if I wanted to limit bob to the local network (192.168.0.*) and the VPN (172.16.*). The configuration line for that would be:

-:ALL EXCEPT bob:192.168.0.0/24 172.16.0.0/16

Wednesday, April 11, 2007

Re: Protecting a JavaScript Service

In How to Protect a JSON or Javascript Service, Joe Walker looks at a few solutions such as:

  1. Use a Secret in the Request
  2. Force pre-eval() Processing
  3. Force POST requests

The last time that I worked on an JSON-based web application, I did number 1, sort of. I basically implemented a simplified version of HTTP digest authentication in order to send a username and password to the server. In order to accomplish this, I used an nonce plus a JavaScript implementation of the SHA-1 hash function.

If I were to reimplement the user authentication portion today, I would probably use this "clipperz" library that I also found on Ajaxian. I'm amazed that someone has implemented AES in JavaScript. I would think that it would be difficult, although I haven't read the specification for it. Maybe one of these days I'll implement the Diffie-Hellman key exchange, if I get bored enough or I need it for something.

Wednesday, March 21, 2007

AWN bzr branch, bazaar overlay

Two announcements tonight: the creation of a bazaar branch for Avant Window Navigator (Awn), and the creation of a bazaar-related gentoo overlay.

First, I really like what njpatel has done with Awn. I've always wanted a bar that looked and functioned like the OSX bar, but the closest I could find was the gDesklets starterbar, and it didn't handle currently running programs. Awn is just plain awesome. Unfortunately, I don't use Gnome on my desktop at home, I use Xfce. So I svn co'd the source and created a patch that uses libxfce4util and thunar-vfs instead of gnome-desktop and gnome-vfs. I submitted that patch to the tracker, where, as of the time of this writing, I haven't gotten a response. We'll see. Next up on my list of modifications, is to use Glib's GKeyFile (read: ini-like file parser) as an alternative to GConf. Because bzr-svn finally doesn't die when I try to checkout a remote repository (as of bzr-svn 0.3.2 and bzr 0.15rc2), I now have a bzr-svn branch that contains all of my changes to Awn.

Speaking of bzr-svn, at the request of the developer of bzr-svn, I have published my modified subversion ebuild that contains the patch listed in the parent post to that comment, in a bzr branch, of all things. This branch also contains the latest releases of paramiko, bzr (0.15rc2), bzrtools, bzr-gtk, and bzr-svn.

[Edit: forgot paramiko]

[Edit: forgot to finish a thought]

[Edit (2007/05/16): Update here]

Tuesday, February 27, 2007

Death of an OS

I've been trying to salvage a Windows XP laptop which mysteriously blue screened the other day. Ever since, when it boots, right after the XP load screen, it blue screens again with this error:

STOP: c000021a {Fatal System Error}
The Session Manager Initialization system process terminated unexpectedly with a
 status of 0xc000026c (0x00000000 0x00000000).
The system has been shut down.

Looking up the error via Google doesn't give me any useful results other than "reinstall XP", so, I've been using a LiveCD to move all of the essential data (music, documents, Firefox settings, etc.) to another computer. It's a very fun process.

Thursday, February 08, 2007

Review: Darcs

In short, Darcs irritates me more than any other distributed VCS that I've used so far. And that includes git.


One of the more annoying things about it is that the commands for it are significantly different from most modern VCSs. Examples (based on their equivalents in other systems):

status
darcs whatsnew -s
diff (unified)
darcs diff -u (for the record, I expected darcs whatsnew -u to do the same thing, based on the description in the help text.)
commit (to local tree)
darcs record

On a more positive note, I find the patch-based approach (as opposed to the snapshot-based approach Bazaar uses) to be an interesting method of performing backend operations. However, having to go through each patch "hunk" is rather strange, and doesn't really seem to scale, especially in a command-line interface. It seems that in the prototype GUI, it's a little better, but the usability is still lacking.

Tuesday, January 23, 2007

Trac-AtomPP progress, 2007-01-23

I finally got myself out of my Trac plugin coding slump. Genshi is really making this a whole lot easier; I don't really know why I was manually generating XML from trees in the first place.

I am very grateful for the existence of Joe Gregorio's Atom Publishing Protocol test suite. There are only a couple of nits about it — first, it doesn't seem to play well with Multi-version installs of wxPython (seems to require 2.6, perhaps 2.5 [I only have 2.4 and 2.6 on my computer]), so I cooked up a really simple patch for that. Secondly, my wiki collection feed generates some warnings via Feed Validator, but in the logging pane, it records them as errors. Since it doesn't affect the functionality, I merely consider that a minor usability bug. But, this really doesn't seem to be meant for end users, so...whatever.

Anyway, for my capstone, I'm only working on the wiki part. GET is done, and POST is nearly done. DELETE is done in theory (haven't tested it out yet), and PUT still needs to be converted. POST and PUT now require some implementation of ElementTree to be installed, in order to parse the Atom Entry input. As an aside, ElementTree's find*() methods are really poor substitutes for XPath. Also, this implementation utilizes the Atom MIME type parameter draft whenever possible.

Reminder: Bazaar URL is: http://bzr.malept.com/trac-atompp

Monday, January 22, 2007

Suggestion for project

pyglet (OpenGL multimedia library) + Bruce (presentation tool) + S5 (presentation format) would probably create an awesome alternative to PowerPoint. Other possible libraries to use include Genshi (to template the S5 XHTML output), and cssutils and html5lib to replace the current HTML/CSS parsers in pyglet, mostly because reinventing the wheel is usually a bad thing. To look into: whether a pygtk UI can be integrated with a pyglet surface (perhaps via pycairo).

Saturday, January 20, 2007

HOWTO compile subversion-1.3.2 so that it works with bzr-svn-0.3

This was written because simply using the patch at the bzr-svn web page is not sufficient for getting it to work with subversion-1.3.2, which I'm using because that's what's stable for Gentoo's x86 ebuilds.

Note 1: I have a Gentoo ebuild that corresponds to these directions. Add a comment if you want it.

Note 2: Where there are instances of lynx -source [url], it can be substituted for wget -O - [url] when lynx is not available.

  1. Unpack the subversion-1.3.2 tarball: tar -xjf subversion-1.3.2.tar.bz2
  2. Change directory to the subversion source directory: cd subversion-1.3.2
  3. Apply this patch to the source (this patch came from the Ubuntu Edgy source diffs, but slightly modified): lynx -source 'http://www.lazymalevolence.com/patches/subversion-1.3.2-debian-x-python-bindings.patch' | patch -p0
  4. Remove some of the generated .swg files, or else the compile will fail: rm subversion/bindings/swig/proxy/*.swg
  5. (This step is for people who have swig 1.3.31 installed; I haven't tested with any other version.) Convert the language typemaps to #ifdefs, to get rid of a bunch of warnings: (cd subversion/bindings/swig && lynx -source 'http://svn.collab.net/viewvc/*checkout*/svn/trunk/subversion/bindings/swig/convert-typemaps-to-ifdef.py?revision=19926&pathrev=19927' | python -)
  6. Regenerate all of the configure files, Makefile.in and the .swg files, among others: ./gen-make.py build.conf; make -f autogen-standalone.mk autogen-swig; (p=`pwd`;for d in . apr{,-util}; do cd $p/$d && autoconf; done)
  7. Proceed normally in the build cycle: ./configure && make all install

Saturday, January 13, 2007

Several items

The last post was 1.5 months ago, awesome. Anyhow, here are some thoughts on stuff I've done/explored in the computer realm during that time:

  • Beryl is awesome. Too bad it doesn't play well with tvtime, or else I'd permanently enable it and all the associated settings. Also, my video card is one of those crippled ones (ATI Radeon 9250SE), so it's a bit slow as well.
  • My capstone project is in full swing. I've mostly stopped using my hand-rolled Atom parser/generator, since I got stuck on how to implement extensions. For generation, I've switched to using Genshi templates. Genshi has a pretty nice templating language for both XML and text based documents. For parsing, I think I'm going to use lxml or ElementTree, depending on how well XPath is supported.
  • Given the amount of attention that OpenID has been given in the blogosphere lately, I was thinking about how it could be used to integrate with the UWNetID system. Unfortunately, I found that it was rather difficult to modify the current implementations in order to add such support. So, I'm currently writing a PHP5 class + mini-application to be an OpenID server. So far, I have the association mode completed, and the checkid modes are in progress. I am proud of myself for actually implementing the Diffie-Hellman key exchange, since while I am fascinated with cryptography, my math skills in that area are...lacking. It's also nice to refresh my PHP skills, as I haven't programmed in PHP5 (which gives you some idea as to the last time that I coded in PHP).
  • Over winter break, I attempted to port modular X to MinGW, as the Xming project (which is awesome) uses the old, monolithic build process. I've built all the Xorg server (and its dependencies) successfully, except that the OpenGL code for Windows has not been updated with the rest of the server's codebase. That sort of modifications are pretty far out of my porting abilities, unfortunately. This project also gave me some experience with git. My take: it's extremely annoying to use git directly — use a frontend to it such as cogito instead. My personal preference is still Bazaar, though.
  • I wrote a Python module in C for my on-again, off-again, DC client project. I have a post on that sitting in my queue and will post it at some point when I finish and/or remember it.
  • I eagerly await the day when Deepest Sender supports the GData Blogger API. Maybe in the spring, if it's not there, I'll write it.
  • Oh right, the new URL for this weblog is http://blogger.malept.com/.

Wednesday, November 01, 2006

Re: Get a Mac - Counselor

Obviously, the counselor/therapist is Linux®.

Thursday, October 26, 2006

On Interface Design

It seems that taking this design class is really aggravating me. It seems that some of the people in the class think that history is not important when gathering needs requirements, i.e., research. I'm sorry, but that is bullshit. There's a couple of kinds of history when you're thinking about design. There's backwards compatibility, where you take into account what people are used to. This is why we've had the desktop/window paradigm for so long. This is why I still have a panel on my Linux® desktop that looks a lot like the Windows™ taskbar.

On a related note, it really pisses me off when people call me too technically-minded. Sure, I'm mainly a technical person, but when I think about user interfaces, there are three factors that are always in my mind (in this order):

  1. Is it too complicated?
  2. Is it somewhat recognizable to the user so that s/he can use it relatively well?
  3. Can I code this (in a reasonable amount of time)?

Thursday, September 28, 2006

Bloglines Freedback, 2006/09/28

Have I mentioned that freedback is a pretty stupid word?

Anyway...I find the new changes to Bloglines's service rather annoying. Sure, it looks spiffier, but when functionality that I rely on gets messed up, it's not a good thing™.

My mouse is currently in a state where it likes to double-click things even though I definitely single-click them. As a result, I tend to lose the "new" posts from a folder with only new posts in one feed. It used to be that I could just hit s and then click on "Display posts from last session", and I'd get the posts back. Now, this behavior doesn't work. I don't like it. If I actually had time, I would start hacking on Venus and make a service for myself...but alas, stupid classes that overwork me. (Oh yeah, and those other projects that take up my time...)

Edit: Oh, and "Keep as new" is broken. At least, it broke for me. I get this (0) (-1) in the title bar instead of (0) (1). The annoyance level is getting to that one tipping point...

Wednesday, September 20, 2006

Re: Do We Need New Software?

I've gotten the chance to talk to a lot of people about these issues, and with the exception of those who are very close to the current software, opinion is almost unanimous: the Wikipedia software needs to be rewritten from scratch in Python. (Yes, everyone really did say Python.) Rewrites of large software projects aren't taken lightly, but from everything I've seen this is one of the rare cases that it's actually necessary.

This made me laugh. It makes me wonder how this will play in non-Python communities. Somehow, I doubt this will happen. I took a quick look at the SVN repository, and it all looks very muddled to me. I had to guess as to where the main source code was, based on the version timestamps.

With regards to the series from which this article comes, I find them very thought-provoking, It will be interesting to see if Mr. Swartz ends up on the board. I'd vote, but I'm just a typo finder (i.e., I don't have 400 edits).

Wednesday, August 30, 2006

Re: RAD V: << !!

ongoing · RAD V: << !!:
<< is the name of a method, and you can define it to mean anything you want, but normally it means “append-to-self”.

Why, oh why, did Ruby decide to yank a horribly unintuitive operator from C++ and stuff it into its grammar?