Jul 11th 2013
My Blog's Notable Octopress Tweaks

My plan is for this post to serve as an index to the upcoming posts. Unlike the ASP.NET MVC posts that fizzled (sorry), I need to chronicle these changes in the event I need to dissect them again.

Here's the collection in no particular order:

  • Copyright date - This one is simple and almost not worth noting. I use a copyright date range of "[start year]-[current year]" and this post simply explains the what and why.
  • Tag generator - Octopress will not support tags. Tag index pages are trivial to implement but I'm also starting to agree with the premise that one taxonomy should really be enough.
  • Feed excerpts - These aren't generally created to my knowledge, or specifically the summary section. The general way to create excerpts is a little awkward but smart.
  • Google Form notification full service sample taken from here.
  • (Upcoming) Category & Tag index generators for the primary /categories/ /tags/ directory. WordPress didn't have this either but it would be a good idea to list all of them in one place.

One thing in the FAQ that particularly bit me during the WordPress conversion was Using Non-ASCII Characters In Your Blog. Most conversion posts cover this but I'm in the habit of always having this as part of my environment just in case.

The primary reason for my approach so far was to be a close representation as possible of the WordPress site to combat 301 redirect woes. Tags will eventually disappear I think but I like the exercise of making sure they're around in full. The platform seems to support "something" so it's fun to see how far I can go with it.

Jul 10th 2013
Migration From WordPress to Octopress Complete

In case anyone was watching, I switched the blog from a generic WordPress with a slightly customized theme to octopress. I'm using the excellent Octoflat theme with a few notable tweaks. I reintroduced the search and feed buttons as well as expanded the navigation to allow nested menus. The theme allows for nested menu elements and while 2 levels deep is highly acceptable, I happen to use 3.

I'm writing this post using the excellent MarkPad which serves all of my needs perfectly. You don't need a markdown editor, but having one with live-preview that reinforces the markdown syntax is killer. That I can insert a URL and it automatically format the document accordingly is a small but useful touch.

I plan on posting the various tweaks that make up this blog. While there aren't a ton, I think a few of the concepts are worth expanding on. I don't claim these tweaks are original by any means but I found a lot of ideas needed to be fleshed out a little more to be acceptable for my tastes. Yes, I'm anal.

I expect nothing but great things from this migration though it took roughly a month of quite a few tinker sessions to get things where I wanted it. I blame using Ruby on Windows to be a big culprit but also my n00bness got in the way in some areas. It also took me quite a bit to grok how deployments functioned but now that everything gels, I don't expect any issues.

The site will continue to be a slight work in progress as I button up some of the loose ends. I have a few design tweaks in mind and I'm looking to expand my portfolio with more current projects. Not everything I've done in the past 2 years can be seen unfortunately but there's quite a body of work piling up, waiting to be shown.

May 2nd 2012
Shadow Copies on XP, Robocopy, PowerShell V2

[I forgot to post this draft back in April 2010. Needless to say I no longer utilize the technique nor can really help now that it's purged from my memory]

I've cobbled together a poor-man's backup solution using PowerShell and robocopy in what I thought was a somewhat resilient solution. Robocopy turned out to be a poor choice based upon my needs and nitpicks but I wanted to outline why to save myself and others a little pain.

Strike 1:

This URL describes the bug and relative fix: http://superuser.com/questions/48303/access-denied-error-with-robocopy-as-admin. While using /ZB and /B helps it wasn't solving the problem because the relevant ACLs weren't being created even as late as Windows 7.

Strike 2:

robocopy has 3 (relevant) major versions: 2003 Resource Kit (the one I was using 010), Vista/RoboCopy GUI (026), and Windows 7. To make things more complicated, installing RoboCopy GUI on a 2003/XP machine will put robocopy under %windir%system32 which happens to enumerate after the 2003 Resource Kit path. This means you have to explicitly call system32robocopy or rename the resource kit version if you hope to keep the other resource kit tools.

Strike 3:

I erroneously thought by adding users to the Backup Operators group, a requirement to use the /B switch, robocopy was creating local shadow copies. I might have been confusing it with HoboCopy and figured taking a shadow copy snapshot before a robocopy operation would fix the problem. Turns out taking all that time, determining you almost always need to be administrative, and XP's limited ability to easily expose a snapshot as a drive letter/share made this become an incredible deal breaker.

Temporary solution:

To combat the bug that started this investigation, I initially tried using version 026 of robocopy to no avail. I used every combination of /copyall, /copy:dats, /copy:dt or just /copy:d.

What really fixes the problem is to completely obliterate the destination folder(s) and start over. This would correctly build the relative ACL and prevent the access denied message but it would only be a matter of time until it happened again.

My permanent solution:

  1. Steal Steve Murawski's great Invoke-SyncFrameworkSample code outlined here. (download link at the bottom)
  2. Install Sync Framework 2.0 Runtime.
  3. Modify code to use 1 or 2-way sync (default sample is 2-way).
  4. Modify code to enumerate the FileReport object and build a slightly more robocopy-like output.
  5. Modify code to create DestinationPath*. If it isn't found it doesn't make sense to do a 2-way sync either.
  6. ???
  7. Do not profit. The bulk of the code isn't mine :(

Note: Robocopy is an end-to-end solution whereas I have far more flexibility to shoot myself in the face with this PowerShell script and the Sync Framework in general.
*: This technique negates the solution completely because I'm creating these directories under the user context the script is run in.

Shadow copies aren't used so to run this in a limited user context I still need the user in the Backup Operators group. I will likely work up a solution using shadow copies on the server as I can rather painlessly manipulate them using WMI. AlphaVSS behaves much better if you are not using Windows XP too.

Nov 17th 2011
Dotfuscator on WP7 Hurdle: Re-Signing Assemblies

I've started toying with the proper Dotfuscator project settings to give me a workable, yet relatively-secure-as-possible package for deploying to private beta testers and the Marketplace. A great starting point for this journey could be found here: http://weblogs.asp.net/bsimser/archive/2010/12/31/dotfuscator-deep-dive-with-wp7.aspx.

Before we start, my project includes a number of 3rd party controls like AppBarUtils, MVVMLight, Funq, and my favorite IrcDotNet (which is the source of this post). The instructions say to use your XAP file as input so we'll follow that. On the far right-hand side of the Input Files toolbar is Transform XAML/BAML resources in all assemblies. Click this to turn it off primarily to be thorough. I believe this affects MVVM because it tries to rename Xaml internals that are data bound. Follow the instructions on the Settings->Global Options screen to set Disable Control Flow and Disable Renaming to No to enable them.

Now click the Build Project toolbar button to build your project. If your XAP includes a signed assembly, you'll be greeted with the following message:

Warning: The strong named input assemblies (or assembly) <TempDirectory>IrcDotNet.dll were not resigned. You will need to sign these dotfuscated assemblies manually.

My first instinct was to go to the Settings->Signing screen, and enable Re-sign Strong Named Assemblies and point it to IrcDotNet.snk. If you do that you're met with a different message:

Signing Assemblies... Running sn.exe /q /R <ConfigDirectory>IrcDotNet.dll <Location of>IrcDotNet.snk Warning: Password protected Strong Name files are not supported sn returned 1. Build Error.

This is the end of the line as far as automation goes. The only recourse is to sign the assembly manually as the original warning states. If you do not resign this file before deployment, your app will not startup properly. Once code hits that signed assembly it simply will not function.

My first approach was to go to the Rename and Control Flow tabs and exclude every assembly other than my own. This produces the same result. Assemblies are reassembled regardless of whether or not any options are applied.

My preferred approach is to go to the Input tab, right click on each 3rd party assembly and click Exclude assembly from package. This has a lovely UI effect of removing everything from the screen and pausing while Dotfuscator works its magic. The added bonus? This happens every assembly. The bare minimum would be to only remove those signed assemblies but I took it all the way and removed all 3rd party dlls. These are all open source frameworks so obfuscating them isn't necessary.

Now click Build Project again and the app starts! Inspecting the result in IL Spy gives me a runtime error on decompile, meaning control flow is on and teh IP iz protectordez. My app also uses localization and Smart Obfuscation automatically disables renaming for my localization resources so no extra legwork is needed to exclude them.

In summary if you don't need to obfuscate 3rd party assemblies, simply exclude them from the Input tab rather than trying to exclude them in the individual obfuscation tabs. Ilasm is still ran on the assemblies which triggers the need to re-sign them.

May 29th 2011
Avenged Sevenfold - Nightmare -> Severe Badassery

I promised a post on kind of breaking down how I understand the album but I thought a combination of it could make me pretentiously douchie and who really cares? Well I do.

I figured I'd try to post this as I listen to the album, giving notes on each track. One thing kind of goes without saying that this is The Rev's last studio work before his death and much of that echoes through each track to me. It's going to be very weird hearing an A7V track without him physically on the drums. Not that I hated any of the other albums mind you, but this is perhaps his best work too which makes it even more tragic to me. I literally can't listen to it without going "Aww damnit!" every time I remember.

I won't try to dissect what I think each track means I don't think. That seems a little pretentious because people often have their own interpretation anyway. Now that I've bored you and the title track Nightmare is over I can go over it:

1 Nightmare - The opening track starts out really mellow which A7V can do quite well but when hell hits around the 0:30 second mark it instantly becomes a typical track. Dueling squeals of guitars and drums of steel quickly start the crescendo to the first verse. The solo sections aren't too over done and when the drums come back, I can't help but start head banging. This is a strong opening for me, really.

2 Welcome to the Family - I have to admit now that I've stopped playing the entire album full stop, I tend to skip this one. This is a track I'd love to play on Rock Band just for the random complexity in spots. As I listen to it I can't really put why I don't like it to words but I think I just pine for the other tracks.

3 Danger Line - I confess I did skip the last track. Danger Line starts with a sweet snare bit that just keeps me interested immediately. I said I wouldn't describe the meaning of tracks but this one seems pretty straightforward and I'll admit it's part of what hooks me. It doesn't hurt that during the verse there's a badass low riff leading to more dueling fills. What really gets me, and sets off that response someone had a name for is right around 3:15 when the piano starts (Hi, Rev! :(). Once the last words are spoken and the guitars come back, I not only identify with the person the track describes but The Rev as well. It's partly eerie how well it works and how deep it can go without personally knowing these people.

4 Buried Alive - Starting off with a lovely ditty to immediately follow the last track, I get sucked in like a black hole. I might not some of these tracks on their own but the order was pure mastery except for one caveat*. There's not much I can say other than it's just all good and especially around the 5:00 mark when the beat changes. Much head banging ensues.

5 Natural Born Killer - Starts off strong with a nice fast tempo. I tend to not like this track like #2 for unknown reasons. I suppose the correct phrasing would be "like less" because I could listen to all of the tracks quite easily but others have a lot of gravity if the metaphor holds.

6 So Far Away - I suppose the only thing I can really say is the words are eerie in the context of everything but right about 3:40 when the slowness starts it ramps up in awesome for me. Belting out "Soooo far awaaaaay" really makes the words hit even harder.

7 God Hates Us - As a Christian I can't say I enjoy the lyrics at all, which tends to lead me to skip it. Yeah I know, such a Bible thumping behavior but I suppose part if it reminds me of the times I did "hate God" which only reminds me of how drastically my view to cause such hatred was altered. I don't believe God hates anything but that's neither here nor there.

8 Victim - It's hard to describe any special parts of the track though I listen to it consistently with everything else. It's a solid yet basic A7V track to me.

9 Tonight The World Dies - I actually have to skip this track consistently. When he sings a long "Iiiiiiiiiiii" somehow that note just pierces my brain and I want it out of my head immediately. I'm listening to it to the point where that starts, which is right around 1:40. Ugh skip time.

10 Fiction - By far far far far my favorite track. I suppose it's The Rev's badass piano work in addition to the drum beat. The entire thing is just ear sex to me. I'm being sonically "fucked gently" as it were. Ending on the organ as they do just seals the entire package for me. I can't really explain it other than "mmmmmmm mmmmmmmm, bitch!"

11 Save Me - Welcome to my second favorite track and only because of the fucking awesome intro. This is the way to end a metal album to me and again goes back to placement. I'd really love to play this on Rock Band. Being a 10 minute song though would be Freebird quality almost but I suppose I can't get over how awesome the song is in spite of this. To that end it almost gets too excessive but it never steps over that boundary. "Tonight we all die young" does explain things quite well and since that's my last lyric paste I can promise I won't make any more.

*- The caveat is the last two tracks are so badass I'd rather listen to them earlier but it does end with a huge bang.

So there you have it. I personally think it's a badass album and I'd almost listen to tracks 10 and 11 first but any new album always gets a straight 1-n pass as many times as I can stand it so I can determine which tracks I skip. This album has almost 0 especially if I just wanted to be lazy. This is Avenged Sevenfold to me and every album has grown to be better than the last for me. It's quite sad that I'll miss The Rev though, especially having never seeing them live yet.