/* BeejBlog */

Recovering failed SQL Server 2012 Installation

  • I have to say, SQL Server’s setup.exe seems pretty dang fragile… I realize it’s a complicated script with endless dependencies and such, just saying… year after year I continue to run into various reasons that the setup twists it’s ankle on something, bombs out midstream and leaves behind a partial installation mess that can’t be repaired or uninstalled… maybe I’m just unlucky or perhaps I’m overly hard on poor old Windows.
  • This most recent bout was SQL Server 2012 on Windows 8… a lot of this stuff hasn’t changed all that much since SQL Server 2000… I’ve had success with most of these commands when SQL Server 2005 – 2008R2 installs have gone sour on me in the past.
  • This is primarily an exercise in mule headedness… I wouldn’t look to this as a real resolution to a production problem… I wound up with a running SQL Server and SQL Agent after an hour or so of banging but God only knows what other problems and missing chunks could still be lurking when I try to fire up other peripheral services like Service Broker, Database Mail, etc.
  • During my SS2012 install on what I thought was a fairly fresh Win8 machine, SQL Browser was the original failure… ProcessMonitor showed me that the setup script was cranky about a missing a key around here:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\90\SQL Browser … note the interesting WoW subtree
  • I read a fair bit about various reg keys confusing the SQL Server installer and soon found myself unable to resist the sledgehammer urge … blowing away all reg keys and c:\program files under “Microsoft SQL Server” just feels right ;)
  • of course the next install didn’t go so hot either… next error was something about “MOF” and “WMI”… Googling yielded no silver bullets…
  • eventually realized that the main SQL Server service was actually “installed” to some degree but in a non happy state… hmmm… I’ve been here before… let’s keep throwing some wrenches at it…
  • first up, the SQL Server service wouldn’t start …
  • managed to get some help from launching SQL Server exe via command line: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\Binn>sqlservr.exe –sMSSQLSERVER2012
    • note that my chosen SQL Server instance name is “MSSQLSERVER2012” so you’ll need to substitute that with your own, or none at all if you are using default instance
    • was getting errors like this:
      2013-02-02 12:08:26.74 Server      Error: 17058, Severity: 16, State: 1.
      2013-02-02 12:08:26.74 Server      initerrlog: Could not open error log file ''. Operating system error = 3(The system cannot find the path specified.).
  • got sqlservr.exe to run a little further by specifying the errorlog path parm:
    • -e"C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\LOG\ERRORLOG"
  • Next errors made me realize I needed to provide all the missing system databases by copying them
    • from: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\Binn\Templates
    • to: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\DATA
    • and specify the master.mdf/ldf via command line:
      • –m”C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\DATA\master.mdf"
      • -l"C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\DATA\mastlog.ldf"
  • Next errors were like this:
      2013-02-02 12:54:59.13 spid4s      Starting up database 'msdb'.
      2013-02-02 12:54:59.13 spid8s      Starting up database 'mssqlsystemresource'.
      2013-02-02 12:54:59.14 spid4s      Error: 17204, Severity: 16, State: 1.
      2013-02-02 12:54:59.14 spid4s      FCB::Open failed: Could not open file e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\MSDBData.mdf for file number 1.  OS error: 3(The system cannot find the path specified.).
      2013-02-02 12:54:59.14 spid4s      Error: 5120, Severity: 16, State: 101.
      2013-02-02 12:54:59.14 spid4s      Unable to open the physical file "e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\MSDBData.mdf". Operating system error 3: "3 (The system cannot find the path specified.)".
      2013-02-02 12:54:59.15 spid4s      Error: 17207, Severity: 16, State: 1.
      2013-02-02 12:54:59.15 spid4s      FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql11_main_t.obj.x86release\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf'. Diagnose and correct the operating system error, and retry the operation.
    • I’m gathering this “e:\sql11_main_t.obj.x86release” path was where all the temporary files sat during installation… I haven’t been able to track down where that path is stored in order to set it right… for now I took the easy way out and simply created a symbolic link from that bogus path to my C:\ path and as they say, robert is your father’s brother.
  • Next problem was that the failed installation hadn’t gotten to the point of establishing any of the sysadmins logins… so couldn’t get SSMS to connect to the instance … I’ve actually run into this before… it’s not that bad to work around *IF* you can log into windows as the builtin “Administrator” account…
    • start sqlservr.exe in single user (aka maintenance mode) via: sqlservr.exe –m {plus all other parms previously mentioned}
    • enable your local Administrator account via cmd: net user administrator /active:yes
    • then login to Windows as Administrator (switch user)
    • fire up SSMS under this account and you should now be able to connect to your cranky SQL Server instance
    • add your missing sysadmin logins… e.g. sa, “BUILTIN\Administrators” and anything else you want… note: the NT account browser doesn’t display “BUILTIN\Administrators” in the list but it worked fine entered manually.
    • now you can logoff your Administrator account, switch back to your preferred login, stop sqlservr.exe via CTRL-C, start it back up in normal mode (without –m) and you should be able to connect normally
  • To get the service to start normally you could enter the –e, –d, –l parms on the service command line but I found that it is registry entries that normally provide these defaults so I went that route:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQLServer\Parameters
      • add string value: SQLArg0
        • -dC:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\DATA\master.mdf
      • SQLArg1 = –e{path}
      • SQLArg2 = –l{path}
  • The last annoyance laughing in my face was the SQL Agent… Service not even installed.
    • here’s the command line that wound up having the right footprint to make SSMS recognize a happy SQL Server Agent node:
      • sc create SQLAgent$MSSQLSERVER2012 binPath= "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\Binn\SQLAGENT.EXE -i MSSQLSERVER2012" type= own start= auto depend= netbios DisplayName= "SQL Server Agent (MSSQLSERVER2012)"
    • I think this reg key was also crucial:
      • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\SQLServerAgent
        • “ErrorLogFile” (String Value) = C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\LOG\SQLAGENT.OUT
    • everything seems to be fairly in order but I do see some evidence of a few remaining missing chunks when I browse the SQL Agent properties under SSMS… hopefully I don’t really care about those settings
    • couple other tips:
      • you can run C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2012\MSSQL\Binn\SQLAGENT.EXE from command line to get some clues
      • -c tells it to run as a standalone exe outside of the service control manger
      • -v is verbose output and looks useful
      • -I is the SQL Server instance designation
  • One remaining annoyance is that that SQL Server Network Configuration nodes are all empty under the SQL Server Configuration Manager console… no errors, just empty… supposedly this is tied to the “Client Tools Connectivity” installation item but I’ve remove/re-installed that successfully, to no avail… would love to hear how to recover this management panel functionality.

Loading Ice Cream Sandwich (ICS – Android v4.0) on Samsung Galaxy Tab 7.7 (P6800)

Links:

  1. ClockWorkMod (CWM) “Recovery” booter for our device - Direct link to binary
  2. The actual ICS ROM (file name - P6800XXLQ1_ICS_IT168.zip)
  3. MD5 Checker

Steps:

  1. Check model - First make sure you have the same exact model as me = GT-P6800… it will be on the back in small print at the bottom.
  2. Download the links
  3. Check ROM file – use MD5 Checker to confirm P6800XXLQ1_ICS_IT168.zip checks to 16A167C9 - 7B1B892D - BA6884AD – 36434CFE
  4. Install CWM - Follow link #1 for install instructions… they’re clear… don’t skim, follow them closely
  5. Backup - Boot into CWM menu and do the full backup of your current system.
  6. Install ICS – Follow link #2 instructions…
    1. *everything* could be wiped as a result, so make sure you know where to go reload all your apps!!
    2. follow steps closely
    3. one clarification “2) place on internal SD” basically means /sdcard/ on ours… you get to browse for it in CWM so it doesn’t really matter where.

The tab took forever to reboot back up from the glowing “SAMSUNG” boot logo after the install BUT IT WORKED!

I’ve had this running since 2012-08-18 and haven’t had a single glitch… this ROM is well in the bag 100% solid no-brainer by all accounts at this point. I hope to load CM10 JellyBean v4.1 or perhaps even CM10.1 v4.2 soon… the one thing that still hasn’t been fixed on those yet is HDMI out (as of 2012-12-18) … and I actually really like using mine as a Roku stand-in.

Good luck!

(Back to main GTab7.7 Post)

Blogger Custom Domain

(taken from here)
Enter Blogger Dashboard > Settings image
Under Publishing section:

Enter your custom domain in the first box complete with the www prefix.
Check the redirect box under it.

Save those settings.

You’re done with the Blogger side.
image
Log in to your domain registry account (Name.com, GoDaddy, etc.) image
First, especially if you ported your domain from another registrar like me,
make sure that your domain is set to use your new registrar’s Nameservers.
image
Now access your raw DNS record settings (aka “Total DNS”). image
Enter IP Address 216.239.32.21 as ARecord (@), this is a primary Google endpoint.  
and ghs.google.com as CNAME (for www)  
Save Domain registry settings.  
You’re done.  
Fire your page.  

Zenphoto – Hide ‘Dot’ Files

Pretty annoying there’s no easy built in way to not show images based on hidden file attribute. Best I could determine, one must implement dos “attrib” command or equivalent from PHP “exec” on every file in order to respect hidden file attribute (that sounds like way too much overhead to add on to my already pokey image gallery). I’m floored file attribs aren’t part of a more robust PHP file object but I guess this kind of stuff is hard to support in an OS neutral way.

I decided to run with renaming to .file.jpg and then hide those. Using ‘dot’ to represent hidden is very standard and pretty straightforward to accomplish the hiding via Zenphoto’s image_filter plugin API.

Zenphoto team provides generic image_filter sample to start with here: http://www.zenphoto.org/news/filter-file_searches

My dot file specific implementation (zero rocket science here): https://docs.google.com/open?id=0B5htuLP66oWlOFRnSElPVktlVTA

Drop php file in your zenphoto\plugins folder and enable via admin > plugins tab.

Add Video overlay Icon to Zenphoto Thumbnails

  • Edit \zp-core\template-functions.php, look for printCustomSizedImage() function and edit it to switch to using style=”background:url(‘’)” as shown below.
  • Configure overlay image:
    • Start with a completely transparent png the same height and width as your thumbnails (168 pixels in my case)
    • Find a preferred icon for the image (perhaps via Google Image Search) and paste that into your transparent background…
    • downsizing and hiding it in a corner is a nice effect
    • as well as adding a little bit of transparency
For example:
Video_Overlay

function printCustomSizedImage($alt, $size, $width=NULL, $height=NULL, $cropw=NULL, $croph=NULL, $cropx=NULL, $cropy=NULL, $class=NULL, $id=NULL, $thumbStandin=false, $effects=NULL) {
    global $_zp_current_image;
    if (is_null($_zp_current_image)) return;
    if (!$_zp_current_image->getShow()) {
        $class .= " not_visible";
    }
    $album = $_zp_current_image->getAlbum();
    $pwd = $album->getPassword();
    if (!empty($pwd)) {
        $class .= " password_protected";
    }
    if ($size) {
        $dims = getSizeCustomImage($size);
        $sizing = ' width="'.$dims[0].'" height="'.$dims[1].'"';
    } else {
        $sizing = '';
        if ($width) $sizing .= ' width="'.$width.'"';
        if ($height) $sizing .= ' height="'.$height.'"';
    }
    if ($id) $id = ' id="'.$id.'"';
    if ($class) $id .= ' class="'.$class.'"';
    if (isImagePhoto() || $thumbStandin) {
                      /* $html = '<img src="' . pathurlencode(getCustomImageURL($size, $width, $height, $cropw, $croph, $cropx, $cropy, $thumbStandin, $effects)) . '"' . */
        $html = '<img src="' . VideoOverlayIcon(pathurlencode(getCustomImageURL($size, $width, $height, $cropw, $croph, $cropx, $cropy, $thumbStandin, $effects))) . '"' .
            ' alt="' . html_encode($alt) . '"' .
            $id .
            $sizing .
            ' />';
        $html = zp_apply_filter('custom_image_html', $html, $thumbStandin);
        echo $html;
    } else { // better be a plugin
        echo $_zp_current_image->getBody($width, $height);
    }
}
 
function VideoOverlayIcon($url)
{
    if (isImageVideo()) return '/Photos/albums/Video_Overlay.png" style="background:url(' . $url . ')';
    else return $url;
}

Windows 8 Search Drops Outlook :(

Nutshell:
  • Windows 8 Metro search doesn’t include Outlook indexed items at all.
  • Windows 8 Explorer can be told to search Outlook items but only with Outlook 2010 (or older).
  • If you want to search Outlook 2013 in Win8, you must use Outlook 2013’s search.
References:

Trail Map Image to Google Earth

The idea of taking PDF or PNG/JPG based trail maps from anywhere you can find and loading them into Google Earth (GE) on your mobile device to give you a live GPS trail map.

Basic tools you need:

  • A “KMZ Builder” - to turn the raw image into a KMZ file. The primary task here is mapping specific pixel points on the image to their real life lat/long. The easiest freebie I’ve found so far is Google’s Custom Maps tool for Android. It sounds like ArcGIS also provides this capability but that’s a fat commercial PC package.
  • A “KMZ Loader” – for whatever idiotic reason current versions of mobile GE only load KML’s not KMZ’s. PC GE actually does load KMZ’s directly so maybe there’s hope this will fall away in future revisions. Here are Android and iOS KMZ loader apps that have worked great for me. I believe they simply extract the KMZ and feed the contents to GE automatically behind the scenes. On Android the dang thing works by firing up a mini web server to provide the KML how GE wants it… amazingly GE will only retrieve these suckers from a web URL, not a local file.

KMZ’s are convenient in that they carry the KML and the map image file together in a ZIP package. KML is just some simple xml describing pertinent info like the lat/long points and an href to the image file. If you’re curious about the KML, just rename the example .kmz file linked below to .zip and take a look at the very simple contents in notepad.

The greater Seattle area obviously has tons of cool trails… we’ve been exploring Whidbey Island lately… but I’m not finding much of any of them logged in the Garmin products I have nor on Open Street Maps. *BUT* there does seem to be decent trail coverage provided from PDF/image based trail maps on all the various federal/state/county .gov sites. And that’s where this little approach comes into play.

Taking the basic approach to the next level - Photoshop the original map image such that there is only the raw trail lines sitting on top of a transparent background. The result looks pretty dang good when loaded into GE. Tip: Use the Select > Color Range menu, hit the white background of your map with the eye dropper and play with the “fuzziness” slider. You’ll get all of the background selected to where you can hit CTRL-X to delete it leaving the trails freestanding on transparency (save as PNG file format). CTRL-SHIFT-I to invert the selection to only the trails and then Image > Adjustments > Replace Color to flip the lines from black to white to make them stand out when overlayed onto GE.

Here’s an example KMZ I’ve slapped together from this source PDF. You may notice it’s not quite lined up, I believe it’s only a matter of taking more care when using the Custom Maps tool… but it should give you the idea. If you load GE on your PC, you’ll be able to double click this file to see what I’m saying. It all rotates in 3D and even gets “clamped” to the terrain! From what I can tell, once GE has cached your tiles, you can count it working offline.

Before
image
After
image