An Image Upload Extension for YUI Rich Text Editor

Before you begin: Read the updates at the bottom of the page. This post was written for an older version of the YUI library.

I’ve had nothing but good things to say about the Yahoo User Interface tools. It seems to me like the developers continually add all the things from other libraries that I like into one simple to use, well documented, overall good quality library.

The new addition of the rich text editor has left me no less pleased. I can now ditch the other editors I’ve used in the past in favor of one that will be maintained. (I’ve tried two that worked, but were becoming out-dated and didn’t really have support.)

Continue reading

Posted in Programming | Tagged , , , , , , | 135 Comments

Using piped svndumpfilter commands to separate an svn repository

According to the documentation for svndumpfilter, you can include one subcommand when filtering a dumped repository. Suppose you have a repository that has a path “/some/path” that you’d like to separate out into its own new repository. From the documentation, you simply pipe the original dumped repository through the svndumpfilter command.

Example:
cat repos-dumpfile | svndumpfilter include some/path > new-dumpfile

The caveat is that if there are paths copied from other paths in your repository that the include argument does not cover, you’ll get an error. I got around this command by piping the output from one svndumpfilter command to another, each with exclude commands instead of include commands. The result leaves only the paths I want, but included the alternate copy branch that I had used part way through the coding process.

Example:
cat repos-dumfile | svndumpfilter exclude unwanted/one | svndumpfilter exclude unwanted/two | svndumpfilter exclude unwanted/three --drop-empty-revs --renumber-revs > new-dumpfile

Notice on the last svndumpfilter command, I added a couple arguments to renumber the repository revisions and drop the empty revisions. While these are of course optional, in my opinion, they make the new repository cleaner.

The subversion book states you can edit the Node-Path values in the dumped file to have the new repository imported at different paths. I chose to simply issue an “svn mv” command once I imported the repository.

Posted in System Administration | Tagged , , , , , | 6 Comments

Customize your laptop speed for temperature and performance

I while ago, I found a great article on Slashdot that shows how Windows XP manages variable speed CPUs. Well, at least it applies to Intel Speedstep technology. If you have an Intel processor (like the Core 2 Duo T7200 in my laptop), you can take full advantage of the different CPU frequency algorithms to get the desired performance from your machine.

Continue reading

Posted in Hardware | Tagged , , , , , , | 3 Comments

Elements of Great Web Design: The Polish

I’m not an expert designer. In fact, most of the time I feel inadequate when it comes to picking colors, layouts, and other features that a designer usually takes care of. All my design has to do with interfaces, classes, schema, and other back end technology that most people can’t see.

In the mean time, I’ve been trying to configure my blog to look nice and work correctly. This article on Digg.com had a few additional suggestions that I think would be great, and plan on reading through a bit more thoroughly when I get a second.

From the article:

When I put together designs, I do so in two phases – Layout and Polish. During the layout phase I place the main objects and usually finishing with something that looks relatively complete. In the polish stage I go over the design and adjust colours, type treatments, shadows, layers, and clean it all up. In this first of a series of tutorials on…

read more | digg story

Posted in Web | Tagged | Comments Off on Elements of Great Web Design: The Polish

Using tcpdump on a linux-vserver guest

To debug a problem I’m working on, I need to be able to see network traffic on an interface inside a linux-vserver guest. To do this, you have to enable the CAP_NET_RAW capability for that guest.
> echo "NET_RAW" >> /etc/vservers/myserver/bcapabilities

Then just restart the vserver.
I noticed you don’t have to enable NET_ADMIN, or unhide the interfaces. I’m not sure if there is much of a security risk on having NET_RAW enabled or not. You can always disable and restart after you’re done with tcpdump.

Posted in System Administration | Tagged , | Comments Off on Using tcpdump on a linux-vserver guest

Programming a client for the WHOIS protocol

I have a little task that involves programmatically determining whether DNS servers are set correctly for a domain. Since this project is written in Python, I first set out to see if there were any “whois” clients already available for Python. I eventually found rwhois.py, which is a whois client with recursive ability. I noticed it hasn’t changed since 2003, but thought that if it works, that shouldn’t be much of a problem.

My first run of the program resulted in an error. The client successfully found the registrar information for my domain, but failed to parse and display it. There was a “NoParser for: whois.godaddy.com” exception. I set out to analyze the rwhois.py client and the whois protocol and see if I couldn’t either fix it or come up with something for a replacement.

Continue reading

Posted in Programming, Web | Tagged , , , , | 4 Comments