SQL Check DATABASE Restore Percentage

A simple method to check estimated completion time for a database that is currently being restored in SQL

Powershell – Failed to enumerate SSL bindings, error code 234.

This is sometimes due to misconfiguration of the SSL certificate bindings in the registry, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters\SslBindingInfo
In my case I had 0.0.0.0:443 in the directory multiple times.

Fix: GOTO HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters\SslBindingInfo and clean up multiple entries.

Code – Make a CSV list of all files and folders

Powershell code to make a CSV list of files and folders

Cannot assign to read only property ‘$methodName’ of false Use –force to continue

One receives this error with Grunt, AngularJS if the grunt-ng-annotate is out of date.

Open your project.js and remove the grunt-ng-annotate, most of the time it is an old edition like 0.4.0. save an push to your server if you are remote.

Then on the server reinstall your grunt-ng-annotate

How To – Redirect emails after hours.

Requirements: Microsoft Outlook, VB SCript
[skill_bar heading=”Cyclomatic Complexity” percent=”10%” bar_text=”VB Script”]

1. Start Outlook
2. Click Tools->Macro->Visual Basic Editor
3. If not already expanded, expand Microsoft Outlook Objects in the Project pane, then click on ThisOutlookSession
4. Copy the script below
5. Paste the script into the right-hand pane of the VB Editor
6. Edit the script making the changes as per the comments I included in the code
7. Click the diskette icon on the toolbar to save the changes
8. Close the VB Editor
9. Click Tools->Macro->Security
10. Set Security Level to Medium
11. Close Outlook
12. Start Outlook
13. A dialog-box will appear telling you the ThisOutlookSession contains macros and asking if you want to enable them. Say yes.
14. Test the macro
15. When the macro runs Outlook will present you with another dialog-box advising that a program is trying to access your mailbox and asking if you want to allow it to. Say yes.
16. If a message from the designated user, with the specified subject is in the mailbox, and if the time is currently between 9:00am and 5:00pm, then the message will be moved to the destination folder. Otherwise, nothing will happen.
17. Once you’ve verified that the macro works as expected, then you need to sign the macro to avoid having Outlook security warn you each time the macro runs. Here’s a link to instructions on exactly how to go about doing that: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp

Find the version of jQuery via Console

Both versions 1.x and version 2.x have a property called jQuery.fn.jquery
that can be used to check what version number of jQuery is currently active on the site.

Track events on all elements with Google Tag Manager

Box Tag Code
Requirements: Google Tag Manager, jQuery

[skill_bar heading=”Cyclomatic Complexity” percent=”80%” bar_text=”Javascript”]

This program is designed to monitor a users activity for events (var events) and on each event it tracks the users action then push the data to Google Analytics via Google Tag Manager.

The first issue with tracking elements within the DOM is element naming, most back-end element names are not user friendly and the report would require a developer to decode or a secret decoder ring. To work around this issue I have added an HTML5 data attribute that can be used to store easy to understand names, ‘ga-boxtag’.

The second issue is that not all DOM elements have the same attributes, or at lest not the same attributes I would like to track, therefore I have added a switch statement to look at the element tagName then based on the tagName it will create a label.

Data I am pushing to Google Analytics

  • Category : ‘Box Model Tags’  (a static string )
  • Action: Event Type ( one of var events )
  • Label : A bar | separated list of parent elements names with the HTML5 data attribute of ga-boxtag
  • Value : First it looks for the title attribute if null, it looks for an alt attribute if null then it will capture the src for images or the textNode for A elements.

Event Report in Google Analytics:

[image src=”http://jaminquimby.com/wp-content/uploads/2015/05/boxTagGAReport-1.png” alt=”Google Analytics Event Report Sample” type=”rounded, circle, thumbnail, lightbox” float=”left, right, none” link=”false” href=”#” title=”Google Analytics Event Report Sample” target=”blank” info=”Google Analytic Event Report, popover” info_place=”top, right, bottom, left” info_trigger=”hover, click, focus” info_content=”Google Analytics Event Report Sample” lightbox_thumb=”http://jaminquimby.com/wp-content/uploads/2015/05/boxTagGAReport-1-300×160.png” lightbox_video=”true” lightbox_caption=”This content will only show up if you use a lightbox”]

Google Tag Manager Setup
[tab_nav type=”three-up”]
[tab_nav_item title=”Tags” active=”true”]
[tab_nav_item title=”Triggers”]
[tab_nav_item title=”Variables”]
[/tab_nav]
[tabs]
[tab active=”true”] Name: Analytics – Box Tag Code
Product: Custom HTML Tag
Note: This function has been wrapped in a closure so it will not interfere with any other code on the site.

Configure Tag Code:


Name: Analytics – Box Tag Tracking
Product: Google Analytics
Choose a Tag Type: Universal Analaytics
Configure Tag:

  1. Tag Type: Universal Analytics
  2. Tracking ID: {{Google Analytics ID}}
  3. Track Type: Event
  4. Category: {{Box Tag Category}}
  5. Action: {{Box Tag Action}}
  6. Label: {{Box Tag Label}}
  7. Value: {{Box Tag Value}}

Fire On: Box Tag
[/tab]
[tab] Name: Box Tag

Choose Event: Custom Event

Fire On:

Event Name: boxTag
[/tab]
[tab]

Choose Type: Data Layer Variable

Data Layer Version: 1

 

Name: Box Tag Action

Data Layer Variable name: boxTagAction

 

Name: Box Tag Category

Data Layer Variable name: boxTagCategory

 

Name: Box Tag Label

Data Layer Variable name: boxTagLabel

 

Name: Box Tag Value

Data Layer Variable name: boxTagValue

Optional Variable:

One should already have a Google Analytics ID variable, Static Variable with your Google Analaytics Account Number [/tab]
[/tabs]

.NET Framework Required

HOW TO – SQL Server 2008 Installation

PREREQUISITE:MS SQL Server 2008 requires .NET framework and windows installer. If these two components are not installed in your system it will prompt you to install both of them automatically if you have Internet connected on your system:

  1. Prompt for the Prerequisite
    .NET Framework Required
  2. Extracting files require by the installer.
    Extracting Prerequisite files
  3. Loading setup to install prerequisites
    Loading Setup Files for Prerequisites
  4. .NET License agreement. Click “Install >” to proceed (downloading files from web).
    .NET License & Terms of Agreement
  5. Downloading components from Microsoft’s website.
    Downloading .NET Framework
  6. Installing downloaded components.
    Installing .NET Components
  7. Update Complete
    .NET Setup Complete
  8. Now install the “Windows Installer” component to its latest release. Follow the following windows respectively.
    Click Next to proceed and install “Windows Installer”
    Setup - Windows Installer
  9. License Terms & Agreement, Read & Click Next.
    Windows Installer License Agreement
  10. Start Installation of Windows Installer.
    Windows Installer - Backing Up Files and Applying Updates
  11. Restart services required by windows installer.
    Stopping services for windows installer
  12. You should now have .NET & Windows Installer and any hot fix’s on your system, your preresiqute are complete.
    HOT FIX KB942288-v3 Finishing
  13. Reboot your computer
    Required to Reboot

INSTALLATION: Follow this procedure to install Microsoft SQL Server 2008:

  1. Choose the Installation section displayed in the Left side of the wizard.
    SQL 2008 Planning window
  2. Installation will look like something like below; Select the first option to install the SQL Server 2008.
    SQL 2008 Installation Screen
  3. Setup will now run support rules to checkup & optimize your system’s configuration for SQL Server 2008.
    Please wait screen
  4. Rule Check in Progress
    Setup Support Rules
  5. If you have passed all your support rules then the following screen will appear.
    Rule check complete
  6. Click “OK” in the above screen to proceed installing the SQL Server.
    Please wait screen
  7. Type in your product key and click “Next” to proceed further.
    Enter SQL 2008 Product Key
  8. License agreement “I accept” to continue.
    SQL 2008 License Agreement
  9. Setup Support Files, click “Next” to continue.
    Setup Support Files
  10. Run the setup rules again, click “Next” to proceed
    Rerunning the support rules
  11. Select components needed for your installation then click “Next”. Note for clustered installations,only Database Services & Analysis Services can be clustered.
    SQL 2008 Feature Selection
  12. Setup the name and Instant ID for the SQL Configuration. Default instance (normally localhost).
    Disk Requirement Check for space
  13. Disk space requirements. Scans all drives, you can change the location of the installation during the instillation step 16.
  14. Now, in this window you can define server configurations that which service will run under which account name of your system. Or you can also use same account name for all services by clicking on button “Use the same account for all SQL Server services”
    Server Configuration selection
  15. Clicking on the “Use the same account for all SQL Server services” button in the above screen will display the following window; select the account name from Account Name field.
    Specify username and password for system accounts
  16. Database Engine Configuration, authentication & data directories. Windows authentication mode or Mixed mode.Mixed mode will allow the SQL Server to also run its own authentication. Data directories tab you can specify the SQL Server Installation location.
    Database engine configuration, authentication & data directories.
  17. Error and usage reporting. Big Brother.
    Error Reporting
  18. Installation Rules, setup will determine if any part of the installation will be blocked.
    Installation Rules
  19. So, now you are ready to install SQL Server 2008.
    Ready to Install
  20. Installation in progress, this process could take 30 to 45 mins. Now would be a good time for a break.
    Installation in progress

Setup is complete. Remember to reboot.

Convert PFX to CRT and Key

Requirements: OpenSSL

Variables:
@new-keyfile.key = Your key file that will be exported by openssl
@yourfile.pfx = Your PFX file
@certificate.crt = Ones certificate that is exported from the yourfile.pfx
[skill_bar heading=”Difficulty” percent=”1%” bar_text=””]