Saturday, May 9. 2009
Ok, I'm not a novice when it comes to developing websites: I've been building web pages for close on 15 years. But within the last week, I've come across two browser behaviors (or perhaps they're browser addon behaviors) that make me scratch my head.
First, a request coming from something sending the User-Agent "Mozilla/4.0"-- yes, that's all, no clarifiers or parentheticals-- is lopping off the GET parameters when a popup is launched through a button click via an onclick handler. This site states that this is a Yahoo! search something, but the links are not something that a Bot would come across. On the other hand, there is no referrer sent, whick makes me think it could be some kind of link preloader or some other browser add on. Also, I saw a very similar error today coming from Firefox 3.0, though I'm not sure it's related.
Second, and this is really baffling: Sometimes I'm getting requests from a browser identifying itself as IE 6.x that has the entire URL made lowercase. I'm use nice REST-ful URLs for my application, so when a identifier comes across as lowercase, it throws off the lookup. Of course my own copy of IE 6 doesn't exhibit the behavior. For this particular case, I'm using JavaScript to build a URL, and then sticking it as the src attribute of an embedded iframe that is also being created by JavaScript. I'm seeing other errors in my logs though of IE6 and IE7 browsers going to different links (links that would typically be clicked or pasted from an e-mail) that are all lower case as well. Again, not sure if that's related, or if people are just typing them in (lazily) or if it's a browser bug. The only thing I can seem to find about this is this forum (news?) post from 2005 with no replies.
Of course my Google searching is revealing nothing to help me keep my hair, so I turn to the Lazy Web.  Any ideas?
Saturday, January 10. 2009
I hate the way that tabular sorting is typically done in web apps (make links on every column with sort_order="columnname" or similar). It is tedious to code, and requires a lot of bandwidth and round trips from the server, not to mention additional load on the database.
Well, today I Googled a bit, and found SortTable.js. Add the script, and add a "sortable" class to the table you wish to sort, and you're done. It automatically detects string, numeric and date columns and sorts them using a very quick (though non-stable) sort.
I only had a very small problem (some of the CSS styles in FF3 stopped working) with the mechanism used to set the table up to be sortable (window.onload replacement), so I switched it to use jquery(document).ready, which happens later in the page loading process. Works nicely.
Check out the documentation for additional features.
Saturday, July 26. 2008
For a couple of projects now, I've wanted a grid layout engine that is similar to how desktops display lists of icons: nearly fixed width items, but varying slightly in height, displayed on a variable width page, so your layout could end up with 1 column or 8 depending on the width of the browser window. Tables are no good because they're always a fixed number of columns. Div elements using float works, so long as you make all the elements a fixed width, but they also have to be the same height, or you'll end up with gaps. I'm thinking it's going to have to be javascript driven including redrawing when the page size changes, and to manually size all items to the tallest item in the row, but I can't seem to find an example on the web anywhere (or my Google foo is weak).
Dear lazy web, can you point me in the right direction?
Friday, May 9. 2008
I host this blog, as well as e-mail for dragonstrider.com and a host of other services on an old PC behind my cable modem at home. This has served me well for the most part, but it requires onsite maintenance when it goes down. This is bad when I'm at work, or vacation, as happened this week. So, I bit the bullet and researched some Virtual Priate Server (VPS) hosting providers.
I ended up choosing Slice Host as a no-frills, just the tech if you please, Linux/Xen-based VPS host. Their entry level plan (slice) gives you 256 MB RAM, 10GB storage, and 100GB of bandwidth for $20/month, and you can scale it with a reboot up to 4GB/160GB/1600GB for $280. /proc/cpuinfo shows that the host for my entry level slice is a two way "Dual-Core AMD Opteron(tm) Processor 2212" operating at 2.0 GHz. There's a separate swap partition (so swap doesn't count against the 10GB limit), as well as web based management tools for rudimentary Name Services, starting, stopping and rebuilding your slice, a web console (in case ssh isn't working for some reason), some statistics and reporting, and my favorite part, a rescue mode.
Rescue mode lets you boot your slice in a rescue environment, mount your root file system in an alternate location, and do what you want (or need) with it. This makes it pretty easy to run your appliance from rBuilder Online on a hosted slice. Here are the steps to get this working. Choose a Xen Appliance Image (32 or 64 bit, though 64 bit is preferred) that is a single file system image.
- Create a slice (doesn't matter what kind, we're going to blow it away anyway).
- Reboot your slice into rescue mode
- SSH or console in using the password mailed to you (yes, rescue mode gets started with a randomized password)
- wget -O - <link to the rBO image> | tar -xz # This downloads and extracts the filesystem image
- dd if=<path to filesystem image file> of=/dev/sda1
- e2fs.ext3 -f /dev/sda1 # This forces a file system check, without this check the next step will fail.
- resize2fs /dev/sda1 # Resize the file system image to match the available size
- mount /dev/sda1 /mnt
- copy the following networking configuration files from your rescue image to your new slice image mounted in /mnt
- /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/resolv.conf
- Edit /etc/sysconfig/network to fix the hostname to the desired value
- chroot /mnt
- passwd # changes the root password since the rBO images ship with root's password blanked
At this point you can do any additional configuration you wish, such as adding additional users, making sure that openssh-server is installed and configured to start on boot, etc.
When that's done, shutdown, exit rescue mode from the Slice Host panel, and log in to your new appliance.
There is quite a bit of noise when the slice boots up with an rPath Linux based appliance because the kernel in the image isn't used for booting, and modules.dep isn't located for the booting kernel, but that seems harmless.
Now to build an appliance to run on the thing... I used the rPL 2 beta 3 text devel image as my image while developing this HOWTO.
Thursday, March 30. 2006
First of all it sucks to be sick. I don't know what I caught, nor where I caught it from, but now I'll be coughing for at least a week and my lungs are already sore from the last two days of hacking. I just hope that my wife and son don't catch it. Alex already has ear infections and a nasty cough coinciding with the arrival of four new teeth. At least his black eye is better.
A lot has happened since December, and I won't even begin to enumerate it all, just to tell you that I was working feverishly to get VMware and QEMU/RAW Hard Drive images working in rBuilder Online. With that task completed I am no longer working on rBuilder, instead I'm working with Ken VanDine and Xiaowen on something to be announced soon.
Yesterday I modified the PHPAppPackageRecipe class to make it more friendly to sofware upgrades. Previously the tarball containing the PHP application was extracted directly to /srv/www using whatever root folder was in the tarball. Then the recipe made a link connecting /srv/www/ to whatever folder was extracted. The problem with this arrangement is that if that directory contained the version, as many php apps do, the next version would be installed to a different location causing a manual step to move settings and data to the new folder.
Now the recipe extracts the application as most other packages do to the conary build folder. Then I copy the contents to /srv/www/ and eliminate the link. Hopefully this will ease upgrade pain. I rebuilt Gallery bumping its version to the newly released 2.1 and Serendipity in the LAMP rBuilder project so if you're running either of those be aware that there will be some one-time transitional pain. Feel free to contact me for help in upgrading to these new packages.
Monday, December 19. 2005
I spent some time this weekend packaging Gallery2 and Serendipity for rPath based Linux Distributions. As part of that effort, I built a conary recipe superclass to make packaging other PHP applications easier.
This class currently resides in the LAMP repository in the phpapppackage:source trove. The superclass handles creation of the apache configuration file to drop in to /etc/httpd/conf.d, provides stubs for creating empty files and directories for use by the PHP application, and sets up the requirement on PHP.
So, a new recipe for a simple application like gallery looks like the one here.
Notice the calls to MakeWriteableDirs and CreateWriteable. Those create the empty config files and directories needed by the application. These are created with ownership "apache", as which user the stock httpd server runs. Also notice the r.macros.dirconf macro. This data gets inserted into the apache configuration file between <Directory foo> directives so that you can set application specific php configuration values, or even set overrides.
If you use phpapppackage.recipe as a root class to package some other php application, shoot me an e-mail to let me know. I'd love to hear about it.
Thursday, November 10. 2005
For the past week or so, I have worked on creating a new AJAX-y group trove builder for rBuilder Online. This widget will allow anyone who can shop online to create new purpose built Linux images. The images can then be downloaded, burned to a CD-R, and installed, all in a day.
The best part of the work I've been doing is that it elegantly falls back to POSW (Plain old static web) when javascript is disabled. I do this by rewriting the urls on the page to make the AJAX calls to our XMLRPC interface to rBuilder Online. If the urls don't get rewritten, they will make page load calls to perform the same action.
Continue reading "AJAX and rBuilder"
Monday, August 1. 2005
I have created a XMLRPC interface to allow the remote control of many of the Mailman functions previously only available via the CGI or command line interfaces. This patch, submitted as SF Patch #1244799 is available for anyone who wishes to download it and apply it to a 2.1.6 Mailman tarball. This entry is a (shameless) attempt to publicize the patch and try to get it integrated into mailman CVS.
If you run mailman on an rpath Linux system, this patch will soon be available from the conary repository.
Saturday, September 25. 2004
I've never understood the top/bottom posting fiasco, for fiasco it is. It's almost as foreign to me as the HTML vs Txt e-mail. Perhaps its because I grew up in the Google age, but even in the days of 200 baud modems one would want to see the relevant (i.e. new) text first. Perhaps I just haven't been properly introduced to the contrary argument. Perhaps it's time to repeal this part of the RFC. Oh wait. I just noticed that the "RFC" is only informational, and has not been officially ratified, so adherance is not required.
"This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind."
Continue reading "Top Posting vs. Bottom Posting"
|