Custom Print CSS for Akamai Delivery Reports

If you're impatient and don't want to wait for a report from Akamai to be emailed to you, here's a little CSS that will clean up the Site Delivery page nicely.

@media print {
 html {
  margin-bottom:0;
  min-height:auto;
 }
 #iframeheaderwrapper, #iframefooterwrapper, .navwrapper, #moreoptions, #maininside > form, .helplink {
  display:none !important;
 }
 .iframepage .contentarea {
  min-height:auto;
 }
 .contentarea {
  margin-left:0;
 }
 #moreoptions + * + .shadowwrapper + .shadowwrapper + .shadowwrapper,
 #moreoptions + * + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper,
 #moreoptions + * + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper + .shadowwrapper {
  page-break-before:always !important;
 }
}

Notice the lovely use of adjacent child selectors to ensure proper page breaks.  Most browsers don't support nth-child or page-break-inside so statements like following don't help.

 .shadowwrapper {
  page-break-inside:avoid !important;
 }
 .shadowinside, .shadowinside2, .titlebox {
  page-break-after:avoid !important;
 }
 .graphbox {
  page-break-before:avoid !important;
 }
 .tableinsidegraphbox, .titleboxinside {
  page-break-before:avoid !important;
  page-break-after:avoid !important;
 }

The result is a cleanly printing report that doesn't have boxes breaking across pages. If you want to this be the default print settings for Akamai, you can add a site-specific CSS rule in Firefox.

Per-site custom CSS in Firefox

Ever wished you could customize the look and feel of a website you frequently visit, and have the changes stick?  Sure you can use the Web Developer toolbar or Firebug, but that's a pain and also isn't persistent.  Overriding settings globally for things like link colors and font has been around for ages, but per-site customizations are a bit newer.

All you need is a text editor (or ChromEdit Plus) and a basic understanding of CSS.

  1. Create a file called userContent.css in your Firefox profile directory, inside of the chrome directory.  On OS X this will be inside of <home>/Library/Application Support/Firefox/Profiles/>random characters>.default/chrome/ and %appdata%\Mozilla\Firefox\Profiles\<random characters>.default\chrome on Windows. If you've been upgrading since very old versions of Firefox the profile directory might be called default.xxx
  2. Paste the CSS you want into userContent.css, but wrap it in an @-moz-document rule like this (assuming you want to see a white background on my site).
    @-moz-document domain(coreygilmore.com) {
     #bd {
      background:none;
     }
    }
  3. Save userContent.css, close and re-open Firefox. Each time you edit userContent.css you'll need to quit and restart Firefox.  This is obnoxious, but not a high priority for Mozilla given the 5 year old enhancement request.

@-moz-document options

  • @-moz-document url(http://lodoconversations.com/) - only the page http://lodoconversations.com/
  • @-moz-document url-prefix(http://www.coreygilmore.com/blog/2007/) - anything beginning with
    http://www.coreygilmore.com/blog/2007/
  • @-moz-document domain(backupmoxie.com) - anything on the backupmoxie.com domain

You can chain options also:

@-moz-document url(http://lodoconversations.com/), domain(backupmoxie.com) {
 color:red;
}

Why is this useful?

Some sites are just ugly, but a more common case is fixing printable output.  Use the @media rule to specify a list of items that should be hidden, or have more print-friendly colors.  You could also hide all advertising blocks or remove the underlining from links.

Another option for per-site custom CSS is to use the Stylish extension which can be thought of as Greasemonkey for CSS.

Use the Microsoft Keyboard IntelliType Zoom button to scroll

I recently picked up a Microsoft Natural Ergonomic Keyboard 4000 since I prefer to have a wired keyboard, but wanted to try out an ergonomic keyboard for a while.  I've only been using it for a day, but overall I'm quite pleased with it.  The only thing I found fairly useless was the Zoom button in the middle of the keyboard.  I very rarely zoom anything, especially a webpage.  What I do frequently do though, is scroll. Using the IntelliType software you can change the functionality of all the extra keys, but you can't modify the Zoom button behavior.

Zoom Button

Luckily you can edit commands.xml (\Program Files\Microsoft IntelliType Pro\commands.xml) and change the action performed by the Zoom button.  Open up commands.xml with a text editor and replace the following lines:

<C319 Type="6" Activator="ZoomOut" />
<C320 Type="6" Activator="ZoomIn" />

With:

<C319 Type="6" Activator="ScrollUp" />
<C320 Type="6" Activator="ScrollDown" />

I replaced it for the following applications:

<Application UniqueName="IEFrame" AppName="Internet Explorer">
<Application UniqueName="IEFrame7" AppName="Internet Explorer 7.0">
<Application UniqueName="MozillaUIWindowClass" AppName="Mozilla Firefox 1.5">

Once the changes have been made you need to reload the keyboard driver.  From the Start menu choose Run and type mskey and press enter.  Microsoft Keyboard Diagnostics should load.  From the Actions menu choose Close IntelliType Pro.  Then re-launch IntelliType (Start, Run, "C:\Program Files\Microsoft IntelliType Pro\DPLaunch.exe" keyboard cpl) or by choosing Microsoft Keyboard from the Microsoft Keyboard Start Menu group.  Adjusting the Zooming speed in IntelliType will also control the Scrolling speed.

The application failed to initialize properly (0xc0000022).

I started receiving the error The application failed to initialize properly (0xc0000022) on my primary development machine (running Windows XP SP3) whenever I tried to launch select applications (cmd.exe, SecureCRT, runas.exe, mmc.exe, etc).  It had been a while since my last reboot and I had installed a some new programs and the latest Windows Updates, so I assumed it was related to that.

One reboot later and some applications (cmd.exe) would launch, but many others still wouldn't.  A quick Google search showed that this was often related to the permissions being incorrect on some core system DLLs.  No problem, find the DLLs, right click, properties.  And the Security tab was missing.  The most common cause of this is that Simple File Sharing is enabled.  Except it wasn't. I toggled that off/on, and still the Security tab was missing.  Enter CACLS - a command line utility to view/edit file ACLs.

Fixing Windows DLL Permissions

Windows is trying to load a DLL that the application depends on, and something is preventing it.  Given that the Security tab was missing from an Explorer Properties window, my guess would be that a DLL that controls ACLs and permissions had restrictive or corrupted permissions.

The CACLS commands below modify all .dll and .ocx files inside the system32 directory and grant members of the Users group Read access.

  • As an Administrator open a command prompt - Start > Run > cmd
  • Inside the command prompt window type:
    CACLS %systemroot%\System32\*.dll /E /G BUILTIN\Users:R
    And press Enter.  This will take a minute or so and will display a slew of processed file: C:\WINDOWS\System32\blah.dll messages.
  • Then type:
    CACLS %systemroot%\System32\*.ocx /E /G BUILTIN\Users:R
    And press Enter.

After both commands completed I was immediately able to launch all of the previously non-functional applications.

Application DLL Dependencies

Here are the top-level dependencies for some of the applications that were not working properly.

The reason I chose to modify all of the DLLs was pure laziness - SecureCRT has 135 DLLs it depends on, VMware Workstation has 157, cmd.exe has 130.  If you are aiming for precision use the excellent Dependency Walker and load each application.  Copy the DLLs with full paths, remove anything outside of %systemroot%\system32 and then find the common shared DLLs from list.  Use the same CACLS command (CACLS %systemroot%\System32\FILENAME /E /G BUILTIN\Users:R) for each of those files.