Thursday, December 3, 2015

Dual boot Linux and Windows 10 with UEFI

I have had issues in the past trying to get Windows 8+ to coexist with Linux Mint on a machine with UEFI.

The following steps worked for me on an Asus q400a laptop.

  1. BIOS has CSM on and fastboot off
  2. Within Linux I used gparted to format a USB stick with a GPT partition table as fat32. Then I opened the ISO file for the windows installer and copied all the files onto the USB stick.
  3. I caught the bios with f2 and move up the boot device for UEFI: My_USB_stick (it was ADATA in my case)
  4. I installed Windows and then subsequently upgraded to Windows 10 which is still currently free for 7 and higher users.
  5. Shrink the drive for Windows 10 to free up some spare space. The Linux installer I used was not aware of the Windows 10 installation so it couldn't shrink it for me.
  6. Using the same GPT partition table USB stick, delete all the files from it and then extract the files from your Linux ISO onto it. 
  7. Windows 10 made it so I couldn't get to the bios, so I used the instructions here to go into troubleshooting mode
  8. Once in the BIOS, I again selected the UEFI: My_USB_stick and ran the Linux live installer.
  9. In the installer I selected the "do something else" partitioning option and created a primary ext4 root mount "/" using all but 8GB of free space (the amount of my RAM). I then created a logical swap partition containing the rest. I also set the device to "use as bootloader" to the EFI partition Windows had created.
  10. I rebooted and grub popped up letting me pick my OS as I see fit.
  11. Just to be as "secure" as possible, I disabled CSM in the bios so only UEFI is allowed. The only thing this seemed to change is that I get the windows loading circle below the ASUS logo as it launches Windows 10.

Missing windows key sticker

I wiped my OEM installed copy of windows from my ASUS laptop (to install Linux) and deleted the recovery partition. Also, the key is missing because it rubbed of the sticker. I wanted to put Windows on in addition to Linux.


  1. Use Linux to extract the key from your laptop firmware. It's still in there, and that is how the OEM disk gets it when you re-install. It just takes a single command run as root to get at it. With that key you can then install a generic copy of Windows which you can get from Microsoft. So either boot up linux on the computer or run it from a live disk (no install required).  Then run sudo hd /sys/firmware/acpi/tables/MSDM
  2. Next go and download the installer for your version of Windows. In my case I needed windows 8. This could get into a bunch of other issues since the installer I could get from MS is really an 8.1 installer which may not take my 8 OEM key. The solution in that case may be to install with a generic key first and then swap in my OEM key. The subject is well explained in this reddit post. I lucked out though, and it picked up my OEM key no problem (this may have been because I upgraded to 8.1 at some point in the past).
  3. Now install and enjoy.
  4. And if you are still in the Win 7 or 8 upgrade window, maybe consider upgrading to Windows 10.

Wednesday, April 8, 2015

HOWTO: GIT Subtree Merge

This one is a quickie. If you need to merge the contents of one git repository as a subdirectory of another project, you can use this strategy.

Saturday, March 28, 2015

HOWTO: Set up an awesome OTA DVR [Tablo]

I am nearing the end of my contract with Dish, and I have finally convinced my wife to get on board with getting rid of traditional TV for good. There are a lot of ways to go about this with various products and streaming services. We ultimately decided to use Amazon Prime (which we already use for shipping benefits), Netflix, HBO Now (after the Apple lock-in ends), and a DVR system for over the air (OTA) TV.

The over-the-air DVR was a necessary to avoid paying for pricey series which could be obtained for no cost beyond that of the system used to acquire and record antenna signals. I mean, they are literaly in the air around us. For example, the first season of the Flash was almost $40 on Amazon when I checked. We also wanted iZombie, The Blacklist, Grimm, Last Man On Earth, Front Line, and Law & Order SVU, 60 Minutes.

I initially tried out a roll-my-own system with MythTV and the hdhomerun connect tuner, but it proved to be a painful setup. That tuner also sent a large mpeg2 stream to the MythTV backend for recording which had to either be transcoded after recording or on-the-fly by the Plex software I used to serve it up to my streaming devices. The problem was that my hardware was not powerful enough to support recording and transcoding too much at once, and it led to choppy playback. On top of that, I wanted something a little simpler to manage that would work with my Roku 3 and Fire TV Stick (and my Chromecasts to a lesser extent).

Anyway, it turned out better than my satellite DVR in many ways, and I would like to spread this information so people can enjoy such an awesome device and awesome savings. One thing to note is that you will want to factor in the cost of the program information in the electronic program guide (EPG). While the device can do timed recordings without it, it really makes the Tablo shine as far as finding content and making the unit easy of use. The folks at Tablo currently charge either $5/mo, $50/yr, or $150/lifetime (your lifetime, not tied to the device) for such subscriptions. These subscriptions are pretty standard and can be found with alternatives like MythTV, Simple.TV, or Tivo's devices. For me this wasn't a huge deal since even the lifetime subscription was only twenty bucks more than my highest ever satellite bill towards the end of a two-year contract (with HBO).

The Antenna

Initially I tried a little flat AVANTEK antenna similar to the popular Mohu Leaf after antenna websites recommended that something this was all I really needed. While these may work well for many other folks in many situations, it came up short for me even when I mounted it in the attic. It picked up very few channels perfectly, and it was missing ABC entirely. Also, I had intermittent distortion which may be related to living near an airport under a flight path.

I did a lot of research after that, and eventually settled on the affordable RCA ANT751with a run of quad shielded which I got in a two pack of 25 ft lengths from Cable Matters to reduce signal loss and interference. After I mounted it in the attic (which is where I had my previous flat antenna) I went from 10 channels to 53. 

Antenna Installation

In preparation for selecting your antenna and aiming it if it is directional, websites like TV Fool or Antenna Web can be very helpful. Specifically for aiming, TV Fool's signal locator tool can provide the appropriate heading of where to point your antenna for the best results. The term for this directional heading given in degrees is azimuth.  Then take the azimuth value and punch it into a free aiming app. Antenna Pointer for Android was quick, free, and easy to use for this.

In my case, my antenna required some assembly as far as unfolding some of the poles on the mast, attaching end caps on the mast, putting together the base, attaching a transformer with the coaxial output.

After reading about the importance of mounting your antenna as high as possible for avoiding obstacles and receiving a clear signal, I mounted the base high up one of the structural beams under my roof with some screws placed into pilot holes drilled into the wood. Then I followed the instructions to make sure the upright tube coming out of the base was level before attaching the antenna mast. While tightening the mast to the upright, I placed my phone flat on top of it with the top of the phone pointed towards the small end of the mast. I nudged the mast left and right and adjusted while tightening watching the azimuth readout in the Antenna Pointer app, and I was reading within a degree of my specified 126 degree azimuth.

The Tablo

That pic is my wall-mounted Tablo in my home's central networking cabinet located in my laundry room. Since it is a network device and not something that attaches directly to the TV, you can stow it somewhere out of the way in contrast to other products like the Channel Master DVR+ devices made to be used directly attached to a TV.

The Tablo is available in a 2-Tuner model or 4-Tuner model with a price difference of around $100 when I purchased mine. I opted for the 4-Tuner version after reading that a tuner is used to transcode video for streaming out over the internet. However, a tuner is not used for streaming recorded content within the home since it is transcoded to a usable format for local streaming at recording time. Aside from the remote streaming scenario, tuners are used while a program is being watched live or recorded.

For storage, you will need to attach your own USB hard drive since the Tablo does not use built-in storage. This means you will need to factor an additional cost if you don't already have an external USB 2 or 3 hard drive which is compatible, but it also means you don't have to crack open the Tablo to replace the hard drive when it fails. The drive failed in my Dish Hopper last year, and I had to wait for them to ship me a new unit to be able to record programs again. In the future, I could just go out and buy a compatible replacement drive. For compatible drives, check their guidelines. In my case, it just so happened I had a compatible spare WD Elements 2 TB USB 2.0 Desktop External Hard Drive laying around.

Anyway, you need to connect the Tablo wirelessly or via ethernet. I would strongly recommend ethernet for something making such heavy use of the network to serve up streaming content. On that note, you will need to have a good quality home network for streaming around the house and out to the Internet in general. I recently upgraded from an old Linksys E2500  to a NETGEAR Nighthawk R7000, and it easily handles the streaming. If you were considering an upgrade to a newer router like those supporting 802.11ac, this would be an ideal time.

Per the manufacturer, you will need to connect it to the same router or network segment used to connect to the Internet. I initially attempted to connect it to a switch connected to my router, but it did not work.

After connecting to the network, attaching the storage, and connecting the coaxial from the antenna it is ready for power! Connect the power cable and turn it on. You should see the port on the router light up orange. You can continue the configuration with their mobile apps, or just use a computer like I did. Go to and it will walk you through formatting the drive, scanning for channels and downloading the channel guide data, enabling remote streaming (very easy since it configured port forwarding automatically via UPnP on your router), and updating the firmware. The firmware updates showed me a changelog with significant enhancements, so you really will want to update it.

During my inital setup, mine got stuck at "Downloading" during the firmware update at 0%. I waited five hours hoping it would work itself out and not wanting to brick it, but then I found a relevant community post describing how a reset could resolve it, and I decided to go for it. It came back up on the old firmware just fine. After that, everything worked normally and I was then able to update it later.

From there, the OTA world is your oyster. You can now watch live or recorded programs on your smartphone, Chromecast, PC, or Roku (the newer the better). The folks behind the Tablo should be finishing up with the redesign of their Roku channel, and an app for Amazon Fire TV products (including the stick) is also forthcoming. It was supposed to come out in Q1 2015, so the schedule must have slipped. That beta interface they are demoing is like a virtual Cable/Satellite DVR right on your existing streaming devices.

As it is now, adding and finding shows and movies for recording is dead easy. You can search for shows or movies. You can see available airings organized by genre, prime time, etc. You can see information for airings, record all or only-new, and pick and choose specific episodes to record or not. Guide data is only available for 14 days out so a series cannot be added if it is not airing within that time period.

Anyway, welcome to the future fellow cord cutter.

Sunday, February 22, 2015

Customize splash screen on Kenwood DDX7701HD, DDX8901HD, and DDX7071BT

I want to customize the boot up/splash screen on my Kenwood car stereo to something a little more vehicle-specific than the default startup screen. I couldn't find specific instructions for my headunit model, but there was information for similar models. I have the DDX7701HD, but the other models listed in the title are very similar and use the same manual, so they should be able to use the same method.


  1. Prepare the files:
    1. Format a USB drive as fat32 
    2. On the USB stick, save a bitmap image of 800x480 pixels with 16-bit full color and RGB color settings of R5,G6,B5 (a free program like Gimp can do this if you choose File > Export As > select BMP > Save (a dialog will pop up after you hit save) > Advanced > Select R5 G6 B5 under the 16-bit heading 
    3. On the USB stick, create a text file named OpeningCustomize.txt containing the text shown here
      1. This file must be created using Notepad. Linux-style line returns will not work.
      2. Make sure to change your_file_name.bmp to your actual bitmap image file name.
  2. Prepare the stereo:
    1. If you don't want to lose your settings, back them up in the Setup -> System -> Setup Memory menu.
    2. Get a paperclip ready to press the reset button (red lighted triangle on lower left corner)
  3. Perform the customization:
    1. With the stereo on, press the volume down and menu buttons (you will keep holding these two only), and quickly press the reset button.
    2. The stereo will power off and then turn back on. Release the volume down and menu buttons only after the buttons on the bezel illuminate
    3. When the customization menu appears, plug the USB drive into the USB port connected to the stereo's USB cable.
    4. Touch the button labeled "Opening Customize" and it will say "Customization OK"
    5. Now power the unit off and on via the Menu/Power button, and it should come up with your new splash screen