Problems with Amazon’s Shipping Algorithm

I’ve been playing around with Amazon’s shipping algorithm by placing orders and seeing what happens. Here’s my speculative notes on what’s right, and what’s wrong, with Amazon’s shipping algorithm. More importantly, it’s how to get your books to you sooner.

Amazon has two modes for shipping. One is “send me what you can and soon as you can,” resulting in obnoxious shipping charges. The other is “send me my order when everything is available,” resulting in the minimum shipping order.

What makes Amazon really great, and by great, I mean what keeps me coming back to them, is the fact that if one orders enough stuff, you can usually get free shipping pretty easily. Or at least free shipping if you take the cheapest method of delivery option. But more importantly, even with free shipping, and the famous “send me my order when everything is available”, Amazon uses that as a guildline and often ships things in multiple shipments… especially if they are coming from different warehouse locations.

Under these conditions, you get your stuff in a timely fashion, reasonably soon, and often for free. Awesome.

However, there’s a bug in the algorithm. And it’s a bad one. And you need to be aware of it.

If any book in your list has not been published yet, meaning you preordered it, and you select “when everything is ready”, then your order will not ship. It sits in limbo. Even if you have hundreds of dollars worth pending. This is important to know, especially if you need something urgently.

This is really bad, because if you’re also ordered some rare books, or things with limited stock, they can suddenly become unavailable, even though you placed your order on time.

So, making sure you’re with me on this… if you order a preorder item, then you won’t get any of your order, meanwhile the availability of your items slowly disappears while you wait.

What Amazon ought to do is send you an email letting you know this is happening, or ship your partial order like they normally do, or offer to move the item back into your shopping cart for a later order. But they don’t. No explaination is given, no notice appears in your inbox, you just place an order and it sits there… and can sit there for months.

The hack solution from the customer side is simple: order pre-order items separately. Always. Or, if you’re made of money, ship as each item becomes available, though I doubt anyone on a non-corporate budget really wants to do that.

In fact, if you have an order in limbo, you can cancel that item (remember to move it back to your cart), and the moment you apply the changes, your order will instantly be ready to go.

I just finished conducting a test, where a placed a nearly $200 order a month ago, with one well picked pre-order item that was due out the middle of this month. The moment I removed the item, I got an email and things are now moving along again.

Another Bug in GMail’s Editor

Found a nastier bug in GMail’s editor, one that moves formatted words to the end of the paragraph you’re typing. Check out the video screen capture and explaination.

A while ago I wrote about a bug in GMail’s editor that had to do with indentation.

Found another problem, and this one is worse. GMail will actually move your text around as you’re typing, destroying the content of your email.

This one took me months to figure out how to reproduce repeatedly. It’d happen to me every once in a while, just often enough to be very annoying, just rare enough that it was hard to pin down.

How to Recreate
The problem happens when two conditions are met. One, you are using the KEYBOARD and not the mouse/short-cut buttons to format text. Two, the word with the formatting is the last word on a line that’s been line wrapped.

Play the video below, and note that the last word left on the line after the wordwrap is in italics; more specifically, italics that have been done with Control-I, not with selecting the word and pressing the italic button. On the second line, a new word in italics is started, again by pressing Control-I, and the moment the next character is typed, the problem happens. The formatted word from above is moved to the end of the paragraph.

[QUICKTIME http://www.wwco.com/~wls/livejournal/GMailEditorBug.mov 244 257 false true]

I was able to recreate this problem in FireFox on both Windows and OS X. Opera on Windows cheats, pulling the formatted text down to the next line with the word that follows. Internet Explorer seems to work fine.

Linux Install Problems on a PowerSpec MCE510

FC5 and FC4 have serious problems booting on a MicroCenter PowerSpec MCE510. One gets an “not syncing” error with atiixp and ide-ios.

Purchased a MicroCenter PowerSpec MCE510 PC with an Intel Pentium D 805 2.66Ghz Processor w/ 1024KB x2 Full Speed L2 Cache.

The intent was to install the latest stable Fedora Core 5, however after probing the USB ports and heading to check out the IDE drives, the screen dumps a number of random characters and the kernel panics.

So, hard rebooting and backing off to Fedora Core 4, I get to the same point in the installation and discover this error message, which is unobscured:

Kernel panic – not syncing: drivers/ide/pci/atiixp.c:129: spin_lock(drivers/ide/ide.c:c03de668) already locked by drivers/ide/ide-iops.c/12. (Not tainted)

So, I back off and try Slackware 10, this seems to work.

Supposedly this problem existed in FC3, but was fixed. Dave Jones, however, points out this fix didn’t seem to make it up stream. It is curious to note that one comment says that this problem only happens when there is a DVD in the drive, not a CD. Sure enough, I have a DVD. (I have not tested this theory yet.)

I tried FC6-test, and that also had problems.

For now, I need to get work done, and will be using Slackware… however, I hope to revisit in the near future and see if I can find a work around.

UPDATE 08-Aug-2006: Found someone who claims they got a fix that worked — reburn the CD as slow as possible AND start the install with linux ide=nodma and someone else suggests adding noprobe as well. And, to date, only this comment of this thread seems to explain why this error happens. It seems to have been fixed in later kernels, but that poses a serious problem if you’re trying to install. In the voodoo category, someone says if you create an error in the boot prompt (like make it look for an image that doesn’t exist; e.g. type mediacheck), this somehow releases whatever lock it had, and then booting with linux mediacheck works; not many success reports on that solution. From what I can tell there are two threads: those who have FC installed and had a failure booting with an upgrades kernel (so they revert back and twiddle the source), and those who are trying to install Fedora in the first place.

Fixing BIND

Webmin wasn’t able to start bind, reporting that named issued this warning: “Starting named: Error in named configuration: none:0: open: /etc/named.conf: permission denied”

The problem was a permission problem, but not where I’d naturally go looking.

Recently I was asked to look into a problem involving BIND. DNS was not able to start via webmin, nor via /etc/rc.d/init, but named could could be manually started as root. While that works in the short run, that doesn’t solve the problem of the system surviving a reboot cleanly.

The only error named was reporting was:
Starting named: Error in named configuration: none:0: open: /etc/named.conf: permission denied

Obviously, this looks like a permission problem.

Normally, the trick, to solving it involves running named as root and looking at the error messages.
# named -g -u named

Problem is, as root, that worked. Not what I expected.

However, I found the problem and have a fix.

Bind used to run with the setuid bit, making it privileged, however in these security concious days, named now sheds its permissions. Even better, it is locked into a limited portion of the directory via chroot. That should be a big clue.

In FC4 and FC5, you’ll noted that /etc/named.conf is actually a symbolic link. It points into /var/named/chroot, where the process is jailed. In that directory you’ll find an a named, etc, and var directory. The etc directory mimcs all the needed files from /etc. The named directory has all the zone files. And the var directory has the pid and log files.

If named can’t run due to a permission problem, one should be looking under /var/named/chroot — which is how the process will see the world, not from /, like you do.

In my case, someone had run named as root, and that was enough to create a slave file in /var/named/chroot/var/named/slaves with an owner and group of root. Because the named process when running normally did not have permissions to replace this file with an update, named failed with a permission problem. I removed the file and was instantly able to start named from webmin as normal.

So there’s the trick. Look around in /var/named/chroot/var, /var/named/chroot/etc, and /var/named/chroot/named (and their subdirectories) and make sure all the things are readable to the named user, and the stuff that’s writable has the right owner, group, and permissions.

REMEMBER: when a config file says /etc or /var, it’s from the perspective of the chroot’d process — therefore you need to look where the process has been jailed to in the filesystem, and not what the path name looks like.

Making sudo work with Fedora Core 4 (and FC5)

How to make sudo work with Fedora Core 4 and 5.

I still use FC4 quite a bit, but was surprised that sudo appears to be broken. It doesn’t work.

Even after adding user entries to /etc/sudoers, sudo will authenticate, showing the password, but won’t execute the command. For instance, sudo bash drops me back at the unprivileged shell.

The “problem” is actually PAM. The Pluggable Authentication Module.

If you hop over to the /etc/pam.d directory, you’ll discover that you need a sudo file. If one does not exist, then PAM will use other; and doing a cat on that file shows the default policy is to deny.

The quick solution is to simply something that works, such as the sshd file:
# cp sshd sudo

Or, at a minimum for Fedora Core 4, you can use this content:


/etc/pam.d$ cat sudo
#%PAM-1.0
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth
session required pam_limits.so

Note, though that for Fedora Core 5, things change a little:

#%PAM-1.0
auth include system-auth
account include system-auth
password include system-auth
session required pam_limits.so

Make sure you set the perissions and ownerships correctly:

# chown root sudo
# chgrp root sudo
# chmod 644 sudo
$ ls -l sudo
-rw-r--r-- 1 root root 203 Jul 5 2006 sudo

Please note that there is a yum distribution. You can add sudo to your system with:
# yum install sudo

Watch for warning messages. /etc/pam.d/sudo might need to be replaced with /etc/pam.d/sudo.newrpm, and /etc/sudoers might need to be replaced with /etc/sudoers.newrpm. This is simply yum not wanting to step on any existing files. Yum is the preferred way of installing sudo with FC4 and FC5.

Force a Windows XP Shutdown

XP has a shutdown command… that’s useful.

I just got a new monitor from Dell, and after switching between a 21″ and a 19″ using the DVI connector, XP got all confused and couldn’t restore my video signal no matter which monitor I used. Even the analog monitor cable proved no use.

I was stuck with a number of running processes, and no way to shutdown the machine cleanly. Meanwhile, my computer chugged away, furious with disk activity from the applications that I had been running at the time. Killing the power was simply not an option.

The solution, was based on this clever article.

I press Windows-R, which I knew would bring up the run prompt. I typed cmd and pressed return, which I knew would put me at a shell. Then I typed shutdown -s -t 01, pressed enter, and waited.

The shutdown command appears to be a standard Microsoft steal of Unix’s shutdown command. The functionality is the same, but the parameters are slightly different as not to be compliant. (It’s like when they took Unix’s ifconfig and made it ipconfig, as if no one would notice.)

Anyhow, after a minute I heard the familiar sound of Windows shutting down, then the machine turned off. Upon a reboot, things worked fine – the hardware detection saw the new monitors, and Windows came up.

Yum: Cannot find a valid baseurl (solved)

The yum software package, used for upgrading software on Linux, can sometimes report a mysterious “Cannot find a valid baseurl for repo: extras” error message. Common wisdom says to twiddle config files or reinstall yum. Don’t. Here’s the solution…

Ran into a problem using Fedora Core 4 that went like this:

I was signed on doing a yum upgrade, and during the download my connection dropped. When I got back on line and tried to do it again, I kept getting an error that the baseurl could not be found.

$ sudo yum upgrade
Setting up Upgrade Process
Setting up repositories
Cannot find a valid baseurl for repo: extras
Error: Cannot find a valid baseurl for repo: extras

No amount of searching seemed to resolve my problem or tell me what to do next, though a handful of people had experienced the same problem. The common recommendation was to go to the /etc directory and twiddle the yum configuration files (or even reinstall yum). Hint: don’t.

What you’re seeing is actually actually a DNS failure. Bind is having problem resolving host names. A little bit of poking around with dig, and sure enough, it was clear that something wasn’t right.

In fact, while trying to ssh to the system in the first place, I recall it took a while for the login prompt to appear, yet another sign that reverse name lookups weren’t happening right.

The solution was to make sure that the DNS servers listed in /etc/resolv.conf were indeed serving correctly, and bouncing the named process with the /sbin/service named restart command as root.

Yum still didn’t work right, but that was because it had a dirty cache. So, I cleaned up everthing.

$ sudo yum clean all
Cleaning up Everything
25 headers removed
24 packages removed
12 metadata files removed
0 cache files removed
4 cache files removed

Then I tried the yum upgrade again, and with the cache cleared out, and the bind name service resolving DNS correctly, it worked like a champ. Yum was fixed, and I didn’t have to change a single configuration file for it.

Mylex DAC960PTL1 RAID Controller

Technobabble pertaining to using the Mylex DAC960PTL1 raid controller; useful for people who can’t seem to find a firmware update and are trapped, unable to delete volumes and arrays.

I’m working with some old equipment, specifically a P3 server that has a Mylex DAC960PTL1 raid controller in it running a 1999 version of EzAssist off firmware. I ran into a problem where I couldn’t delete a disk array nor a logical volume once created.

According to the manual, entitled RAID ExAssist Configuration Utility, User Reference Guide, DB13-000047-00 First Edition, 08P5519, by LSI Logic, there were delete menus, but I just wasn’t seeing them.

A little research showed that LSI Logic now owned the Mylex DAC960PTL1, and their download page, while showing plenty of DAC960 variations, did not have the PTL1 suffix. Turns out this is now called the AcceleRAID 250 controller, and drivers and firmware are available.

Turns out the problem was that I needed to upgrade the BIOS, EzAssist, Firmware, and Bootblock by using the latest Software Kit v4.04-02, dated December 20, 2001.

So I grabbed a copy of ez_assist404.zip, unpacked it to a floppy, and followed the directions in the readme, which consisted of booting, holding down Alt-R to bring up the existing EzAssist setup utility, and flashing the files off the diskette one by one.

Once I did that, I was able to manage the existing raid drives, both logical and physical, without incident.

For those curious, you set up the physical drives first, add them to a pool of storage called an array, and from there make logical volumes, which are then exposed to any operating system with a device driver for the raid card, such as Fedora Core 4 (/dev/rd/… which then has a controller/disk/partition notation for device names).

It took over a full day to locate this information and make use of it. Hopefully, documenting this save someone else the trouble.

Apple Pro Care

Line skipping — a benefit of Apple Pro Care that got me off the fence.

I had been a little discouraged by the Apple Pro Care recently. I attempted to get online and make a reservation with the Genius Bar, but every time I try that, I could never get a same day appointment.

Turns out that the Tysons Corner Apple Store has stopped taking reservations! Seems that people would make reservations from work at 3:PM, then show up at 4:45pm, and wonder why they aren’t being immediately seen.

Turns out Apple’s solution is fairly clever.

Last night I showed up at the store, and it was packed. Even the local access to the Genius Bar said no more appointments would be made. There was a long line.

However, having my ProCare card in hand. This got me instant priority access, and I shot to the front of the support line. Awesome.

I’d been using ProCare for access to big machines, professional software, and one-on-one tutorials. This is an additional perk — line avoidance. If I was on the fence, I’m not any more.

-wls

No Sound in Flash on Mac Intel (fix)

Fix for MacBook Pro when sound isn’t working from Flash in the browser.

Recently installed an update and discovered that Flash no longer played sound in my browsers on the Intel based MacBook Pro from Apple.

No idea why. Sound works elsewhere, including the browser for non-Flash (e.g., Quicktime) content.

Found the fix online: Open GarageBand, play a note or two on the keyboard, and quit. Whatever cleanup GarageBand does, fixes the sound problem — you don’t even have to close the browser.

Worked for me!