Monday, May 21, 2012

Do you keep your Apple ID secret?

As if erasing my operating system this weekend weren't enough. Late last week, Apple also managed to burn two of my passwords for my Apple ID account. Here's the feedback I sent to Apple:

First a brief introduction. I'm a software engineer and director of DevOps at my company. I have a masters degree in computer science with emphasis on secure networks and cryptography.

I recently encountered a fundamental problem with the password policy of Apple IDs. My password was "disabled for security reasons", allegedly due to to many incorrect password attempts, even though I assure you I did not enter the incorrect password even once on any of my devices.

So it seems that someone or something else has triggered the disabling of my account. As a result, I was forced to change my password.

In other words, because someone failed to guess my secure password, you force me to change it to something else. And furthermore, Apple refuses to tell me anything about when or where (physically or virtually) the failed attempts originated.

Do you see the problem with this scenario? Something completely out of my control causes me to have to reset my password (and never use that password again). Every time this happens, as a user, I'm going to be more inclined to choose a less secure password than before, because obviously the security of the password is irrelevant, but if it's going to be changed arbitrarily, I don't want it to choose something hard to remember or mutate.

To make matters worse, I changed my password on Thursday night, but by Friday night, my *new* Apple ID password was no longer recognized.

According to the support representative I talked to today, this issue was my fault because I failed to sign out and sign back in with the new password on each application that uses my AppleID. Let me just briefly list all of the places I've discovered (so far) where I'm supposed to change my password every time my password is arbitrarily disabled and reset:

- App Store (iPhone)
- App Store (iPad)
- iMessage (iPhone)
- iMessage (iPad)
- FaceTime (iPhone)
- FaceTime (iPad)
- iCloud (iPhone)
- iCloud (iPad)
- Game Center (iPhone)
- Game Center (iPad)
- Web Browser (Windows Desktop)
- Web Browser (Windows Laptop)
- Web Browser (Mac Laptop)
- iTunes (Windows Desktop)
- iTunes (Windows Laptop)
- iTunes (Mac Laptop)
- iCloud Control Panel (Windows Desktop) [and it loses the settings when I sign out and sign in]

And there are probably other places I haven't yet remembered. But you see, according to the rep, it's my responsibility to change it in all of the places it exists, or else Apple will disable my account again, and I will be forced to change my password again, and the process starts anew (plus one more burned password).

What makes matters worse is I tried to resolve this situation using online resources, and then e-mail support, and then genius bar, and then phone support, but none of these avenues was able to answer my questions (why did this happen?) or allow me to resolve the situation to my satisfaction (restore my account with the secure password I've used for some time or my new secure password and prevent this situation from happening in the future). In fact, I was told I can expect this to happen again unless I change my Apple ID (and that's the same answer they'd give to Tim Cook). What a terrible experience.

I'm really regretting buying into the whole Apple ID. Please route this message to the appropriate department so these issues can be considered for improvements to the Apple ID password policy.

In the meantime, I'll try to forget the hours of grief Apple has cost me this weekend.

I didn't mention in the letter that I asked what would happen if someone had my Apple ID and was causing my password to get disabled. The representative indicated I would have to get a new Apple ID. That's right folks. Keep your Apple ID secret (the username). Hide your screen when you're prompted to enter your Apple ID password. Because if the wrong people get a hold of that Apple ID, and (ab)use Apple's site to burn your password, you'll be forced to go through the whole mess outlined above.

Which begs the question - does Tim Cook have to deal with this problem if someone gets his Apple ID? I'm not suggesting that anyone should track down Tim Cook's Apple ID and try bogus passwords until his account is locked out, but I suspect if that happened often enough, Apple would probably devise a better solution than what they have now (which is bullsh**).

Goodbye Apple

My MacBook Air is now for sale. Here is the feedback I sent to Apple following my ordeal this weekend, entitled Lion upgrade corrupted my Windows partition:

There are many reports out there of how an upgrade from Snow Leopard to Lion corrupts a Windows Boot Camp partition (usually beyond repair). This happened to me this weekend. I went to the Apple Store to find out what options I had to upgrade my Boot Camp drivers, and he said my only option to get ongoing upgrades for Boot Camp was to upgrade to Lion. So I did, but instead of getting the drivers I needed, I lost my Windows partition.

This is an issue that was reported last year when Lion was released, but Apple seems to have just ignored the problem, allowing their software to corrupt Windows partitions created by the Boot Camp assistant.

This disdain for your Windows users is reprehensible. That you could allow your software to continue to corrupt installations like this for 10 months after the issue was reported is nothing short of irresponsible.

At the very least, the Lion upgrade should detect a Boot Camp installation and warn that it might corrupt the Windows partition. Even better would be to safely resize it rather than writing over it. What good is a recovery partition if it's written over the data you care the most about?

For me, this is the end of my relationship with Apple for my computing platform. I am selling my MacBook Air and will be getting a Windows laptop. While the hardware is nice, it's not worth the grief of actively destructive software.

I do advanced software and systems work. I've done custom partition management on PCs for years. I've upgraded Windows operating systems for years. Still, I've never encountered a situation where an operating system would overwrite a user's partition without extensive warnings and prompts. Apple is now permanently on my black list.

Wednesday, January 11, 2012

How I install Python on Windows

I've wanted for some time now to document the process I use to install Python and develop, but on Windows. First, let me give a brief background.

I tend to use Windows and I've been programming in Python since 1997. I also tend to use a lot of Unix conventions, especially where they don't create a major incompatibility with Windows. I don't use compatibility layers like Cygwin, though. I find they create more trouble than they're worth. So where possible, I use native implementations of everything. I'm a command-line junkie, and I try to automate everything. One of the best things about Python is its cross-platform support. I've never encountered a better general-purpose language for cross-platform development.

So over the years, I've developed some routines to automate the installation and configuration of Python on my systems. Ever since Python 2.6 and Windows Vista, life has been pretty good. Vista added support for symbolic links and Python 2.6 had excellent 64-bit support.

Since then, I've install almost exclusively 64-bit versions of Python. In this article, I will assume one is using Windows 7 x64, although the routines generally translate to x86. The biggest challenge to using 64-bit Windows is access to compiled modules. To the best of my knowledge, it's not possible to compile 64-bit extension modules without the full version of Visual Studio.

Most Python programmers will find that having several different Python versions present is useful if not necessary. I typically install the latest Python 2 and the latest stable Python 3.

As any Python programmer knows, having distribute is a nearly essential part of any Python installation, so the installation routines should include support for installing distribute as well.

So to accomplish all of this, I needed a scripting language that comes pre-installed with Windows. Originally, I used cmd scripts, but found those not quite adequate. Bundled with the fact that PowerShell 2 comes with Windows 7, it became the language of choice. I developed this script. If you run that script in a PowerShell, it creates three functions:
  • InstallPythonMSI $installer, $target
  • get-python-version $version
  • bootstrap-python
InstallPythonMSI is simply a helper function used by get-python-version. It basically executes a Python .msi file so that it installs silently to the target location. It was not easy generating that code to work properly to pass the parameters to msiexec with quotes in the right places.
get-python-version completely automates installing a single Python version to an appropriate location in $env:ProgramFiles. The script assumes 64-bit, but can be easily modified to support 32-bit. It then also installs distribute by executing the bootstrap script directly from the server, enabling support for setuptools-packaged files.
Finally, bootstrap-python sets up some symbolic links and resets the file associations to create an authoritative (default) Python installation. By default, Python installs into C:\Python27 or similar. I've argued that this location is not appropriate and that the proper location for programs (including Python) is $env:ProgramFiles, so that's where I install it (after all, how do you differentiate between 32-bit and 64-bit versions of Python 2.6?). However, it is useful to have a symbolic link from an easy-to-type location. So bootstrap-python creates a symlink at C:\Python which refers to the "active" version of Python. It then installs jaraco.windows and uses one of its command-line scripts to set some environment variables (such as adding the Scripts directory to the path and registering .py files as executable scirpts). Then, bootstrap-python resets the file associations by calling this Python script.
What this all means is that running Python.exe or running scripts installed in the Scripts directory will use the active version of Python (whatever C:\Python points to). This configuration also means that one can easily switch the entire system Python environment from one version of Python to another by just repointing a symlink. To automate this process, I've created this Python script, which I call 'pythonver.py'. I usually place this script in a separate location somewhere on the search path (C:\Windows would work). The script searches $ProgramFiles and $ProgramFiles(x86) for PythonXX directories and then allows the user to select one of those, then repoints the C:\Python symbolic link at that version.
The end result is one can install multiple versions of Python in both 32-bit and 64-bit versions and rapidly switch the active version. Of course, it's also possible to select a specific version directly using its canonical location (e.g. C:\Program Files\Python32\python.exe).
With these few scripts, I can rapidly install, bootstrap, and switch between Python versions.
I hope sharing some of these techniques will give some useful techniques that I enjoy using to automate deploying Python on my Windows servers and workstations.

Sunday, January 8, 2012

What would incite me to buy yet another Macbook Air

Last year, I bought my first Mac hardware. Since then, I've found the experience to be mostly wonderful. I love the MagSafe power connector, the SSD drive, the multi-touch Trackpad, and the overall engineering of the hardware.

I've managed to work around most of the rough edges running Windows on this hardware, but there are still three issues that regularly annoy me, and which give me great hesitance when considering another Macbook.

Swap Fn and Ctrl Keys. If the Macbook would provide a way to switch this in hardware. My fingers are trained to find Ctrl in the corner. That's where it is on my desktop keyboard. I'd like it to be in the same place on my laptop.

Clumsy Trackpad driver. The Boot Camp driver for the trackpad has some poor behaviors (compared to any other pointing device I've used).

No HiFi Bluetooth Audio support. I recently found there is no A2DP support for the bluetooth adapter integrated with the Macbook Air (or any MacBook on Windows for that matter).

If Apple were to fix these three issues, it would shift the balance in my hesitance and I would rush out and upgrade my laptop now to another piece of Apple hardware.

Tuesday, July 19, 2011

Unix doesn't support spaces in filenames

I was creating a job on my Linux-based Jenkins server today, when I encountered an error with a Python virtual environment. It turned out the problem was that the Jenkins job had a name with a space in it, which means the workspace had a name with a space in it, which means the virtualenv had a name with a space in it, which means the scripts created in that virtualenv had a hash-bang with space in it... and bash doesn't support hash-bangs with spaces in the interpreter path.

Consider this simple example. There appears to be no specification for the hashbang, but after some searching, I did find a page that indicates there is no supported mechanism for specifying a space in the interpreter name.

That's a shame. That limitation then bleeds through to almost every other aspect in Unix programming that it basically means Unix does not support spaces in filenames.

Monday, July 18, 2011

Passing a round fruit through a square hole

I recently was in the market for a new laptop. Android cellphones were starting to outpace my old laptop, and I was finding myself spending too much time waiting for the machine and money keeping the batteries replaced.

I had in mind pretty much what I wanted: a lightweight, about 12" laptop with decent specs. It should run 64-bit Windows with 64-bit VMs, have at least 4GB of RAM, a video camera, gigabit LAN, and an SSD. I searched online and browsed the stores when I went by, but nothing stood out at me... except the Macbook Air.

I had heard good things about the multi-touch trackpad. I'd seen the space-age MagSafe power connector. I could use my iPhone headset directly in the headphone jack as a headset. And the profile just looked right. I was worried that the no-button touchpad might be a problem, but according to reviews, the Bootcamp drivers gave multitouch support in Windows, and the consensus seemed to say it was a suitable, though expensive, platform for Windows.

I looked seriously at the Asus laptops, but they were lacking the gigabit LAN and I couldn't find one with an SSD. Everywhere else I looked, it seemed like the vendors (Dell, for example) were failing in their sales of ultraportables, in large part because they couldn't compete with the Macbook Air.

So I caved. I decided I could do without gigabit LAN and I bought a Macbook Air 13" to replace my Dell Latitude X1. It's a little bigger than I would have liked, but the 256GB over 128GB storage and an SD slot made it an easy choice.

When I got it, the first thing I did was shrink the MacOS partition to 20GB and install Bootcamp and Windows. It worked fairly well at a basic level. It was super fast. The Bootcamp 3.2 drivers supported all of the hardware. I was up and running in just a few hours. Almost immediately, though, I started to run into problems.

Right off the bat, the space bar was intermittent. I thought at first I was just not used to hitting the space bar in the right place, but when I went to the store, I found other Macbooks did not have this problem. So I exchanged it for another.

The replacement had a nice solid spacebar, but the up key scrapes against the metal keyboard frame. It's irritating, but bearable.


keys to the kingdom

Another surprising thing is the laptop doesn't have any indicators other than capslock. There's no power light, no hard drive light, no number lock (in fact no number pad). And speaking of missing buttons, the macbook is missing a whole lot of keys. There's no button for "page up", or "end", "backspace". The bootcamp drivers substitute "delete" for backspace an then expose Fn+delete as delete, but it's a clumsy hack. Many of the buttons are available as combinations with the Fn key, but there are some keys (Pause/Break, number pad) which aren't available at all.

I know the laptop wasn't manufactured for running Windows, but if you are used to running Windows on a PC, the Alt and Windows keys are switched (and in my opinion, the Fn and Ctrl keys could be switched too). Sure, there are programs to switch the keys in software, but these programs affect all hardware, so I can't easily alternate between an external keyboard and the internal keyboard.

This is the same complaint I've had about the mobile devices - they don't expose enough user interface for a professional developer to really excel.

how are you with keyboard shortcuts?

As if the problems with the keyboard weren't bad enough, there appears to be a bug in the trackpad driver that causes it to fail occasionally when coming out of standby. I contacted their customer care about it, but they insist it's a Microsoft problem and refuse to support it. So I just have to randomly restart my computer about once out of every 10 uses.

pocket rocket

There also appears to be an issue with charging the laptop. I'll have the laptop in standby (with the lid closed) and then plug it in to charge. After a minute of two of charging, the laptop will come out of standby, even if it's zipped up in its insulated bag. It'll then sit there and cook inside the bag, even if the power is subsequently disconnected. It's done this several times and gotten the temp to be untouchably hot. I've learned not to plug the laptop in unless I have it on a suitable surface for running and to double-check that it's suspended before packing it up. Of course, without any indicators, it's all but impossible to know for sure.

premium hardware

One of the major reasons I selected the Macbook was because I could see the superior manufacturing quality. Or at least, I convinced myself of such. The devices are beautiful and elegantly engineered, but when it comes to durability, it's another story.

Only a couple of months into owning the laptop, the screen died. If you divide the screen into 6 even vertical segments, the second of these segments stopped functioning. This happened while I was using the device while sitting in bed. I had the laptop on a smooth surface, so it was running cool. It was stable and had taken no abuse. Then spontaneously, the screen failed.

I do give kudos to Apple for a rapid replacement. I took the screen to the store on Saturday afternoon and it was repaired with a new screen by Sunday morning.

Still, I feel the Apple quality is mostly superficial and doesn't go deep to the underlying hardware.

Overall, I'm pleased with the device. It serves its purpose (as a secondary, portable workstation). I acknowledge that some of these shortcomings are because I want to run Windows on the device, but many of these would apply even if I were running MacOS.

As a professional, I feel the Mac platform just doesn't cut it. It hides and abstracts too much of the system, sacrificing functionality for simplicity. I was not aware I was making this compromise when I purchased the Macbook Air... and I'll think long and hard next time I have this choice to make.

Monday, November 29, 2010

eBayer Beware - Gift Shopping on eBay riddled with shipping challenges

I've been trying to post more positive messages, but I promised eBay I would share my experiences.

Yesterday, I won an item for my grandma on eBay. After winning, I used the eBay iPhone application to checkout. As I do, I'm not given the opportunity to change the shipping address. Apparently, one must change one's shipping address before winning an item, or it will be shipped to the default shipping address. ...and if you're keen enough to realize that you haven't been given the opportunity to have the item shipped to your preferred destination after checking out, eBay makes it difficult to find the contact information for your seller, adding extra hassle and delay in resolving the issue.

Here's the chat transcript. Please pardon the formatting - the eBay chat system didn't let me retrieve the chat transcript in any nicely-formatted format.

16:30:55 Customerjaraco
Initial Question/Comment: Bidding/Buying
16:31:00 SystemSystem
Thank you for contacting eBay Live Help!
16:31:00 SystemSystem
Please hold for the next available Live Help Agent.
16:31:55 SystemSystem
We appreciate your patience. Please continue to hold for the next available representative.
16:32:55 SystemSystem
We apologize for the wait. Please continue to hold while we connect you to an agent. You should be connected soon.
16:33:35 SystemSystem
Mel M. has joined this session!
16:33:35 SystemSystem
Connected with Mel M.
16:33:39 AgentMel M.
Hello, thanks for waiting and welcome to eBay Live Help! My name is Mel. How may I help you? We are currently experiencing an unusual high chat volume. We thank you for holding and we are sorry for the inconvenience.
16:33:52 Customerjaraco
Hi Mel. I bought an item on eBay and checked out using the eBay app for the iPhone.
16:34:12 Customerjaraco
When I paid, I don't think I was given the opportunity to select another shipping address (or if I did, it was hidden).
16:34:33 Customerjaraco
After a night's sleep, I realized that the incorrect address was on the shipment.
16:34:53 Customerjaraco
So I attempted to contact the seller... but I only received a generic response 8 hours later saying the item was shipped.
16:35:12 AgentMel M.
I understand you would like to edit that shipping address, right?
16:35:34 Customerjaraco
I'm really frustrated that I think now the item is going to be shipped to my home instead of to my grandma.
16:36:00 AgentMel M.
May I have the item number please so I can check?
16:36:11 Customerjaraco
110615661910
16:36:46 AgentMel M.
Thank you. I'd be happy to look into this for you and do you have an additional question I can check as well?
16:37:20 Customerjaraco
No. just that.
16:38:56 AgentMel M.
May I have your current shipping address please?
16:40:13 Customerjaraco
****
Albuquerque, NM 87105
16:40:22 Customerjaraco
That's the address i want it shipped to.
16:40:42 Customerjaraco
The address that was on the payment receipt is
**HOME**
Washington, DC 20009
16:41:16 AgentMel M.
Indeed that **HOME** address is the one showing in the order details page.
16:43:06 AgentMel M.
The item is not showing as shipped yet. I'd suggest to call the seller. I'll show you how to get his phone number.
16:43:40 Customerjaraco
Yes please.
16:43:51 AgentMel M.
It's easy to request for your seller's phone number. Here's how:

1. Click "Advanced Search" at the top of the eBay.com homepage.
16:44:06 AgentMel M.
2. Click the "Find Contact Information" link on the left side of the Advanced Search page.
16:45:06 AgentMel M.
3. Enter the seller's User ID and the item number.
16:45:36 Customerjaraco
alright. I did that.
16:45:45 Customerjaraco
It says it's sending me an e-mail.
16:46:46 AgentMel M.
Please check your email and the phone number will be there.
16:47:43 Customerjaraco
aah. great. Thanks.
16:47:50 Customerjaraco
I'll give her a call. I hope there's a way to stop the shipment.
16:48:21 AgentMel M.
He hasn't printed shipping label yet so most probably it's not yet shipped.
16:48:23 Customerjaraco
In the meantime, is there any way I can simulate paying for another item, so I can determine where I went wrong paying for this item?
16:50:52 AgentMel M.
Let me check your shipping address on file if it's current.
16:51:15 Customerjaraco
I just called and the package has been shipped.
16:51:31 Customerjaraco
Perhaps she didn't print the shipping label through eBay.
16:51:41 Customerjaraco
In any case, it's already gone to the post office and has a tracking number.
16:51:58 Customerjaraco
Unfortunately, the post office won't let me do anything with the package until I receive it, so I'll have to pay to ship it again to my grandma.
16:52:31 Customerjaraco
I'm really frustrated that by checking out on my iPhone, I don't remember seeing any place to set the shipping address before completing the transaction.
16:53:33 Customerjaraco
What's even more frustrating is that I tried to find the best contact information for the shipper this morning, but all I found was the e-mail address. I didn't know I could call the shipper.
16:53:56 AgentMel M.
I understand where you're coming from but since your shipping address on file is **HOME** Washington DC, that's what was reflected on the order details.
16:54:29 Customerjaraco
Exactly. That's where I would normally have things shipped, but for this order in particular, I wanted to have it shipped to my Grandma in NM.
16:55:43 AgentMel M.
Before purchasing an item, check the shipping address on file if that matches the address you want an item be shipped. If not, you need to change it prior to purchasing the item.
16:56:21 Customerjaraco
Do you mean it needs to be changed before winning an item or before making payment.
16:56:23 Customerjaraco
?
16:56:48 AgentMel M.
Exactly.
16:57:01 Customerjaraco
My concern is that i checked out using the eBay app on the iPhone, and i don't think I was given the opportunity to change the shipping address while making the payment.
16:57:19 Customerjaraco
If I was given that opportunity, it wasn't obvious how.
16:57:49 AgentMel M.
You need to change the shipping address prior to bidding on the item.
16:57:59 Customerjaraco
That doesn't make sense.
16:58:18 Customerjaraco
What if I'm bidding on two items that need to go different places? I've never had to change my shipping address prior to bidding.
16:58:24 AgentMel M.
Once you win it, regardless if you're using a desktop or ebay mobile, changing the address won't be an option anymore.
16:58:45 Customerjaraco
That's a horrible system.
16:59:04 AgentMel M.
You need to contact the seller immediately to let them know that it should be shipped on anther address as it will show the address on file.
16:59:19 Customerjaraco
It's too late - I don't think you're reading my messages.
16:59:35 Customerjaraco
I contacted the seller and the item has already been dropped off at the post office and the post office is closed.
16:59:45 AgentMel M.
I am understanding it.
17:00:10 AgentMel M.
For that shipped item, it can't be stopped anymore but if this happens again, that's what I am referring to.
17:01:14 Customerjaraco
I'm really disappointed with eBay.
17:01:47 AgentMel M.
I'm sorry to hear about the frustration that this matter caused you. But this is how the bidding and buying works.
17:02:02 Customerjaraco
1) I couldn't change the shipping address on checkout. (2) I couldn't easily contact the seller after I realized that the wrong shipping address was used.
17:02:30 Customerjaraco
These are both things that eBay could have facilitated, but didn't. This results in me having the hassle and expense of having to re-ship the item.
17:03:11 AgentMel M.
Contacting the seller is easy but the seller should immediately read the email you sent.
17:03:42 Customerjaraco
The seller prepared the shipment last night, but did not read e-mail all day today.
17:06:04 Customerjaraco
So you're saying the seller is required to check e-mail before finalizing shipment? Are you saying that this situation was caused because the seller didn't read e-mail?
17:07:06 AgentMel M.
The seller is encouraged to check emails but we don't have control on when they will check their emails.
17:07:41 Customerjaraco
Right. So if eBay had given me the choice to select a shipping address or if eBay hadn't made it so difficult to find the seller's phone number, this situation could have been avoided.
17:08:04 Customerjaraco
For that reason, I would like eBay to refund my shipping charges (as a courtesy for me having to re-ship the item myself).
17:11:18 AgentMel M.
We do not give credits for this kind of situation.
17:11:43 AgentMel M.
As a buyer, you updating shipping address is a must if you want an item to be shipped to the right address.
17:13:05 Customerjaraco
Very well. Thanks for the hassle. I'll be sure to warn others about the dangers of buying through eBay. eBayer beware.
17:13:12 Customerjaraco
Goodbye.
17:14:34 AgentMel M.
You're very welcome. It's been a real pleasure chatting with you today and I am glad to explain this issue on a wrong shipping address. We value your business and have a great night.
17:14:34 AgentMel M.
Thanks for using eBay Live Help! To close this chat window, go ahead and click on the "Exit" button whenever you're ready.
17:14:39 SystemSystem
Mel M. has left this session!
17:14:39 SystemSystem
The session has ended!
Send
The session has ended!
Session ID: 25724844
Question40
Pick one of the following options:
    OK     Cancel