Losing my edge?

So I haven’t really been actively involved in the Microsoft/Windows development crowd in years (ever?). I have gone spelunking through the KB and the MSDN site on occasion and come back scarred and generally unhelped. It’s kind of a running gag with some folks in my circle that the difference between Linux and Microsoft forums is that one is a MMORPG with lots of flaming and camping and the other is more of a FPS set in a post-apocalyptic world with you as the sole living survivor.

But because I’m actually interested in using the Microsoft Edge browser and because I am becoming quite attached to my Surface 3, I’ve joined up with the Windows Insider program. I trade my skills as a beta tester and bug writer for early access to Windows 10 and related ecosystem updates. Maybe because Microsoft is actually engaging in proselytizing instead of assimilation or maybe because it’s comprised mostly of devs feeling out the work of other devs, the community forum is a rather enjoyable place to be.

Witness threads like this one. In a Linux distro forum reading a thread that started off with a generic out-loud bellyaching would require flame retardant long johns. But in the Insider community we see a well-positioned Insider (read: guessing a Microsoft employee or contractor) walk someone off a ledge and then engage in a fruitful dialog resulting in a serviceable solution for the OP.

I don’t know that this sort of bonhomie survives the masses–if it ever gets opened to them–but for the time being this is a help forum that is actually quite helpful. I’m also jonesing for updates because they’re near to having the browser plugin framework together…and the WWW without ad blocking is seriously painful.

bash on Windows

My rose for the day [so far].

On Windows you can use the command explorer SomeDirectory and Windows Explorer will open with the view set to SomeDirectory, assuming one exists as a child of the current working directory. The same holds if you want to jump around the tree a bit. explorer \foo opens foo in the root of the current volume and explorer D:\foo would open D:\foo even if you were currently in the C:\ volume.

Which, once I learned about the awesomeness of Console2 [1], I’ve always created an alias mapping ‘exp’ to ‘explorer’. Because, you know, saving five whole keystrokes seems like a major win. Yes, I’m lazy.

I’ve since switched from the default cmd.exe as my Windows CLI to the bash shell that comes for free from Git [2]. All kinds of awesomeness ensue. On shortcoming however is that *nix paths are separated by ‘/’ while DOS paths are separated by ‘\’. Also, the Git bash refers to volumes using the ‘/c/’ notation while DOS uses ‘C:\’ notation. All of which means I still have to remember which frickin’ shell I’m using when on a Windows box. At least if I want to use the CLI to open Windows Explorer to a specific location, which I often do.

I finally sat down and spent a few minutes fixing my bash ‘exp’ alias a bit.

exp() {
# Grab the dir argument and put it in a friendly container
theDir=$1
# Only drop the volume if it exists otherwise /c* is ambiguous
if [[ "$theDir" == /c/* ]]; then
theDir=${theDir#/c}
fi
# Normalize '/' to '\' for Windows
theDir=${theDir//\//\\}
# Call explorer.exe with the swotted argument
/c/Windows/system32/explorer $theDir
}

Now I can use bash to launch Windows Explorer with an arbitrary directory without having to remember to swap out my path separators. It also means I can use tab-complete instead of having to type the entire path when jumping around the filesystem tree.

Yay!

[1] http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx
[2] http://git-scm.com/downloads

Bitchin’

You know what really rocks on Windows? Git’s bash shell [1] wrapped with Console2 [2].

Git [3]: Come for the awesome revision control, stay for the bonus command shell.

I know I’ve nattered on about Console2 before [4] but that was just window dressing. Having an honest-to-goodness bash shell on a windows platform is real nice.

[1] https://openhatch.org/missions/windows-setup/install-git-bash
[2] http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx
[3] http://git-scm.com/
[4] http://www.blackfez.com/?s=console2

Macification

So I’ve stopped using my mac laptop to remote to the work-provided workstation sitting under my desk—mostly because the corporate proxy has become too painful to work around without using a domain-sanctioned machine on the LAN. Having grown into my poweruser self while mostly using *nix/Mac, this leaves a lot to be desired.

Here’s a list of things that make the experience a bit more uniform across platforms:

  • Colibri: a somewhat adequate standin for Quicksilver
  • GVim: the same damn editor on every damn platform. So very good.
  • Cygwin: I haven’t gone much beyond the shell, but that’s the primary reason for grabbing it. Not the most intuitive thing to get running but worth the time. Powershell just doesn’t cut it.
  • Spotify: Not a Mac-specific thing but having the same audio player on all platforms makes me fezzy.
  • Firefox: for all the same reasons as Spotify. Besides, using the integrated sync function my history, bookmarks, and keywords follow me around. Also…I’ve been Firefox since it was Netscape 6 alpha releases. I’ve tried quitting for the new hotness several times but always come back. Must have add ons:
    • AdBlock: Because the WWW is so much nicer without the clutter.
    • FlashBlock: Autoplaying Flash is the second worst thing the WWW has ever sprung on us. Control when you see Flash content!
    • It’s All Text: HTML textbox elements can dump to a gvim buffer where you get all the vimmy goodness and then dump back to the HTML textbox with a simple 😡
    • LastPass: The one password manager to rule them all. Go premium and you get it on your mobile device too.
  • Thunderbird: Same mail client across all platforms is nice. Currently trying to set up a robust set of filters + well trained SpamAssassin to make webmail a useful alternative but until then, nice to have a client to do stuff for me.
  • Console2: My crutch for when Cygwin proves difficult. A wrapper for the native cmd.exe that, with creative use of DOSKEY commands in the launch script can map okay with bash. It isn’t bash though.
  • Virtual Box: The same VM tool across platforms is nice. VMware Fusion is hard to give up though.
  • WinMerge: A decent diff/merge tool. Integrates nicely with TortoiseSVN. TortoiseSVN is one app with no useful analog in the mac universe and this always makes me sad.
  • mRemote: Better than mstsc, not as good as Microsoft’s Remote Desktop Connection for Mac tool + Quicksilver. It serves two functions however: (1) saved connection information for dozens of servers (2) detachable tabs.
  • Python: The world’s best scripting language. Period. YMMV.

All of this to say, I’m certain there are better Windows-specific tools for handling all of the above tasks. They are probably even more functional, hip, and speedy. These are the tools that have made my own transition to a Windows workstation smoother. Not only that, but I’m still keeping my Mac/*nix workstations outside of my job so uniformity in environment is key.

The primary reason for publishing this? I’m getting a new workstation in the next month or so at work and so want to inventory all of the crap I’m going to have to reinstall once the transition happens. The funny thing? The workstation they are replacing is more than adequate for my daily needs in every way except one—it isn’t portable. I sort of wish I could trade them my aging MacBook for the workstation under my desk. It would make a great *nix tower at home! I believe it is also Hackintosh-able.

More cmd.exe help

So you’re in cmd.exe and you type ‘ls‘ expecting to get a directory listing. Instead cmd.exe gives you the finger. You give cmd.exe the finger back. Just then your boss walks by and sees you flipping off company property. Next thing you’re in her office having a discussion on appropriate workplace behavior. Having had enough of ‘The Man’ you flip off your boss.

Now you’re sitting at the bus stop waiting for the bus that will take about 90 minutes to get you home. Just about 7 minutes faster than if you walked. But it’s cold outside. No job, no car, no prospects. Life sucks. And then you learn that you could have been using DOSKEY to set up persistent aliases in cmd.exe.

Just one simple DOSKEY ls=dir later and it doesn’t matter which platform you’re on. Assuming you already set aliases in .bashrc for all of your bad cmd.exe habits that is.

Chin up, young squire! Now when you’re fired from your next job, at least it won’t be on cmd.exe’s account. You can thank me later.