mRemoteNG – a friendly alternative to PuTTY

I came across mRemoteNG (a free SSH client) a couple of weeks ago, and I personally like it much more than PuTTY/KiTTY for SSH.

Mostly I prefer the UX of configuration a connection far more than PuTTY.  You can also store your username/password with encryption in the app.


There are a few other niceties, such as multiple tabs for a connection, and IDE-esque window arrangement.



It also supports multiple protocols, in addition to SSH.

Leave a comment

Posted by on December 17, 2014 in UNIX


Tags: , , , , ,

Getting started in UNIX

Developing via command line is a love-hate thing for us as developers. And a bit of a holy war. And it contains other holy wars inside, such as vi vs. emacs. But I digress. Regardless of your reason to develop via command line, UNIX is likely where we’ll do it.

A few definitions

  • Shell: Your command prompt. A shell is technically a command language interpreter.
  • BASH (or bash): One of the most common shells in UNIX.
  • ~:  Your home directory.
  • vi and emacs:  Two of the most common text editors. You’ll also hear vim, which is effectively a superset of the vi editor.
  • ~/.bashrc: Text file that stores user-specific settings for the bash shell. Stored in your home directory.
  • ~/.vimrc: Text file that stores user-specific settings for, you guess it, vi and vim. Stored in your home directory.
  • SSH Client: Application that allows you to log onto a remote machine and execute commands (and a lot of other stuff that’s not important right now). Runs the protocol SSH (“Secure Shell”).
  • PuTTY: One of the most common SSH clients.(
  • mRemoteNg: Another SSH client that I personally like far more than PuTTY. (

Let’s start with the most common UNIX commands

UNIX is all about learning the commands; and there are a lot of them. Try not to get overwhelmed or worry about understanding every command you see. Pull up your UNIX shell and let’s get rolling on a few.

  • pwd:  “Print Working Directory”. What folder are you in?
  • cd: “Change Directory”.  cd MyFolder
  • cd ..:   Move up one folder. Use “..” as another name for “the parent folder”.
  • mkdir: “Make Directory”.  mkdir SomeNewFolder
  • rm: “Remove”. Delete a file or directory.
  • cp: “Copy”. cp sourceFile targetFile
Leave a comment

Posted by on December 15, 2014 in UNIX


Tags: ,

Getting Started in Vi

Whoa?! I started typing and then my cursor jumped all over the place.

When I first opened something in vi, I just started typing. And that was frustrating. I couldn’t figure out how to move the cursor, start typing, stop typing, or just quit the darn thing.

This is very common with UNIX text editors, especially those of us who grew up in Windows. Save is not Ctrl+S. There is no mouse, and navigating just doesn’t quite work like we think it should.

Ahh, now I get it

Vi has two modes:

  • Command Mode: Default mode when you open vi. Allows you to run commands with simple keystrokes. Pressing “dd” will delete/cut a line. This seems weird but bear with me.
  • Insert Mode: What we’re used to. Type as normal. Pressing “dd” will actually type two d’s.

To switch between modes:

  • In Command Mode, press i to switch to Insert Mode.
  • In Insert Mode, press ESC to switch to Command Mode.

Start with these commands

  • :w – “Write”, aka save.
  • :q – “Quit”, aka exit vi.
  • :wq – Save and quit.
  • :q! – Quit without saving.
  • i – “Insert”. Switch to insert mode.
  • a – “Append”. Switch to insert mode and append/move the cursor to the end of the current line.
Leave a comment

Posted by on December 15, 2014 in UNIX, Vi


Tags: ,

Tricks with Vi

Notice how some things in vi are just…meh. I want my tabs to take up 4 spaces instead of 37. I want syntax highlighting for LESS or TypeScript. There is a better way, right?

You can customize vi by creating a .vimrc file in your home directory.  vi ~/.vimrc

Tab Settings

Quick primer: A “hard tab” is inserting the TAB character (i.e., \t). A “soft tab” is inserting spaces in lieu of a TAB character. I personally prefer soft tabs, but don’t care enough to join the holy war.

Here’s a good article on tabs, spaces, and indents.

  • tabstop: Size (in spaces) of a hard tab. Still only inserts a single TAB character.
  • softtabstop: Number of spaces inserted when the TAB key is pressed.
  • expandtab: Set this option to always use soft tabs.
  • shiftwidth: Size (in spaces) of an indent.

So if you want your tabs to be 4 spaces, and to always be soft tabs:

set tabstop=4
set softtabsstop=4
set shiftwidth=4
set expandtab

Syntax Highlighting

If you open a TypeScript file in Vi, you won’t get the nice JavaScript syntax highlighting.  Want to configure this? Use BufReadPost.

au BufReadPost *.ts set syntax=js
au BufReadPostd *.less set syntax=css

I don’t like having to hit ESC to switch to Command Mode

Well, good sir or madam, you are in luck!  You can also use Ctrl+C.  (Better or worse depending on your keyboard. I find this fantastic for keyboards where you can set a thumb button to Ctrl.)

Multiple Files in Split Windows

Use the “Split” command, :sp filename, to open a new file in a split window (horizontally).  Use the command Ctrl+wv to split the windows vertically.

vi file1
:sp file2 (opens and splits horizontally)
ctrl+wv (splits vertically)

Or, when you are opening vi, use the -o switch to open multiple files.  -o to split horizontally, -O to split vertically.

vi -o file1 file2   // split horizontally
vi -O file1 file2   // split vertically

Leave a comment

Posted by on December 15, 2014 in UNIX, Vi


Tags: ,

Creating Your Own NuGet Package, Part 1

Hello, NuGet

I find NuGet to be pretty awesome. Even though it’s several years old, it still has that new car smell to me.  We recently started using the NuGet Package Restore feature, which has helped improve our CI builds.  But like leather bucketseats, the feature I’ve wanted to have for a few years is to create my own NuGet package.

Why Create Your Own NuGet Package

When is this useful?  Do you have a library of utility functions that you want to share with others, or maybe one that you have used in multiple projects?  We have a library of utility functions that most of our other projects use.  Every time we make a change to this library, we have to manually copy the new DLL across all projects. Yuck. Manual process.

NuGet to the rescue!  We can slap this library into a NuGet package, and then fork the new version easily through NuGet.

The Pieces

You will need three small pieces in order to create your first NuGet package:

  1. The NuGet.exe command line utility.
  2. The files you want to package (i.e. a class library).
  3. A specification (.nuspec) file.  We’ll get to that in a minute.

Let’s Get Started

Starting with a simple example, let’s create a new Visual Studio solution.

  1. Create a new C# Class Library (File –> New Project –> Visual C# –> Class Library) called MyMathLibrary.
  2. In order to watch NuGet work it’s magic, let’s go ahead and create a class in here called MyMath, and give it a single static method, Sum.
  3. Build the solution.  (you can use the default Debug solution configuration).
  4. We’re going to keep it simple and do all of our NuGet stuff in a separate folder.  Create C:\Local-NuGet-Feed.
  5. Create a folder in here called output (we’ll get to this later).
  6. Add the NuGet.exe command line utility to the C:\Local-NuGet-Feed folder.
  7. Open the folder where the project you just created lives. Navigate to the output folder, bin/Debug, and grab the .dll file (MyMathLibrary.dll).  Copy (or move) this file into C:\Local-NuGet-Feed folder.
  8. Create a blank file, and name it MyMathLibrary.nuspec.

The Specification File (.nuspec)

Let’s fill in our .nuspec file with some XML (thanks to Rick Shott for the original example):

<?xml version="1.0"?>
<package xmlns="">
    <metadata >
    <description>A library of global-use math functions.</description>
        <file src="MyMathLibray.dll" target="lib" />

Most of the metadata is self-explanatory (id, authors, description).

  1. The target attribute specified in the <file> tag is the folder where the file lives (either a relative or absolute path).
  2. You can use wildcards for the filename in the src attribute of the <file> tag. For example, if you specified My*.dll, the package would include all .dll files that start with My.
  3. There is one thing worth mentioning about the <version> tag.  THIS value is what dictates when consumers see a new version of the package in NuGet.  In other words, you can change the content of your files in the package, you can change the version number in the assemblies, but consumers will not see a new version until you change this value.

Creating the Package

Alrighty.  Now we’ve got our .nuspec file, let’s create a package.  For this, we’re going to use the NuGet.exe command line utility.  Run the pack command like this:

nuget pack MyMathLibrary.nuspec -basepath lib\ -o output\

Bingo! You should now have a single .nupkg file in your output folder.  You will also notice that NuGet generates the name of the .nupkg file by concatenating the values that you specify in the <id> and <version> tags in the .nuspec file.

Consuming the Package

After all, what good is our new call if we can’t smell the tires (am I the only one who likes the smell of new tires?)  Ok, I digress.

All that we need to do to see our internal packages in NuGet Package Manager is add a new package source.  It’s really that simple.

(In Visual Studio 2012, this is under Tools –> Options –> Library Package Manager –> Package Manager Settings).  If you want to try out a cool new trick, just press Ctrl + Q in Visual Studio and type “package manager settings“; then Enter. Neato!

Choose “Package Sources”.  Click the “+”, and give it an arbitrary name (i.e. Local Package Feed), and enter your local path to the .nupkg output files as the source, C:\Local-NuGet-Feed\output.

Now, open up Nuget Package Manager (or Ctrl+Q, nuget package manger”, if you like).  You will see your new package source listed in Online (right under  Sweet.

Updating the Package

Let’s watch NuGet do it’s magic, shall we? Create a new project in Visual Studio (this time a Console Application), and call it NuGetTester.  Use NuGet Package Manager (Ctrl+Q coming in handy yet?), and add the MyMathLibrary package.

Expand References, and then double-click on MyMathLibrary to open the library reference in the Object Browser.  You can see that there is one class, Math, with one static method, Sum.

Return to MyMathLibrary, and now let’s add a second method, Product.  Build the project and copy the .dll into our NuGet feed folder.  REMEMBER that we need to change the version in the .nuspec file.  Open MyMathLibrary.nuspec increment the version number to  Run the pack command again.

Return to NuGetTester, and open NuGet Package Manager.  If we look at our Local Feed, we see that we can now install the update to MyMathLibrary, and we also see that it’s on version  If you examine the reference again in Object Browser, you see our new Product method in MyMath class.  Score.

Hosting the Package Feed

A locally-hosted feed may not be terribly useful, so I’m sure most of you want to host your internal packages on a server.  As long as the folder contains the .nupkg files, that folder can live wherever you want it to.

The simplest solution that I would recommend is to create a share folder on a server (i.e. a build server is a great idea).  This is a great way to get up and running quickly.

Another neat little trick is to try running post-build commands to automatically move your .dll files automatically to the NuGet feed folder, then automatically kick off a nuget pack command.  Now throw this on a build server, trigger it after your CI builds, and it’s even cooler.

Leave a comment

Posted by on January 3, 2014 in C#, NuGet, Visual Studio Tricks


Tags: , , ,

Creating Your Own NuGet Package, Part 2

Automagically Using NuGet with a Project

Want to automate things even more?

For this example, find a Class Library project that you like.  Open a command prompt and navigate to the folder where the .csproj file for that project is.

nuget spec

Bam. Now you have a .nuspec file created automatigically.  You’ll notice some strings that look like some kind of replacement tokens:  $abc$.  We’ll get to these in a minute. They’re pretty awesome.  To make full use of this next step, though, we’ll want to a few quick things first:

  1. Open the .nuspec file that was created.
    1. Change or remove:
      1. <licenseUrl>
      2. <projectUrl>
      3. <iconUrl>
    2. Change <releaseNotes> to whatever you would like (having nothing here is fine too).
    3. Change <tags> to whatever you would like (having nothing here is fine too).
  2. Open your project’s AssemblyInfo.cs file, and enter some values for:
    1. AssemblyTitle
    2. AssemblyDescription
    3. AssemblyVersion

Are you ready for something really cool?  Go back to your command line (in the same folder where .csproj is):

nuget pack

Check out your package in NuGet (using whatever Package Source you use to host it).  All of the metadata from AssemblyInfo.cs is automagically used to replace those $abc$ tokens in the .nuspec file.

Even cooler– NuGet figured out the dependencies of our project and added those as well!

Updated NuGet

Want to make sure you have the latest version of NuGet?  Let’s NuGet… NuGet!  After all, NuGet is pretty awesome at updating packages, why not letting it updating itself?

nuget update -self
Leave a comment

Posted by on January 2, 2014 in C#, NuGet, Visual Studio Tricks


Tags: , , ,

Adding other NuGet Package Sources in Visual Studio

If you use NuGet package sources, you will need to add a new package source to your preferences in Visual Studio.  In VS 2012 and 2013, this is under Tools –> Options –> Library Package Manager –> Package Manager Settings –> Package Sources).  If you want to try out a cool new trick:

Ctrl + Q 
package sources


Now click on “+”, type in a name for your package source. You can use either a UNC share path or, if you have hosted your NuGet packages on a NuGet server, you can enter a URL.

Now go to the NuGet Package Manager (Ctrl + Q, nuget package manager, if you’d like) and you’ll see your new package source listed right under

Leave a comment

Posted by on September 25, 2013 in C#, NuGet, Visual Studio Tricks


Tags: , , ,