Recently in Computing Category

Portland Code Camp 2010 - Intro to YUI3

No Comments No TrackBacks

This post will be going up almost exactly the time that I complete my Introduction to YUI3 talk at this year’s Portland Code Camp. I want to thank everyone for joining me at this presentation, and I hope to see some of my attendees around the YUI community.

The sample application is based on a Django project for a simple checkin system. The code in it’s completed state (at least, what I hope to complete) is up on github. Whatever I do complete tomorrow will be available as a ‘portland2010’ branch on that project after I present.

As a tool to help me complete the code in a reasonable time frame, I did create several snippets for the snipmate plugin for VIM, which I think are compatible with TextMate’s plugin system.

Either way, I encourage the YUI community to fork the gist linked above and I’ll gladly merge in additional snippets.

I’ll post more of a post-mortem about the presentation next week. Also, I am planning to prepare a more advanced YUI3 presentation for the Palouse Code Camp that I helping organize for September.

  • StumbleUpon Toolbar Stumble It!

Recently, another Gawker Media employee traded blows with Steve Jobs. However, this time, the battle was short and via e-mail, instead of ongoing and legal. The discussion began with Ryan Tate, the Gawker employee in question, asking Steve Jobs about a recent advertisement that claims that the iPad is a ‘revolution’. Tate’s complaint centered around a belief that revolution’s were around Freedom, which the iPad does not encourage.

Job’s reply to this call out on freedom was, as to be expected, very defensive of his latest toy.

Yep, freedom from programs that steal your private data. Freedom from programs that trash your battery. Freedom from porn. Yep, freedom. The times they are a changin’, and some traditional PC folks feel like their world is slipping away. It is.

Okay, ignoring the awesome Bob Dylan reference (which Tate made first, but still, great), the rest of the reply is purely ridiculous, as every single ‘point’ he makes can be easily substituted with “freedom from things that I deem unacceptable.”

Programs stealing my personal data? That’s bad, I absolutely agree, but what if access to my contacts database makes my Twitter app drastically more useful? What if I want a different interface for my contacts than what the Cult of Steve has chosen to provide me? Yes, it is possible that providing access to personal data on my phone can be misused, but it’s also very possible that providing that same access will make my experience drastically better. People have done a ton of work on Android which makes it possible for blind people to use a touch-screen Android device fairly effectively. I doubt you’ll ever see anything similar on iPlatform. Apple would have to do it, and I doubt they will.

Freedom from programs that trash my battery? What about freedom to choose to use programs that might hurt my battery, but are useful enough that I can suffer through that inconvenience? I don’t know anyone with an iPhone that doesn’t need to charge it daily anyway (and I know my Android phone needs a daily charge, occasionally with a charge during the day, depending on how much I’m using the music player and display). That’s the thing. What tends to kill your battery, in my experience, is almost always just USING the damn phone. The display is a huge drain, the other huge drain being the radio, particularly when you’re in an area with poor or weak signal. Battery drain is a problem, but it’s not something that anyone should wish to trade freedom of choice for a tyrannical freedom for.

Most distressing, however, is the claim of ‘freedom from porn’. I’m not going to defend Pornography, at least not directly. Most pornography on the Internet is disgusting and degrading, though not all of it is. I’m not going to dwell on the fact that even refusing pornography apps doesn’t stop safari from loading porn, or Safari being set to display Pornography as it’s homepage. Hell, even in the Apple Store, some people will set the default home page on the iPads to hardcore pornography (no idea why they don’t blacklist their wifi). Hell, I’m not even going to dwell on the fact that there are plenty of almost pornographic apps still being sold.

No, those things, which are all relevant, aren’t what’s really scary about Jobs’ comment. The fact is, it’s not about Porn. It never was.

Whenever someone in a position of authority begins talking about the ‘evils of pornography’, or anything of the sort, you should begin to get worried. Because, odds are, they don’t really care about Pornography. But, in American society, where we’ve developed a very puritanical (and frankly hypocritical) view of sex, the vast majority of people will never try to even be seen to be defending pornography. Because it’s dirty. Because it’s shameful. Because it’s wrong for no reason other than we’re supposed to think it is.

Recently, a music industry spokesman said, at a conference in Stockholm, that Child Pornography was a wonderful tool to use to push for censoring and filtering the Internet. Now, I will give Steve credit for avoiding the child porn argument (which is indefensible), however, I’m of the opinion that he’s using pornography as a similar tool. I am not saying that Apple should be forced to allow pornographic applications to be distributed via the App Store. Google won’t carry that material via the Android Market, and forcing a distributor to carry any particular product is not something I’m okay with. However, the control that allows Apple to limit the availability of Pornography on the iPhone/iPad is bigger than that limited scope. The App Store is the sole mechanism to get Apps to the general public (whereas the Android Market is simply the best way to target those users, other distribution channels are possible), and Apple’s policies are vague, and allow them to selectively approve and deny anything they want, on seemingly arbitrary criteria.

Apple wants to be the stewards of experience and information. And their bulwark in this is pornography. However, their ‘freedom from porn’, and their refusal to provide a non-Apple controlled distribution mechanisms for Apps, along with the unknowable rules they choose to enforce on their own store, makes Jobs’ offer of freedom, nothing short of platform tyranny.

  • StumbleUpon Toolbar Stumble It!

On Ogg, Vorbis, and Theora

No Comments No TrackBacks

A few weeks back, I read an interesting take on the Ogg format, which basically claimed it was a terrible format for streaming video and audio streams. Personally, I know very little about the problems that they’re trying to solve here. However, I’ve been using Ogg (and specifically, Vorbis), for years, but it had never really gained much traction (outside of the Free Software community, and a lot of games). The lack of traction suggested that maybe, just maybe there was a legitimate technical reason behind this lack of adoption.

Fortunately, the creator of the Ogg format took umbrage to the analysis above (probably in part because it was Slashdotted), and decided to offer a point-by-point rebuttal. It comes down to the fact that, as far as Monty is concerned, Ogg works very similarly to other container formats, even ones that the original author held up as gold standards, like Matroska. Clearly, if there are any weaknesses, it’s not likely with Ogg.

And yet, the standard for audio interchange and online music quickly became MP3, a format well known to be patent and license encumbered, instead of the (to the best of anyone’s knowledge) un-encumbered Vorbis. Why? The two formats are really similar in performance characteristics (sound quality vs. bitrate). Yet, MP3 is by far the standard. Hell, the Ubuntu One Music Store, or rather the store that backs the U1 Music Store doesn’t even offer Vorbis as an option.

I think the most likely cause of this was simply that MP3 was the format that everyone learned about digital music through, specifically due to Napster, since Napster only worked with MP3, and Napster was big almost two full years before Vorbis’ first release. Plus, the first runs of portable audio players only supported MP3 as well. Between these two factors, how could Vorbis possibly have taken off? Note: I don’t count M4A/AAC. It’s still, to this day, only used on the iPod and with iTunes. Yes, it’s big, but that’s a factor of the iPod’s success, which is an completely non-technical issue. Before M4A, MP3 was (and is) king. The other problem Vorbis faced, was simply that Tremor, it’s fixed-point version suitable for embedded use, wasn’t available until 2002, almost a full year after the iPod had begun to dominate the market, and to date, no iPod has included a Vorbis decoder.

By 2002, when Vorbis had all the pieces necessary to be a real contender (a better sounding release, and fixed-point version), MP3 was so deeply entrenched that it didn’t have a chance to unseat the king. Plus, the MP3 patent holders have, to date, sworn not to enforce their patents on open-source projects, and they charge their fees to the hardware/software producers, so to most people, the encumberedness of the format is apparently a non-issue.

Then, came Theora, a video format based on the VP3 video codec. It’s been in process since 2004, and frankly been mostly usable since that time, even though it wasn’t considered final until 2008. This means that the extensions to VP3 that became Theora didn’t even begin until the current King of video interchange, H.264, was completed in 2003.

And why is H.264 King? Well, most people encode in H.264 because the standard mechanisms to distribute video via the Web, Flash. And now, Safari, Chrome, and IE9 are all committed to using H.264 for video. Firefox, trying to make a stand, only support Theora at this time (to be fair, so does Chrome).

The corporation that owns most of the patents around H.264, MPEG LA, has promised not to charge royalties on use of the format for freely distributed content until 2016. What will happen then? Well, we’ll see in 2015 (when they’re likely to make a new announcement). But either it will remain free, or a lot of people will be frantically re-encoding to try to avoid going into violation.

Plus, while using the format may be free (in certain circumstances), creating software or hardware to encode or decode the codec is absolutely not free. So, anytime you have something that uses this hardware, you’re paying that cost somewhere. With Flash, at least, that cost is being paid by the people buying the developers tools from Adobe (not to mention buying the encoders). Google, Apple, and Microsoft are all paying licensing fees to distribute H.264 decoding code with their browsers. Mozilla and Firefox know that they can’t do that without limiting the ability of re-distributors (like Ubuntu) to distribute Firefox, which is unacceptable to them.

However, the current great hope to deal with the encumbrance issues with H.264 isn’t to look at Theora, but hoping that Google may open source the VP8 codec they bought with On2, later this year. While that would be an awesome development, the question still remains: Is VP8 really any better than Theora?

From a technical standpoint, I have no idea. But I don’t think it has anything to do with Technical issues. A person contacted Steve Jobs to ask about Theora on the iPad, due to Jobs’ comments about Flash’s lack of openness, when Flash uses H.264 like Safari does for video. His response was simple:

All video codecs are covered by patents. A patent pool is being assembled to go after Theora and other “open source” codecs now. Unfortunately, just because something is open source, it doesn’t mean or guarantee that it doesn’t infringe on others patents. An open standard is different from being royalty free or open source.

This is clearly a case of ‘better the devil you know, than the devil you don’t’. No one’s willing to trust Theora because they don’t know for certain that it’s covered under any patents. Meanwhile, H.264 is known to be encumbered, even though it could (as likely as Theora, at least) be covered by patents we don’t know about yet.

Plus, apparently people have been blowing smoke about a patent threat against Theora for years. So far, Xiph’s lawyers don’t see any credible threats on the horizon.

Personally, I’m with Monty. For one thing, Theora is an extension of VP3, which is older than H.264. If someone was going to make a patent claim on Theora, they need to do it before they lose their ability to enforce any such claim. Plus, MPEG LA doesn’t want anyone to develop competing codecs, so keeping up this fiction that you’d be hard pressed (they won’t say “can’t”) to create a Video codec that doesn’t violate their patents greatly helps their bottom line. Unfortunately, they had a lot of money, which gives them unfortunately advantage in the legal system.

Ogg, and it’s children Vorbis and Theora, have been the unfortunate victims of one of the most effective FUD campaigns, I’ve ever seen. And it’s been largely successful, in large part because the Hardware support has been lagging behind. Until we start seeing Vorbis and Theora in more hardware (and Android is definitely helping with Vorbis), it’s going to be difficult to gain any traction. And I tend to agree with those who feel that we can’t build Open Standards on closed platforms, despite what Steve Jobs might feel.

  • StumbleUpon Toolbar Stumble It!

iPhone OS 4.0 Announcement

No Comments No TrackBacks

Yesterday, Apple held a press conference announcing some new features for the iPhone OS which will launch this summer. By and large, I watched the live blogs and kept thinking that I’d had that in Android for longer, or that it’s done better on that platform in many ways.

Multitasking is great to have, but the demos made it appear to be more or less a direct clone of Android Activity Lifecycle with the pause and resume functionality. And support for services seems to be limited, though it’s unclear how at this time. I did really like that the lock screen could have widgets associated with it, like in the Pandora demo, however. That was a really nice feature.

However, a lot of what they announced were obvious features that they should have had a long time ago. Folders and Customizable Backgrounds being the big two there. There are, no doubt, some nice features here, but there were only two things that stand to be really interesting. Namely, the new Social Gaming Network they’re building, as well as iAd.

The Social Gaming Network makes sense, a lot of people feel the iPhone is a great gaming platform, and Apple boasted that the iPhone has about 10 times as many games as the Nintendo DS. Of course, they’re very different kinds of games, many of them aren’t very good (though there are apparently some gems), and it’s highly unlikely that it’s generated anywhere near the amount of revenue, but this was a marketing speech, so whatever. Actually, I’d rather Apple had made a deal to integrate with XBox Live (wouldn’t happen with Windows Phone 7 on the horizon), or the Playstation Network. We have way too many social networks these days.

iAd, on the other hand, is an interesting advertising platform, and they demoed some really interesting demo ads. They were rich, and could do things like drive App sales directly as well as interface with maps and everything else. They were all HTML5, but the look and feel appeared to be very much that of a native app. I disagree with the idea that clicking on the ad took you out of the app you were in, since they appeared to take full control of the display (which is not unreasonable), but the ads were interesting. I’m not convinced they’ll drive more clicks that a solution like AdMob, but we’ll see.

Plus, you’re not required to use either of these services. If you’d rather use a third-party advertiser, you can. I suspect most people will just use iAd, but at least the choice is still there.

The biggest problem with the new platform, wasn’t mentioned at the presentation, which isn’t a surprise. Luckily, John Gruber was willing to publish about it. Namely, the iPhone Developer Agreement now mandates what language you develop in. And it does it in a way that, not only neuters Flash CS5, but also MonoTouch and Unity3D, both of which are in use in major iPhone applications today.

Apple’s restriction on only using Published, non-Private APIs was understandable. I disagreed with it, but I understood it. However, mandating the language used to create an otherwise compliant piece of code is ridiculous. So far, I only seen one such product express concern over their own future on the iPhone platform. Most are, understandably, remaining quiet until such time as Apple clarifies.

My suspicion is that Apple will lift this restriction within the next few weeks, however the very fact that they attempted this should cause concern among developers for this platform. The lack of transparency and Apple’s history of removing programs from the App Store after the fact are bad enough, but not Apple is showing that they’re willing to dictate tools, even if you comply to all other parts of their requirements, even when it would have no impact on users, and I can’t see any impact it would have on the ecosystem, allowing people to use these alternate tools.

Then, there was Steve’s response when asked about ‘unsigned applications’, which was really code for ‘applications not from the iTunes App Store.’

Q: Are there any plans for you to run unsigned applications, like on Android? A: There is a porn store for Android to go to. You can download them, your kids can download them. That’s a place we don’t want to go. We’re not going to go there.

First off, why in the hell did he have to jump straight to pornography? That’s a bullshit argument, and I really hope everyone in the room at the time took it as such. Second, this is honestly part of what I like about Android. There is room for apps of all kinds, even if Google restricts them from their own Market. This single-store mentality pervasive in the iWhatever ecosystem right now is unhealthy, and it mandates some third-parties idea of what is appropriate on a piece of hardware that you’ve purchased, even when it has zero effect on them.

The Android Market is the easiest way to get applications on an Android phone, and you do need to specially allow non-Market apps, but at least the opportunity is still there. The real answer is that Apple doesn’t want to provide a side-channel for apps, and they’re using a bullshit argument about Porn to justify that position.

There were a few things in this announcement that were interesting. The expansion to the Mail app; merged inbox and thread view, are really nice and I’d like to see them on other smartphones. However, there was nothing announced that made the iPhone any more compelling to me than what’s going on in Android today (even if I’m still stuck on Android 1.6 on my own device). In many ways, I still think the device is less capable than other smartphone platforms. However, it was by and large a good step forward technically, though the arrogance of the policy shift should be enough to make developers think twice about hitching their wagon to a platform run by a company who makes such insane demands.

  • StumbleUpon Toolbar Stumble It!

Integrating StyleCop into Hudson Build

5 Comments No TrackBacks

After Craig Berntson’s presentation at Boise Code Camp this year on expanding Continuous Integration usage, I decided to take the plunge and implement StyleCop on most of our projects on the CI server.

The problem with StyleCop is that it’s default set of rules are pulled directly from Microsoft’s Design Guidelines for Developing Class Libraries. While many of these guidelines lead to excellent code, they don’t all make sense for every developer. For instance, in our shop, we pefer an indenting style based on the K&R Rules, but StyleCop uses rules more akin to the Allman style. For now, we’ve had to disable several of the styling rules, but I haven’t been able to find (or write) custom rules to fill that need.

That said, it did take me a couple of days of pretty solid work clearing out StyleCop violations before I was comfortable putting it into our rules. Save for disabling all the documentation header rules (we’re likely to apply them, but it will be on a project-by-project basis), I only ended up disabling another fourteen rules in our global stylecop file. Incidentally, one of my favorite default StyleCop features is that it will work it’s way up your directory structure looking for Settings.StyleCop files, which it can parse out for configuration. To facilitate this, I put a StyleCop configuration file at the root of our Perforce depot, which constitutes our global configuration, which still allows us per project configuration if we need to customize anything.

After a few days of work, I had our code down to about 1300 stylecop errors, which was actually a pretty huge code change. The goal, with any code analysis tools, is that they’ll make our programs more maintainable, which is important to me, because I don’t plan to retire from my current employer, and I want to ensure that the codebase I hand off is as healthy as it can be.

Hudson already has a plugin for parsing StyleCop output, among other tools, so it was trivial to configure the addition to our build server. Plus, StyleCop offers an MSBuild task, which is also really convenient. The following code in our core MSBuild file was all it took:

  <UsingTask AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.dll"
        TaskName="StyleCopTask" />

    <Target Name="StyleCop">
        <CreateItem Include="..\**\*.cs">
            <Output TaskParameter="Include" ItemName="StyleCopFiles" />
        </CreateItem>
        <StyleCopTask
            ProjectFullPath="$(MSBuildProjectFile)"
            SourceFiles="@(StyleCopFiles)"
            ForceFullAnalysis="true"
            TreatErrorsAsWarnings="true"
            OutputFile=".\stylecop_results.xml" />
    

StyleCop only works on C-Sharp code, but that’s fine for us. VB.Net programmers are currently SOL, but if Microsoft really believe that VB is a first class citizen in the .NET world, I expect we’ll see StyleCop for VB someday. The only other thing to do was make the StyleCop Target a dependency of my full build project, and now StyleCop runs on every build in hudson automatically, and I configured the Violations plugin for each of our projects in Hudson to open ‘**/stylecop_results.xml’, as the StyleCop path and now we’ll have a chart (which will hopefully start trending downward) on our Hudson dashboard telling us how healthy our projects are from a StyleCop perspective. Right now…some are healthier than others.

On a side note, we do have a few open source projects, like the Silverlight Toolkit, which are part of our build process. Since we didn’t write this code, but we still build and link against it, we really didn’t want it to taint our StyleCop score. Excluding a project is as simple as dropping a Settings.StyleCop file in the root of the project that excludes all stylecop rules. Unfortunately, I think you have to name every rule individually, but I am on the lookout for a ‘Exclude this subfolder’ flag for StyleCop.

  • StumbleUpon Toolbar Stumble It!

Great eBook Deals

No Comments No TrackBacks

One of the things we’ve talked about recently in a local group where we meet to discuss developer-related issues on campus (frankly, one of the only professional developer groups in the area), is the issue of continued learning. And of the things that came out of the discussion was that of buying books. The problems with many technical books is that they are very expensive, and oftentimes out of date by the time they’re published. Technology just moves too quickly.

For me, that’s part of what I like about eBooks. They can be cheaper, updated over time (though major revisions still warrant new editions), and time to market can be a lot faster. Like Manning and their Early Access Program, where you can buy an unpublished book, and recieve updates as they arrive at Manning, only to get the final copy of the book once it’s completed. Plus, with Manning, and this is the only tech publisher I know who does this, if you buy the book, you get the eBook for free. Amazing. The only downside to shopping Manning, is that their download system is archaic. Your download links are only good for a short period of time, so when a new version is released, you need to grab it quickly. Or go through the Customer Service desk, which takes time and is hassle enough you put it off until you flat forget. Not that the Manning people make it difficult, but more effort generally means a lower likelyhood of it getting done. Plus, Manning has been doing a lot of deals lately.

Enter O’Reilly, who are absolutely the elephant in the room when it comes to technology books. O’Reilly doesn’t throw in eBooks with their paper books, but they do have the #EBook Deal of the Day program, where every day they offer a different eBook for $9.99, which has sometimes been as much as $30.00 off the list price. I’m fairly sure Tim O’Reilly has done this in an effort to bankrupt me, because the deal is usually way too enticing. What I love most about buying through O’Reilly, is their management interface is great. I can view a list of all the books I’ve bought, see which once have updates, and most of their books offer ePub in addition to the PDF version.

I love books, but I’m really wanting eBooks badly now. I have two bookshelves full of books, and still more in boxes. I’m overrun, and I keep wanting to read. Now, if I can just find an eBook reader with solid annotation and ePub support (I wasn’t impressed with the Nook’s annotation, in the brief time I spent playing with one), I’m golden.

  • StumbleUpon Toolbar Stumble It!

Blocking "Domain Smacks" in Apache

No Comments No TrackBacks

Recently, some intrepid person decided to buy uwrejects.com and have it show Washington State University’s website. Frankly, I thought it was pretty amusing, but there were a fair number of concern by certain executives at the institution. However, it did seem to remind me of the concept, of the “Domain Smack”

Alright, sorry for the ad (I’m not even getting paid for that), but it explains what the hell a domain smack is.

So, what do you do when some jokester decides to domain smack you, and you (or your boss) is really concerned with it? Just a few rules with modrewrite, and you’ll be fine, on Apache at least. IIS and other servers can do this as well, and IIS can even import Apache modrewrite rules easily.

RewriteEngine on
RewriteCond %{HTTP_REFERER} smackingdomain.com
RewriteRule .+ [F] # Return 403 Forbidden
RewriteRule .+ http://jokestersite.com/ [R] # Redirect back on the joker.

The syntax is fairly straightforward. Turn the RewriteEngine on (if you haven’t used it yet in the .htaccess file), check the Referer header (which is misspelled in the specification) for the smackingdomain, then rewrite ANY URL (the .+) to either return forbidden or redirect back at whomever has decided to make fun of you.

At the end of the day, WSU is seriously considering doing nothing. Which is good, because it’s better to have a sense of humour about such things. However, good mastery of conditional URL Rewriting rules are good to have, and I’ll probably do some more advanced stuff with it later, since the documentation lacks a lot of examples which could be really nice to play with.

  • StumbleUpon Toolbar Stumble It!

Hacking MSTest out of Visual Studio

No Comments No TrackBacks

For a while, we’ve been using Hudson as our Continuous Integration server for a while now, but we had a problem where the unit tests we had written were all in MSTest. However, MSTest doesn’t like to be installed without all of Visual Studio. Luckily, Mark Kharitonov at Shunra has figured it out and written up a post about it. I’ll only note two things I had to do to make his solution work:

  1. I had to add the VS2008Stub\Common7\IDE folder to the global PATH so that mstest.exe could be found (and restart Hudson so Hudson would update it’s PATH)
  2. Hack MSTest to allow me to use the /testmetadata and /testlist options.

I had to do #2, because the MSTest plugin for hudson seems to only want a single TRX file, which would have required me writing a bunch of MSBuild stuff I didn’t feel up to writing so that MSTest would run once for the entire build, instead of once per Test DLL file. By using the /testmetadata option, I can set up a vsmdi file and tell it which tests to run, which also provides me the added benefit of disabling certain tests that I might not want to run for some reason or another. In my case, I had a few tests that went against the database that really need to be rebuilt using a Mocking framework. They can’t run on the CI server (the CI server doesn’t have access to the Database), but they have some mild use currently on my local machine, so I don’t want to simply exclude them.

Anyway, MSTest, it turns out, actually checks your Visual Studio license to determine how it should function. Basically, it offers a few more options if you have a Visual Studio license, and a few more options if you have a Team System license. We don’t have Team System (or we’d probably be using Team Build anyway), but we do have Visual Studio licenses. Of course, they don’t tell you that the binary does different things based on a registry key, that’s what my good friend .NET Reflector is for.

Due to the fact that Reflector actually displays disassembled code, code I didn’t write, and I sure don’t have permission to redistribute, I’m going to gloss over what exactly I did to figure out what to do in the next paragraph. I’ll likely put together a new post in the future about hacking .NET using Reflector, but it will be on non-encumbered code.

It turns out there are five special codes that MSTest looks for to enable or disable features, namely the Test List Editor (what I was interested in), Team Developer Tools, TFS Integration, Remote Execution, and Authoring Non Core Tests. I’m not entirely sure what those last four are (though I plan to investigate), since as I said, I only really need the first one. Interestingly enough, the way they’ve implemented this security, it’s a pretty simple hack to enable the ones that you aren’t licensed to use. Which wouldn’t be the right thing to do, which is why I’m not providing those codes, or even the actual location of the codes you shouldn’t have, to you, my reader. I’m covering my own ass.

Open up Regedit on your development box, and point it to HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\Licenses, and you’ll see a list of keys (probably only one, but it could be more than one). Export the keys you see under this hive, and then import them into your CI server, and it should automagically unlock the features you were missing on CI, check the /help output to be sure. Note: On a 64-bit system, the Hive is HKLM\Software\Wow6432Node\Microsoft\VisualStudio\9.0\Licenses. Just make sure you export and import to and from the correct location, if there is a difference in bit-width between your two boxes.

Now, you should have all the MSTest features you had on your development box on your CI box, and you didn’t have to do a full install of Visual Studio in CI.

  • StumbleUpon Toolbar Stumble It!

Copying Files out of the Windows GAC

No Comments No TrackBacks

Sometimes you need to get a file out of the GAC on Windows, either to look at in something like .NET Reflector, or maybe to copy a DLL (licensed, of course) to a server when you don’t need (or want) all the other cruft that the installer might drop on the box. I’m not going to judge.

GAC View in Windows Explorer

The GAC can be viewed on a Windows box by heading pointing Explorer to %windir%\assembly, but Explorer abstracts that folder away so that you can only do limited things with items in the GAC. They’ve even gone so far as to make it impossible using any of the GUI filesystem tools in Windows to navigate into the subfolder hierarchy. So, when faced with a GUI that just won’t cooperate, I turn to my trusty friend, the command line.

GAC Directory Structure from Command Prompt

Now, I can see the structure of the files that I’m looking for, and if I look back at the Explorer view, it even provides me clues on where to look. For instance, the fifth column, Processor Architecture, tells me which GAC_ folder I need to look in. For me, I’m almost always interested in GACMSIL. Once in that folder, there is a new folder for each unique entry in the Assembly Name column for the given Architecture, followed by a group of folders following the naming scheme {Version}_{PublicKeyToken} (that’s two underscores between Version and Public Key Token). Inside of this last folder, is my DLL, which I can copy out to another location.

For instance, System.Core, the core DLL for .NET that everyone has anyway, can be found at: %windir%\assembly\GACMSIL\System.Core\3.5.0.0_b77a5c561934e089\System.Core.dll

GAC Directory Drilldown from Command Prompt

Now that you know how to find the files, it’s trivial to copy them to wherever you need to, for whatever you’re looking to do. Of course, if you use this to break a license or anything else shitty, it’s not my fault.

  • StumbleUpon Toolbar Stumble It!

BackTrack4 SD Card with Asus Eee PC

No Comments No TrackBacks

I’ve been watching Hak5 since it hit Revision3 last year, and I’ve generally enjoyed the show. Recently, host Darren Kitchen talked about creating a persistent Backtrack boot-able flash device. Since I’d be using this with my EeePC (or another laptop), I decided that the idea of running an OS off a thumb drive for any period of time was scary, so I decided to go the SD Card route.

Unfortunately, Revision 3 doesn’t provide good show notes for how this was done, Hak5.org is down, and Backtrack’s own page on a persistent USB drive is completely empty. The provided content is taken almost verbatim from Darren’s presentation on the linked video above, and I’ll embed the video after the instructions. I just felt that a write-up would be convenient.

  1. Download the Backtrack4 ISO
  2. Set up bootable media with Backtrack, either burn a CD, or a thumb drive using unetbootin
  3. Boot BT4, put your SD Card in your computer and find out what device it mounted as. Enter dmesg | grep hd.\|sd. at the command prompt, the bottom entries will likely be the correct ones. On my system, it was /dev/sdc so that’s what I use.
  4. Run parted /dev/sdc (I vary from Darren on this)
  5. Type print at the command prompt, odds are you’ll have 1 partition. Delete all the numbered partitions with the rm command.
  6. Create the first filesystem with mkpartfs primary fat32 0 2.5GB This will create a two and a half gigabyte, fat32 partition as your main data store.
  7. Make Partition 1 bootable with set 1 boot on
  8. Create Partition 2 with mkpart primary ext3 2.5GB 100%. This will fill the rest of the device with a empty partition. I used an 8GB drive, but the 100% will fill the rest of the drive.
  9. Exit parted with quit
  10. Run mkfs.ext3 -b 4096 -L casper-rw /dev/sdc to create the persistent area on the storage.
  11. Run mkdir /mnt/sdc1
  12. Run mount /dev/sdc1 /mnt/sdc1 to mount the first partition you created.
  13. Run rsync -r /media/cdrom0/ /mnt/sdc1 to copy all the files from the boot media to the boot partition. This will take some time.
  14. Rum grub-install --no-floppy --root-directory=/dev/sdc1 /dev/sdc to install grub on your sd card.
  15. Edit /mnt/sdc1/boot/grub/menu.lst in your favorite editor
  16. Change the line ‘default 0’ to ‘default 4’ to load in persistent mode by default.
  17. To the end of the kernel line for the Persistent Live CD option, add ‘vga=0x317’
  18. Shutdown and reboot.

EeePC Notes:

  1. My EeePC is an original 8G, meaning that it’s running a Celeron M, not an Atom, and it has the smaller (6”) screen.
  2. To select your boot device from the Eee PC Menu, hit the ESC key when the system starts to boot (these things boot fast, so hit it quick) and choose the ‘USB2.0CardReader’ option to boot from SD. If you’re booting from a thumbdrive and your thumbdrive has a U3 partition, odds are you’ll want the first one on the list. If it refuses to boot it, reboot and try the other.
  3. The system is currently booting into a text console for me, not the GUI. If I want the GUI, I can just type ‘startx’ and it comes right up. I’m trying to solve this issue, and when I do, I’ll update this post.
  • StumbleUpon Toolbar Stumble It!