Fixing Windows 7 MBR

To free up disk space I recently did some shuffling on my PC that had an old version of Ubuntu Linux installed to dual boot with Windows 7. Since I have Ubuntu installed and available on other systems now I decided to remove this partition. After doing this and rebooting I was presented with a problem.

All I saw after the POST screen was: grub rescue>

I first thought about trying to restore the windows boot loader from grub but wasn’t able to find a quick solution. Then after doing a bit of searching I found my Windows 7 install CD and booted it up for a system repair. The repair option found no problems but I knew better. I opened the command line option.

With some google searching I found two tools that seemed to be related to what I was looking for bcdedit and bootrec.

It turned out that bootrec was what I was looking for. Running the following two commands restored my boot record and removed grub since I no longer needed it without Linux on this system. I found this article about bootrec on Microsoft’s site to be useful as well as this other one on technet about bcdedit to find it wasn’t what I needed this time. In the process I learned a bit about how the Windows boot process has changed since Vista.

These were the magic commands that worked for me. No guarantees they will work for you but if you aren’t worried about keeping grub or another boot loader around they shouldn’t hurt.

bootrec /fixmbr
bootrec /fixboot

After running these commands I was able to reboot and go right into Windows without a hitch.

Extremely Slow iPad upgrade to iOS 4.2

Now that iOS 4.2 is finally released I thought it would be an optimal time to upgrade my 16GB iPad to the latest and greatest OS. Like most Apple upgrades I’ve encountered in the past I figured this would be a fairly painless process. I guessed I’d be running new OS in roughly a half an hour. I have the most basic model of iPad after all.

When I started the process the first time I waited about an hour or so and saw a progress bar at what looked to be maybe 5% complete. I figured something in the upgrade process had frozen and I would need to restart the process. So I cancelled what was running and restarted iTunes then started again. This time I waited about two hours. The progress bar still only appeared to be about as far as the first time. At this point I guessed something was up. So I did a little searching on the friendly Google.

As part of an OS upgrade Apple forces a device backup. This is a resonable and probably wise thing to do. The only problem is that they have the slowest backup procedure of any modern system I’ve ever seen. This is a known issue that they will have hopefully fixed in 4.2.

After removing any magazine type applications I had installed I restarted the upgrade process. This time I let it keep running. Then about 20 hours later it was finally complete. So be aware that if your upgrade seems to be frozen it is likely still going but just taking a lot longer than you’d expect. I am using less than 10GB of space on my 16GB iPad so many users may see this take significantly longer than I did. Be prepared to allow this upgrade to go for a full 24 hours or more.

With this type of experience on the only device they have, I would hate to see what would happen if Apple had to support many different devices like Google or Microsoft will for tablets within the next year. Hopefully this bug has been fixed in the latest release so the upgrade to iOS 5 will be much smoother.

git fatal: write error: Broken pipe

Today I was trying to do a git push and was getting an error


Compressing objects: 100% (164/164), done.
error: RPC failed; result=22, HTTP code = 411
fatal: The remote end hung up unexpectedly
Writing objects: 100% (570/570), 6.08 MiB, done.
Total 570 (delta 276), reused 551 (delta 264)
fatal: The remote end hung up unexpectedly
fatal: expected ok/error, helper said '2004�f��,'�c6��}{�c�eM��#�>�'

fatal: write error: Broken pipe

The actual error message part changes if you try again thinking it might have been a network error.

The fix was to change git configuration to have a larger http post buffer of 100MB.

git config http.postBuffer 104857600

Thanks to github support.

Customer Service is #1

No matter how good or bad things get it is paramount to never forget about customer service. It is so easy to take good customers for granted and simply focus on the bottom line. In reality though, if you forget about customers and only focus on making money it will always come back to haunt you. Good customers are hard to win over and should be treated with respect accordingly. Don’t sell your business short by trying to make an extra buck in the short term. Don’t treat your good customers like a commodity. If you can see someone has been a good customer for a long time and has a simple problem to solve, solve it. Don’t waste their time or yours giving them the run around. These rules apply to you no matter what industry you work in.

Don’t let a bad economy be an excuse to treat others with less respect!

I’ve had several personal experiences lately that have reminded me of this fact. I hope companies and individuals alike are taking note. Those who treat others well regardless of the economy will prosper in the long run. I truly believe that being rude, providing poor service, and other similar behaviors never pay off in the long run. These tactics may work for a short period of time but not for the long haul. What’s more, isn’t it always easier to not deal with the extra drama that is caused by this type of behavior? I think so.

Warren Buffett on Investing Right now

My favorite investing quote I read recently was from the famed Warren Buffett in the New York Times.

Be fearful when others are greedy, and be greedy when others are fearful.

I believe Speculation usually doesn’t pay off in the long run. As I’m sure Warren would probably also say it’s always better to stick to fundamentals. A company that was worth investing in two months ago when things weren’t quite so bad is probably still a good investment. Probably just a lot better deal now.

Ruby doesn’t like mysql x86_64

After trying to get the mysql gem working on my new macbook in Leopard, I realized that although I can get the gem to compile correctly it still doesn’t work with the mysql 64-bit version. This realization mostly came from searching and finding this useful blog post.

I reinstalled the 32 bit version of mysql and then recompiled the mysql gem. Then magically things started working the way I needed them to. Hopefully this can get fixed in a future version of Ruby.

Here is the command I had to use to finally install the gem properly.


sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-mysql-lib=/usr/local/mysql/lib --with-mysql-dir=/usr/local/mysql --with-mysql-include=/usr/local/mysql/include

Notice the i386 arch. I was previously using x86_64 as the arch which compiled properly and appeared to work until you actually tried to use the gem in ruby and got a stack trace.

Apple Migration Assistant makes upgrading painless

I have had a macbook pro for about 2.5 years now since the first intel based macs were introduced. Last week I decided to get a faster machine with more ram and hard drive space. So I went to a macbook. Yes, I have a smaller screen and not quite as good of video. However, I was able to upgrade the RAM to 4GB and HD to 320GB in about 15min and both are working great. I’ve been very happy with the machine so far.

Tonight I decided to try out the Migration Assistant. For some unknown reason I’ve never used it in the past when I’ve upgraded my mac. After using it though, all I can say is wow! Why haven’t I used this tool before? What is so amazing to me in contrast to Windows machines is how well it works and how easy it is to use. Also as far as I can tell so far it appears to have transfered everything just the way I told it to. This includes all my files, custom settings, and even applications. Although it technically should be possible to transfer appliations between Windows machines, in most cases it isn’t even an option. Whenever I have moved from one Windows machine to another I end up having to reinstall all the applications. The only thing that really moves well on Windows is files such as documents and other application data. The applications themselves though don’t like to be moved.

With Migration Assistant, the fact that applications can be moved is huge for me since reinstalling all my applications usually takes at least an entire day if not more. Whats more, its really something that isn’t fun and frankly shouldn’t be necessary to redo every time I move to a new computer.

So far I’m completely sold on Migration Assistant. It has definitely made this the least painful upgrade I’ve ever experienced. I’ll have to see if I’m still as impressed after making sure everything really does work over the next week or two.

Using Sun Java with Ubuntu 8.04

I wanted to use sun java with ubuntu instead of openjdk. So I installed the latest package sun-java6-jdk (or sun-java5-jdk). The java command /usr/bin/java still points to openjdk though. This is where update-alternatives comes in. This is a pretty slick solution to the problem where multiple packages provide the same command. Like the case I had.

I only had to run a couple commands
update-alternatives --display java
This command tells me what of the commands installed is the highest priority. If I want sun java to be the highest priority then I just need to make the number higher. In my case the number for openjdk was 1061. So then I just ran the following command.
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-6-sun/jre/bin/java 1100
After this I run:

$ java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)

Quick and elegant solution. What more can you ask for. Linux is amazing when you know what to do.

Another reason Firefox is better

For some reason I’m having trouble logging into the Oracle site today. This is frustrating. Luckily though Firefox gives me a hint of why there is a problem. I get a somewhat useful error message.

firefox_error

In IE though the request seems to just go forever with no error and no progress. I’d rather get an error than the illusion that something will eventually happen when it won’t.

Hopefully in the meantime Oracle can fix the login on their site so I can download Oracle XE. How does something as critical as login break on a site like Oracle.com? I thought they were supposed to be the example of high availability and reliability.

Good Points from KDE 4.0 Keynote

I loved the points that were made in the KDE 4.0 Launch Keynote. They apply to almost any software development in my opinion.

  • Own your data
  • Choose your vendor
  • Explore, create and learn

Web based systems especially fall into this boat. Users should feel free to change. They shouldn’t feel locked in. Otherwise they will lose trust in storing their data on the web and using web based systems in general.