Archive for November, 2013

Migrate Visual SourceSafe to Git – A short how-to

November 30, 2013 1:35 am

My hobby/learning projects have been residing in a single-person SourceSafe database for a long time (yes, I know you’re laughing; I don’t care – for single-person projects it’s just fine and dandy.) It was time to start using something new. I wanted to migrate everything, including history, to git.

The first step was to install the latest version of git (Git-1.8.4-preview20130916) on the system that currently hosts the SourceSafe database. If you’re long-term-memory-capacity limited like me and can’t remember git command-line arguments to save your life, you’ll also install something like TortoiseGit while you’re at it. One important step is to choose to run git from the Windows Command line during setup. (The next step needs git in the PATH.)

The second step was to install vss2git (http://code.google.com/p/vss2git/). After some trial-and-error with converting my entire database (a mistake, by the way, see step three) and getting error messages about the log file, I changed the permissions of the install folder to allow “read/write” for every user.

The third step was to convert each main project in SourceSafe (well, via a copy of the SourceSafe folder, actually, just to be paranoid) to a git repository by making sure to use $/Path.to.project in the vss2git tool’s Project field.

image

The fourth step was to convert each of these newly created full repositories to “bare” repositories for sharing across my local network. The command line for that is

git clone –bare –no-hardlinks Path.to.project Path.to.project.git

And that’s pretty much it. A fifth, optional step is to remove the original repository folders that served as the source for the bare repositories (so they don’t clutter up the Windows file share).

I am now the proud “owner” of 13 brand-new, independent little git repositories!

[Update 2013-12-01]

Well, I wasn’t too happy with the above solution. It creates too many nested folders (partly because of how Visual Studio creates stuff in VSS in the first place.) Once I clone the resulting repo, I get something like:

CloneRoot/Uncorked.root/Uncorked.root

That’s not what I want. I need it to be CloneRoot/Uncorked.root at most.

This answer on a StackOverflow question provided a good path to take. Based on that answer, I cobbled together a .cmd file to process all my repositories:

@echo off
for /d %%d in (*) do (
  if not exist %%d\config (
    echo %%d
    cd %%d
    attrib -h .git
    move .git %%d/
    cd %%d/
    attrib +h .git
    git init
    git add .
    git commit -am "moved git root"
    cd ..
    git clone --bare --no-hardlinks %%d %%d.git
    move %%d.git ..
    cd ..
    rem pause
  )
)

The impending XP-ocalypse – Take Action!

November 17, 2013 3:19 pm

The November 2013 issue of CVu (link available to accu.org members only, sorry) has an article from Silas Brown (The Windows XP Threat: A Call to Action), calling people to do something about the problem we all will face when Microsoft stops issuing security updates for Windows XP after April 8, 2014.

The article has a little code snippet that will insert a time-left countdown and message on a website, asking people to replace the operating system on their PC with something other than Windows XP (since XP systems are quite old by now, Linux is suggested as the best alternative). I wanted to take action as well, so I looked around for a plugin to WordPress that I could use. I didn’t find one that was custom-written for precisely this purpose, but what came close was the Linux Promotional Plugin, which is aimed at anyone running Windows or Mac, and encourages them to switch to Linux.

I took some time to understand how the plugin code works (at a shallow level of understanding; just enough to be able to make changes), and found that it was pretty easy to make the changes I needed for my purpose. I even found a small bug while I was at it and sent a note about it to the original plugin author.

The plugin is now live on my blog and has the modifications I made. If you’re interested in using it, you can download the modified plugin, and re-use what you want. It might be useful to use a diff tool to see what changes I made. That might help you adapt the plugin to your own needs more quickly.

I used Internet Explorer’s “F12” Developer Tools to test my changes (modifying the user agent string). Here’s what people on Windows XP will now see when they visit this blog:

image

Silas points people to a Microsoft blog post for motivation, and quotes a particularly relevant passage, so I’ll repeat that here as well:

When Microsoft releases a security update…criminals will…identify the specific section of code that contains the vulnerability…develop code that will allow them to exploit it on systems that do not have the security update installed on them.  They also try to identify whether the vulnerability exists in other products…if a vulnerability is addressed in one version of Windows, researchers investigate whether other versions of Windows have the same vulnerability…the Microsoft Security Response Center…[releases] security updates for all affected products simultaneously…But after April 8, 2014, organizations that continue to run Windows XP won’t have this advantage over attackers any longer.  The very first month that Microsoft releases security updates for supported versions of Windows, attackers will reverse engineer those updates, find the vulnerabilities and test Windows XP to see if it shares those vulnerabilities.  If it does, attackers will attempt to develop exploit code that can take advantage of those vulnerabilities on Windows XP.  Since a security update will never become available for Windows XP to address these vulnerabilities, Windows XP will essentially have a “zero day” vulnerability forever.

Do not be the person who ignores this problem! Take action, whether that be replacing XP with Linux, finding someone to help you with that, or just taking the computer off the Internet!