/* BeejBlog */

PowerShell Photo Slideshow

GitHub Source

Project Description

Photo slideshow implemented in PowerShell -> Windows Forms

Simply target a local/LAN folder of images.

Features:

  • task tray icon to start slideshow on demand…
  • otherwise kicks off after user defined idle timeout (honors running video)
  • good randomization - one soon realizes pleasantly random photos are the key want of a photo slideshow … fortunately PowerShell has a readily available random commandlet that seems to do quite well
  • image fade-in and slide for ambience
  • several hotkeys functional:
    • open current image folder
    • copy current image to My Photos
    • rotate current image (and save) - specifcally coded to honor EXIF rotation metadata where present but sometimes this gets lost
    • reverse to previously shown photo (left cursor)
    • pause/play (space)
    • hotkey legend pops up on any other keypress
  • skips .hidden folders
  • open to modification - it’s just PowerShell :) no compiling tools required

Install - basically just launch the ps1… here’s some tips:

  1. only the ps1 and ico files are needed, download them to a folder
  2. (see screenshot below) create a shortcut to the ps1 and tweak the target to include powershell before the ps1 filename…
  3. select Run: Minimized to make script launch more polished
  4. add -WindowStyle Hidden after powershell.exe on target command line for further polish
  5. then hit the Advanced button and select Run as administrator - this is only required for the powercfg /requests used to identify running video and avoid starting slideshow after user input idle timeout (wouldn’t mind hearing a slicker approach???)
  6. script parameters:
    • add -photoPath {path\to\your\images} to the end of the shortcut path - shared folder fair game
    • add -idleTimeout 2 to the end of the shortcut path - units are in minutes
  7. Copy this shortcut to shell:startup in Windows FileExplorer to automatically launch this script when you login to your desktop

Wishlist

  • show videos as well - thinking VLC convenient… would need to pause image display loop and figure out how to recognize when VLC was done playing… would be nice not to keep launching new VLC instance vs reusing

Sizing a Battery Backup (aka UPS)

I live in the Seattle area, apparently we get a nice windy storm around every Thanksgiving… sure to form, we lost power for a nice long 24 hours starting 11/17/2015… so i finally ordered a low end generator… and then i started wondering about including a UPS for computer up-time continuity during the momentary brownouts that happen when the wind is jacking with our power grid.

Power Requirements

  • nice reference
  • Typical UPS units will be rated in VA (Volt-Amps) aka Apparent Power … and possibly in Watts aka Real Power as well
  • The difference between these two comes from concept called Power Factor… PF = Real / Apparent… quick backgrounder:
    • a “purely resistive” load like an old school incandescent light bulb will have a PF = 1 where VA and Watts are equal
    • whereas the typical implementation of AC to DC in a PC PSU represents an inductive load which causes the Amperage sine wave to lag behind the Voltage yielding a PF < 1 where some energy is “lost” - helpful physical analogy - see horse and boat - it does beg the question where this energy is actually lost to… in the physical horse/boat scenario it’s easy to think it goes to friction/kinetic but i don’t have it pinned down in the AC/DC scenario… perhaps wasted in underutilized electromagnetic field
  • Ideally your UPS will be rated for both their VA & Watts capacity but if only VA, then it is common to expect a UPS to handle Watts at 60% of it’s VA rating … i.e. 1000VA UPS should support 600Watts
  • So now you need to know your power requirements… there’s a couple ways to go about this:
    1. take your PSU at face value… but how did you size your PSU in the first place… to be honest I just threw a dart when i went shopping
    2. add up your components’ ratings
    3. buy a cheap (~$20) device to measure actuals - this option is easy, inexpensive, satisfyingly definitive and it’s a nice bonus to go measure everything else in your house …
      • turns out my admittedly very non-gamer rig never went above 335VA (304 Watts, PF = 0.91) with maxed CPU and Gfx (Corsair HX750i PSU, Haswell-E 6 Core 5820k, Nvidia GTX 750Ti , 30” & 24” displays, USB speaker, USB mini network switch)
      • 300 VA just CPU maxed, no Gfx
      • 215 VA fairly idle
      • 144 VA remove 30” display
      • 75 VA remove 24” display
  • Finally, working back from those numbers into a UPS means I not only need at least 335VA but I also need to watch out for 304 Watts… i CAN NOT simply go after a 335VA UPS since that would only support 201 Watts (335 * 0.6) … and we see this in typical UPS specs - notice the 650VA/390Watts - … to put another way, since my Active PFC (see below) PSU puts my overall PF nearer to 1 vs 0.6, my Wattage load is the critical dimension to satisfy vs VA… to work back to a UPS VA that would support 304 Watts => VA * 0.6 = 304 Watts… VA = 304/0.6 = 506… so at minimum I am looking for 560VA/304Watts

Secondary Considerations

  • I’m an Amazon junkie, I typically check off Amazon prime and then scan similar products for a high number of positive reviews… in the consumer UPS space (+/- $100 range) it’s really a matter of CyberPower vs APC… The APC BE550G is the obvious best rated at 4.5 stars 3218 reviews…
  • Generator Compatibility!
  • AVR - Automatic Voltage Regulation - like all marketing, it sounds good… smooth out your voltages in brownouts, but I couldn’t find enough concrete evidence to say whether it was significant
  • Replaceable battery - the APS and CyberPowers both appear to be readily servicable
  • Info Display - I’m kind of a sucker for the LCD
  • Software - it’s tough to find specifics on the APC & CyberPower software beyond turning off the beep and setting up automatic shutdown… i was somewhat interested in something that would actually log power consumption over time to give me some “Kill A Watt” style info… since the software does show Watts it seems feasible to think i could reverse gen the USB info and record it (like i’ll actually get around to that ;)
    • Apparently CyberPower is Mac & Linux compatible whereas APC is Windows only
  • Leaning towards CyberPower CP600LCD = $65 @ 2015-11-23

Active Power Factor Correction (APFC)

  • the PF < 1 waste drives marketing of modern PC PSUs to trend towards Active Power Factor Correction (Active PFC) which means the PSU corrects the raw electronic load back to a PF = 1… and can thereby boast higher efficiency, which sells
  • through a fun combination of physical constraints, the kind of electric equipment humans could readily produce and politics at the outset of power distribution, modern society settled on high voltage AC and the momentum of large investments required have kept it that way…
  • further, current is most readily generated by rotating mechanisms which lead to a smooth “harmonic” curve of voltage highs and lows over time, i.e. the oft referred sine wave… hence our electric grid was founded on smooth sine wave current
  • and it’s therefore understandable that cost effective electric equipment would actually depend on a smooth sine… and apparently some Active PFC PSU’s implementations are indeed sensitive to having a pure sine wave input…
  • yet it is also cost effective for UPS’s to convert their DC battery source into AC via electronic approximations that yield a “stepped” wave vs the smooth sine we see from our power grid … this stepped sine is what dominates the consumer end UPS space (Fig.1)
  • the main downside of this potential conflict is that the fail-over from wall to UPS battery during a power outage may still cause a PC power cycle…
  • Nevertheless based on my quick reading, we should generally rely on contemporary hardware to be compatible and the only way to really know for sure is to find a published test or test it yourself… the simple test is to unplug the UPS and see if you get a reboot or not :)

Fig.1

Transcode MOV to MP4

Motivation:

Digital cameras and phones typically save video to MOV (Motion JPEG) files. I share my photos & videos via a self hosted open source photo gallery (zenPhoto). MOV files must be converted to a compatible format like MP4 to stream through the readily available web video players like Flowplayer.

Script features:

  • Handles multiple files at once… even from different folders when part of an explorer search result
  • Applies rotation where necessary.
  • Touches new file datestamp to be same as original.

Leverages 3rd party tools:

  • FileMenu Tools - handy for creating a FileExplorer right mouse context menu for executing transcode on selected files
  • HandBrake - read something that suggested HandBrake is faster than ffmpeg and that appears true on my quick comparison
  • MediaInfo - pulls the EXIF metadata to determine if any rotation is necessary

Install:

  1. save transcode.ps1 below into a known location
  2. install FileMenu Tools and disable all the commands you don’t want. Configure a “transcode” command as shown in screenshot below (of course edit your ps1 file path accordingly)
  3. install HandBrake and put HandBrakeCli in your path
  4. minimally, put MediaInfo.exe and MediaInfo.dll in your path

transcode.ps1


Example UI

enter image description here

FileMenu Tools Config

enter image description here

Chrome User Script - Whack page elements based on jQuery seletors

// ==UserScript==
// @name VipLeague.se AdBlock Hack
// @match http://www.vipleague.se/*
// ==/UserScript==

function addJQuery(callback) {
  var script = document.createElement("script");
  script.setAttribute("src", "https://code.jquery.com/jquery-2.1.4.min.js");
  script.addEventListener('load', function() {
    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")();";
    document.body.appendChild(script);
  }, false);
  document.body.appendChild(script);
}

function main() {
  $("span:contains('Adblock is enabled')").remove();
}

// load jQuery and execute the main function
addJQuery(main);
enter image description here
enter image description here

Bash script - loop over inline list of files

#!/bin/bash

#echo $BASH_VERSION

# read args:
# -r = disable backslash escaping
# -d '' = read the whole here-doc as one big input vs stopping stopping at the first new line as the default delimiter
# -a = put the results into an array
#the minus in "<<-" provides for indenting the here-doc lines, but with TABS ONLY
#bash4 is way easier but wanted to be portable: readarray -t arr <<-"EOT"
IFS=$'\n' read -r -d '' -a arr <<-'EOF'
    /file/path/1
    /file/path/2
    /file/path/3
EOF

#echo ${#arr[*]}

# http://stackoverflow.com/questions/9084257/bash-array-with-spaces-in-elements
# disable default space delimiter
IFS=""
for filePath in ${arr[*]}
do
  stat "${filePath}"
done

unset IFS

2015Q1 Haswell-E X99 Build

Mobo: Gigabyte GA-X99-UD4 - LGA 2011-v3

CPU: Intel i7-5820k - 6 core Haswell-E

Cooler: Corsair H80i GT

PSU: Corsair HX750i

RAM: Crucial 32GB (4 x 8GB) Ballistix Sport (DDR4 PC4-19200 2400 MHz, 16-16-16 CAS)

CaseCooler Master Storm Scout 2 Advanced - love that rubber top handle! :)

SSD: SAMSUNG 850 EVO 500GB

Video: Asus Strix Nvidia GeForce GTX 750Ti 2GB ... this card is a perfect fit in my book:
  • No drivers necessary to vanilla boot into Yosemite - no QE/CI out of box but very workable for initial install and then full QE/CI via Nvidia "webdriver".
  • fanless unless pushed hard
  • 3 x digital display, INCLUDING DP - I can confirm this card supports at least dual monitors under Yosemite via any combination of DP / HDMI / DVI (dual- link) with any of them driving 2560 x 1600 res... I've seen mention of possible 4k support on this card and can't wait to confirm that myself :)
  • no more horsepower than I care to pay for => $160 at the time ... and was well stocked in major outlets circa March 2015
PC Hound build pricing
($1,675.26 pre-tax from Amazon on 2015-03-11)

Biggest gripe - the Corsair USB stuff is total junk... It sounds cool to be able to monitor temps but it is so bad I would seriously recommend against it... I traced OS X re-wake back to the H80i cooler and the drivers are all super flaky under windows... reports of all kinds of known issues installing on Win8 and above out there on the interwebs... even with the well known hacks in place, only some rare reboots would yield working gauges for me... looks like USB device initialization timing bugs... sounds neat at face value but the unreliable drivers ruin the whole experience... there are open source alternatives brewing... guess there's a new build up for Win10, we'll see how that goes.

2015-09-03 Update: Spooky! Machine was just totally dead this morning, no power up at all ... jiggled the usual stuff, manually shunted the mobo power-on pins, re-seated ram, nothing... was expecting dead PSU but it checked out fine on voltmeter... and test button on PSU revved up the fans just fine... so next i started figuring dead mobo and was basically giving up ... then the big guy nudged a thought into my sad mind, "try the paperclip trick"... so i shunted pins 15 & 16 on the back of the 24pin header (while PSU connected to mobo) and sure enough it all powered right up <whew>... after that the case power button was working normally again as well... no other changes...

very interesting behavior ... really grasping to place blame anywhere particular  ???


i shudder to think of the time and effort i could have easily wasted swapping out working components chasing this ghost

we did have a power outage here a couple days ago but the machine had been running fine since then; even going in and out of sleep mode so it's hard to think there would be something "lingering"... yet there i was

Installing Windows in UEFI Mode

For motherboard: Gigabyte GA-X99-UD4

Booting Windows in UEFI mode offers a couple mild advantages:
  1. it's more compatible with Clover if you're booting OSX this way already
  2. it's supposed to be the fastest way to boot
Notes / Lessons Learned:
  • Rufus flash usb boot tool - wound up going with mbr and uefi-csm - not the normal recommendation
  • bios settings
    • fast boot didn’t seem to matter
    • legacy usb worked in disabled mode
    • worked with “other OS” selected
    • machine would not display bios after reboot whenever i disabled CSM (even though that's what most UEFI guides recommendation)
  • what really seemed to matter was putting the usb stick in a certain USB port! i used the chassis USB header with 2 USB3 and 2 USB2… going from left to right it was the second USB3 port that worked and the left most one never would
  • Lesson Learned - Disconnect all other drives than the one installing to
    1. existing windows drives get targeted for reusing their boot partition to install the bootloader files and wouldn’t create all 4 "ideal" GPT UEFI partitions on my clean drive (Recovery, System, MSR, Primary)
    2. having my mac clover drive connected during these attempts allowed the setup utility to put the windows bootloader on that drive and ruin that clover boot…
      • reinstalling clover via vmware osx guest DID NOT put the UEFI clover bootloader back in charge!
      • had to delete/rename \efi\windows folder and then the old EFI option started showing back up on the “BBS” “F12” boot choice menu
  • to confirm you’re really booted into UEFI mode:
    • from “WinPE” environment:
      • shift F10 to open command window
      • wpeutil UpdateBootInfo
      • reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType
      • 0x1 = legacy, 0x2 = uefi
    • from real windows:
      • msinfo32
      • look for “BIOS Mode” under System Summary

Minimal pure CSS Treeview with FontAwesome expanders

Update 2015-07-18: shux! not valid to apply ::before/after psuedo elements to <input> since it's not technically content (stack-o reference)

jQuery replacement:




Works in Chrome and Safari but not Firefox or IE :(

Look ma, no JavaScript! :)

Leveraging (hidden) checkbox element to maintain expand/collapse state and
:before {content: "xyz" }
 css to avoid extra elements.
Not an original idea but wanted to see of i could trim down all the extra html markup & css required.
Turned out swell! The <input> is the only additional overhead above standard markup, sahweet!

External Content in Blogger Post

Highlights:
  • pull content from 3rd party source, using crossorigin.me (CORS proxy) to avoid "no 'access-control-allow-origin' header is present on the requested resource"
  • from what i can glean, Blogger does not offer any kind of server side include facility so we have to resort to client browser tricks and that means this content is NOT going to be crawled/googlable
  • this approach relies on jQuery (Core) so you'll need to have that referenced as well - example here, but also make sure you point at the latest version

Usage:
drop this helper function in a global JS/HTML widget via the Blogger Layout editor...
function pluginContent(url, containerSelector, boolPrettyPrint) {
  var ctrl = $(containerSelector);
  $.get("http://crossorigin.me/"+url)
    .done(function (result) {
        ctrl.html(result);

        //force prettyPrint rendering after loading dynamic content
        // google on: "google code prettify" to get dialed in on this code syntax highlighting library
        // => https://code.google.com/p/google-code-prettify/wiki/GettingStarted
        if (boolPrettyPrint) {
          ctrl.removeClass("prettyprinted");
          PR.prettyPrint();
        }
    })
    .fail(function() {
      ctrl.html('failed to retrieve external content.<\br>'+
        'try going there directly: <a href="'+url+'">'+url+'</a>')
    });
}

Then use it like this in an individual blogpost:
<pre class="prettyprint linenums lang-powershell" id="prePoshDualExplorers"></pre>

<script>
  //pull code content from codeplex
  pluginContent("https://beejpowershell.svn.codeplex.com/svn/PoshDualExplorers/PoshDualExplorers.ps1", "#prePoshDualExplorers", true);
</script>

PowerShell Dual Windows Explorers

Nutshell: Hosting two Windows File Explorers inside a WinForm... with the potential of sprinkling some utility hotkeys on top - e.g. "copy from left to right".

Full source on GitHub

Highlights:
  • Always wanted to try this and just finally got around to it... and it actually works to a decent degree.
  • This is of course well covered ground with various other file managers... i just wanted to see if you could do it this poor man's way with PowerShell driving... so one could readily make it one's own with further customizations
  • I was a longtime fan of Directly Opus... I think it's significant that this meager alternative is customized via standard PowerShell vs a 3rd party scripting environment that must be learned... i.e. if you happen to already know PowerShell, you can jump right in with all that file handling power available
  • The obnoxious part is hunting down the COM interfaces necessary to pull stuff out of FileExplorer... it dips into silliness like how IE is somehow part of the equation.
  • See comments for all the good posts i drew from to cobble it together... lots of handy Shell programming nuggets to be had
  • thanks to a handy github project, Font-Awesome is now in the WinForms domain - too cool
  • notes to self
    • interop.SHDocVw.dll is generated from doing a Visual Studio reference to C:\windows\system32\shdocvmw.dll
    • interop.Shell32.dll seemed like it was going to come in handy but didn't wind up being necessary
    • these are the only real FileExplorer API calls necessary for the CopyFile piece
      • $objFolder = $objShell.NameSpace($explorerRight_SHDocVw.LocationUrl)
      • $objFolder.CopyHere($explorerLeft_SHDocVw.Document.SelectedItems())
    • there are a few wacky interfaces behind the shell objects but the neat thing is that runtime dynamic type binding makes using real types largely irrelevant... i feel that does lose some self documentation in the balance so i've tried to include the pertinent interfaces in the comments for future reference and expansion

Installing OS X on native hardware via VMware

General guide for installing physical boot OS X from a Windows VMware hosted guest instance - Including some specifics for Yosemite El Capitan, the Clover boot loader and my hardware.

This guide is pretty dense with comments but the core idea is quite simple - basically just get into an OS X virtual machine and from there install OS X to your physical drive :)

Motivation:

  • This approach basically assumes you've got a PC already running Windows and you want to leverage that same hardware to physically boot OSX at times as well.
    • Once you're in OSX, Parallels and VMware Fusion do both support running your physical Windows instance as a VM... this corresponds to VM'ing your Bootcamp partition under a real Mac... so to be clear, we use a Windows host to run an OSX VM from where we install OSX to a physical drive, then boot that OSX host and run that same original Window host installation as a VM under OSX :) 
  • To put it out there up front - Prevalent, ready-to-run VMware OSX images provide a convenient bootstrapping approach.
  • I had trouble getting my USB stick to boot with Clover – which appears to be a known issue on my mobo (Gigabyte X99-UD4) – so on the way to prepping a USB for UniBeast, I figured why not see how tough it is to install directly from VM OSX to my intended physical drive vs fighting the USB
    • This skips the whole slog of extracting the latest OSX installer from it's app store wrapper and getting it all setup on a USB boot copacetic with your individual hardware... one might argue that we're shifting dependency to a VMware image version rat race but all we actually need is the app store to download the latest OSX... so whatever VMware+OSX image you obtain now, will remain a viable stepping stone to install the latest greatest OSX you want onto your physical drive.
    • For what it's worth, this pretty much guarantees you won't run into issue just getting the vanilla OSX bits on your physical drive... of course you will still have to slog through whatever your individual hardware compatibility effort requires to actually boot up...
    • Yet when troubleshooting is necessary, it is much more robust to do so from the full working OSX VM environment vs the constrained OS X Installation / Recovery boot environment that comes with typical USB approach.

Hardware as of this guide:

  • Mobo: Gigabyte GA-X99-UD4 - LGA 2011-v3
    • bios: F12
    • onboard ethernet: Intel I218-V (kext required)
    • onboard audio: Realtek ALC1150 (vanilla support)
  • CPU: Intel i7-5820k - 6 core Haswell-E (vanilla via Clover flags)
  • Video: Asus Strix Nvidia GeForce GTX 750Ti 2GB ... this card is a perfect fit in my book:
    • No drivers necessary to vanilla boot into Yosemite - no QE/CI out of box but very workable for initial install and then full QE/CI via Nvidia "webdriver".
    • fanless unless pushed hard
    • 3 x digital display, INCLUDING DP - I can confirm this card supports at least dual monitors under Yosemite via any combination of DP / HDMI / DVI (dual- link) with any of them driving 2560 x 1600 res... I've seen mention of possible 4k support on this card and can't wait to confirm that myself :)
    • no more horsepower than I care to pay for => $160 at the time ... and was well stocked in major outlets circa April 2015
  • Noteworthy - I traced a OS X "re-wake" problem back to my Corsair H80i Cooler... the "i" is the USB version that can supposedly report temperature stats... I find it all to be unusably flaky even under Windows, highly recommend avoiding any of these "Corsair Link" products.

Obtain Software Bits:

Software versions only listed for reference as of this build, not crucial unless noted.
  1. VMware Workstation (v11.1)
  2. OSX VMWare image (Yosemite v10.10 14A389) - this package includes crucial patches enabling OS X guests
  3. Yosemite via App Store download (v10.10.*2* 14C109)
    • get this download running as soon as you can get into the VM since it takes a while
    • if curious, you can confirm which version of OSX you got from the app store via the "Startup Disk" popup that comes when you quit out of the installer.
  4. Clover Configurator (v4.23.0) - very very handy, seals the deal on Clover convenience
    1. while UniBeast still seems to cover more diverse hardware situations, Clover is pretty slick if your hardware is copacetic (basically starting with a UEFI capable mobo)
    2. the "EFI partition only" footprint is nice for vanilla segregation - it sits there intact if you want to completely wipe & reinstall OS X primary partition 
    3. Couple nice bits for my hardware
      1. HaswellE kernel patch is a checkbox vs manually patching the kernel - nice!
      2. no fuss NVRAM checkbox which effortlessly enables iMessage and App Store connectivity
  5. Clover (v2.3k r3241, change descriptions) - during install steps, you can use Cover Configurator to conveniently download and launch Clover installer
  6. KextWizard (v3.7.11) - one handy feature above other more well known kext loaders, it will target another drive which is perfect for this side-load scenario
  7. Nvidia's web driver
  8. Raw kexts
    1. FakeSMC - bare minimum DSMOS avoidance for non apple hardware
    2. AppleIntelE1000e (v3.1.0) - for X99-UD4's onboard Intel I218-V ethernet
    3. VoodooTSCSync patched for 6 core (my hardware) - author site says this addresses "spin lock" issue
    4. GenericUSBXHCI - in conjunction with disabling XHCI in bios, enabled night and day difference in VM performance ... this behavior changed under El Capitan v10.11.2... my USB devices stopped working... removing this GenericUSB kext caused them to work again and fortunately the previous Parallels VM performance problems didn't manifest after that... I have up'd from Parallels V10 to V11.1.1 (32312) since then which might also be aiding this complex compatibility equation.

BIOS settings:

  1. SATA controller in AHCI mode - classic requirement
  2. xHCI = manual, xHCI handoff = disabled - (Reference) this made a major difference on running VM's


VMware Guest Configs:

  1. add 'smc.version = 0' to the VMX file in order to resolve error: vmcore/vmm/main/physMem_monitor.c:1123
  2. Add physical disk to guest - In addition to the main vmware virtual drive that your guest OSX boots from
    1. i found SATA interface to *never* work vs IDE or SCSI... SCSI gave some minor warning so i went with IDE / full disk / persistent
  3. MBR trick to allow boot utilities (e.g. Clover installer) under vmware guest to write to physical disk:
    • sure am glad those guys figured out how to hack around this issue otherwise this whole approach would be dead in the water with no way to write to the physical disk
    • pretty surprised vmware hasn't been blasted into fixing this issue... it doesn't seem OSX specific but maybe that's why it's remained obscure
    • In my experience, on Windows 8.1 at least, simply taking the drive "offline" via DiskManagement was not enough
    1. ** This must be done BEFORE firing up vmware guest
    2. hide the physical disk from Windows by temporarily clearing the "MBR magic" signature in the very last 2 bytes of sector 0 (see DirectDisk tool screenshot at bottom under "MBR Trick")
    3. then refresh Disk Management (or DiskPart.exe > rescan) and the drive will show that it's now completely unknown
    4. now put the 55AA signature back so the Mac guest can see the drive - but be careful not to refresh Disk Management or DiskPart
    5. now fire up vmware guest and you're good to slam that drive all day long

Lessons Learned:

  1. Major Parallels/Fusion VM performance fix!! - the nutshell is apparently the xhci stuff has a major impact... i had mine disabled but then didn't have xhci manual mode selected nor the GenericUsbXhci.kext loaded (see El Capitan update under Software Bits 8.4) and after doing both of those my Parallels 10 performance was respectable...prior to that all Windows VM spinups were major slow and obviously just hammering the first core from Activity Monitor, afterwards all cores jump around randomly.
  2. Bootcamp under Parallels, fix "missing operating system" - first shutdown the Bootcamp guest VM so you can make configuration edits, then "Edit Partitions" and for me, my little recovery partition wasn't selected vs the main Windows OS partition, just had to select it (in addition) and restart.
  3. Updating Nvidia drivers - SEE THIS POST - they can put you in a non-bootable state pretty quick, like when you upgrade OSX and the currently installed driver is no longer compatible... so the main thing to be aware of is using nv_disable=1 in your boot args to temporarily remove them from loading, which then gets you back into working low res where you can install another version of the drivers.
    1. Using MacPro6,1 for your SMBIOS requires a special patch - see Fix#4
    2. I've come to understand that iMac14,1 is one of the more forgiving choices... Apple is changing the USB game a lot starting with El Capitan... they are restricting USB ports depending your SMBIOS machine... reportedly iMac14,x does not currently (v10.11.2) receive any restrictions on the USB 2.0 side (EHCI)... i can report at least all my USB2.0 devices operate (Logitech Z305 speaker, Logitech C910 webcam, Logitech Anywhere receiver)
  4. starting from a completely bare drive - just format it as GPT Journaled with a single partition via DiskUtil - this will create an unavoidable ~200MB EFI partition which is good for clover
  5. Yosemite installer or Recovery script will add "Recovery HD" partition - however, i don't particularly see the need for Recovery mode vs booting into full OSX VM for any troubleshooting
  6. on the VM image i had major kernal_task CPU crunches that would storm in and bring everything to a stand still... guessing thru googling that some IO kext is getting hung up... i disabled sleep and this issue no longer occurred, no big surprise.
  7. easy success with Migration Assistant restoring from Time Machine backup after booting into a fresh OSX install makes this my preferred approach - see "Time Machine saving to Windows share" under Misc tweaks below.

El Capitan:

  1. System Integrity Protection (SIP) is the new challenge to hacking kexts (good ref)... nutshell:
    1. Under Clover Configurator set the follow RT Variables:
      1. CsrActiveConfig = 0x03 (for full) - or 0x01 (for partial)
      2. BooterConfig = 0x28
    2. remove the old rootless=0 and kext-dev-mode=1 from boot args
    3. Kext Utility 2.6.4 seemed to resolve refusal to load S/L/E kexts after edits were made


Install Steps:

  1. Fire up the VMware OS X guest on pre-installed virtual Yosemite image (Bits 1 & 2 above)
    1. Make sure BEFORE launching OS X guest, perform "#3. MBR trick" under "VMware Guest Configs" above
    2. if you install the darwin.iso tools the resolution does get a nice little bump from 1024x768 to 1920x1080... and it seems to be slightly more responsive - find in: C:\Program Files (x86)\VMware\VMware Workstation\darwin.iso
    3. Physical drive must be formatted before Yosemite installer will recognize as a valid installation point (specify GPT & Journaled)
  2. Install Yosemite to the physical drive via Apple App Store download
    1. I count 3 restarts (few mins stuck on 1 sec remaining, then maybe a 20 mins run) - the 3rd and final looped me back to the beginning of the install, so then just bail out and reboot back into virtual Yosemite
    2. If you wind up hosing that last profile setup stage like i did :| this article is handy :)
    3. Recommend selecting the virtual disk for startup as convenient to making repairs on the broken physical from the working virtual
  3. Use Clover Configurator to download and install latest Clover - Remember to select the physical drive as the installation point
    • I went with the EFI only install with no other checkboxes necessary
  4. Clover Configurator settings - these need to get saved to your EFI partition/EFI/Clover/config.plist, so you'll need to mount your EFI partition and make sure to select this file before you start applying settings, and then don't forget to save before quitting.
    1. Boot tab:
      1. -v - verbose, you're going to want to watch for any clues if it blows up
      2. npci=0x2000 - everybody says this one is crucial
      3. nvda_drv=1 - (my hardware)  enables loading Nvidia kexts
      4. El Capitan no longer honors this flag kext-dev-mode=1 - this enables loading of unsigned kexts
      5. slide=0 - pulled this from a guide (not sure necessary)
      6. (my hardware) Legacy = LegacyBiosDefault - this enables Windows to boot when it's been installed in MBR (aka Legacy) mode vs UEFI mode
    2. GUI - hiding entries on the clover boot menu is complicated by all the different combinations... this is the strategy that was the most rational for me
      1. Scan = Custom, then select Entries & Tool (leave Legacy and Kernel unchecked) - i couldn't figure out how to hide my Windows EFI partition from the legacy scan so this disables legacy scanning entirely
      2. Hide Volume => Recovery HD - this was the only one that still needing specific hiding
      3. Custom Entries
        1. one for the OSX volume by name (not the mac/clover EFI volume), don't forget to set the Type field or it won't save to config.plist, no other fields required, but you might want to set a specific image file (e.g. EFI\CLOVER\themes\thinkpad\icons\os_yos.icns)
        2. one for Windows volume by UUID, always set the Type field, no others required
    3. Kernel and Kext Patches
      1. KernelHaswellE (my hardware)
    4. Install Drivers - for Yosemite everything will be 64bit and I'm doing UEFI only so we'll be selecting only from the two bottom sections on the Install Drivers tab (i.e. "Drivers UEFI 64 bit" and "Extra Drivers")
      1. remove VBoxHfs
      2. add HFSPlus UEFI
      3. ---- my hardware --- otherwise Clover will hang trying to allocate contiguous memory right after OS selection
      4. add OsxAptioFixDrv
      5. add OsxLowMemFixDrv
      6. add OsxFatBinaryDrv UEFI
    5. Theme - my chosen them never seemed to save to the config.plist for me so i just found the <theme> section and put the one i wanted manually (textedit works fine here).
    6. Copy kexts to EFI\EFI\CLOVER\Kexts\10.10
      1. FakeSMC
      2. VoodooTSCSync (my hardware)
      3. GenericUSBXHCI (my hardware) - see El Capitan update under Software Bits 8.4
      4. AppleIntelE1000e (my hardware)
    7. You should now be able to reboot into this new physical OS X - *** I've needed to include "nv_disable=1" in the boot args until i've gotten the Nvidia WebDrivers loaded ***; THIS POST is very helpful for all the different issues
    8. Play it safe, do a Time Machine backup of this pristine install before you do anything else to screw it up (see "Time Machine saving to Windows share" below) - *** especially before the Nvidia drivers ***, i've had them black screen me... if that happens, try nv_disable=1 boot arg first before starting completely over.
    9. Last juicy step is to go ahead and install latest full Nvidia web drivers (Tip: confirm your specific OS X version via Finder > About This Mac > and hold ⌘ when you click the version number)

    Misc tweaks and tools:

    • DiskPart cheat sheet
    • XtraFinder - F2=rename, Enter=launch file, Delete=delete file, dual pane tabbed Finders and tons of other must haves
    • Kext Utility
    • Clover Preference Pane
    • Installing Windows in UEFI Mode - this makes it more straightforward to target the drive for booting from Clover... it's also supposed to be the fastest way to boot up
    • Fix Home/End keys: Karabiner > "PC style" keys options
    • Show All Drives in DiskUtility:
      defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
    • Avoid Microsoft Remote Desktop self signed certificate lockup (ref#1, ref#2)
      1. Use Activity Monitor > View > All Processes to kill SecurityAgent which will dump the hung authorization popup
      2. Open Keychain Access app in OSX
      3. Select Certificates under the category heading - trusted certs are marked with a white plus in blue circle
      4. double click your untrusted certificate
      5. expand Trust section
      6. select Always Trust for SSL
      7. close, done
    • Enable Time Machine saving to Windows share (smb)
      1. Save a "sparsebundle" image to your share via DiskUtil > new image... 500GB or whatever... it's "sparse" so it won't use all the space right away... go with "Single Partition - GUID" and Journaled
      2. "Mount" your share via Finder ⌘-k, confirm by Finder > prefs > SideBar > Devices > {your machine}...  look for share as a drive icon there
      3. Double click the sparsebundle to get that mounted as well
      4. Terminal: sudo tmutil setdestination /Volumes/{sparsebundle drive}
      5. Fire up Time Machine prefpane and select that drive, yay!
      6. Use Users prefpane > Login Items to make the two mounts automatic after reboots so that Time Machine has continuous access to do its background backup magic
      7. CONFIRM THAT YOU CAN RECOVERY RESTORE from this rather unsanctioned source - traditionally one does this from a "Recovery HD" partition with the special Time Machine Restore tool available to that environment but i ran into enough snags that my preferred approach is to reinstall OSX from scratch from the OSX virtual machine, then boot back into the fresh install and use Migration Assistant to restore from the Time Machine backup. This is a resilient solution because if we somehow trash this guest VM, we can readily recreate it from the source vmdk file.
        1. If you're still interested, here's notes on creating a bootable Clover recovery partition - i had a lot of trouble modifying the BaseSystem.dmg to include my NIC's kext such that i could point the Time Machine tool at my backup volume over the network
        2. (unsuccessful) Time Machine restore over NFS from Recovery mode
          • SMB is not supported in the limited Recovery environment so NFS is the next obvious choice to restore from a network source
          • NFSAxe was the one Windows NFS server that did at least support the basic OSX client to Windows mount (after trying both FreeNFS and haneWin NFS)
          • Time Machine via NFS on Mavericks and Mac NFS client tutorial - details pertinent Terminal commands... but ultimately ran aground with "sparsebundle not compatible" error which seemed like a limitation of the mount util (hdiutil) or the underlying filesystem libraries not available under recovery mode
            • make root drive writeable: mount -uw /
            • create mount point: mkdir /private/MacBackups
            • mount -t nfs beejquad:/m/macbackups /private/MacBackups
          • If curious to try, the Recovery mode tools can be fired up under standard OSX
            • mount any "Recovery HD" partition you can get your hands on
            • then under com.apple.recovery.boot, find BaseSystem.dmg and mount that (it is hidden)
            • Then the special Time Machine full restore app is under: /System/Installation/CDIS/Time\ Machine\ System\ Restore.app/Contents/MacOS/Time\ Machine\ System\ Restore ... but again, this didn't pan out for me since i wasn't able to mount my sparsebundle image that contained the Time Machine backups... it seemed to be a Recovery mode limitation because the sparsebundle file continues to mount fine under standard OSX boot
    • Mounting EFI partition under windows
      1. launch cmd.exe, then:
      2. diskpart
      3. list disk (looking for the right drive)
      4. select disk x (where x is drive number)
      5. list part
      6. select part 1 (EFI will be first on a normally formatted GUID drive)
      7. assign letter=e
      8. (when done) remove letter=e
      9. Then need to launch explorer.exe as admin to access this E: drive
        1. cmd.exe as admin
        2. taskkill /im explorer.exe /f
        3. explorer

    MBR Trick:

    0