Customized DOS Shell

A fair amount of my time is spent at the command-line, and as such I want it to work in a particular way. Since I don’t want to lose this information the next time I need to set this up, I figured I’d write it down someplace.

image_1

The console window

I hate the console window, it’s hurty and painful. By default you can’t copy/paste easily, and the size of the screen is set to 80 cols. Nobody has a screen anymore like that so I wanted that to change first. You need to make changes to the default preferences for the console window. Open the command prompt and right click on the title bar and choose, “Properties.”

image_2

Command History:

  • Buffer Size: 999
  • Number of Buffers: 5
  • Discard Old Duplicates: True

Edit Options

  • QuickEdit Mode: True
  • Insert Mode: True

image_3

Screen Buffer Size:

  • Width: 2500

Window Size:

  • Width: nnn
  • Height: nnn

Window Position:

  • Left: nnn
  • Top: nnn
  • Let system position window: False

Where nnn is some number that works for you.

Command Prompt

The usual prompt we’re all familiar with C:WindowsSystem32>_ it’s ok, it tells you where you are, but how much fun is that? So I changed it to something that is a little more descriptive. I wanted it to look a little more like a linux prompt, plus give me more command-line space.

jspatton@l1132c-pc01 | 16:05:15.33 | Tue 2/22/2011 | C:Windows

In order to get this prompt all I did was run the following command:

prompt=%username%@%computername% $B $T $B $D $B $P $_

The only problem with this command is that as soon as you exit the shell it goes away. So to make it permanent change the syntax of the command above to the following:

setx prompt "%username%@%computername% $B $T $B $D $B $P $_"

Setx will store that value in the registry which will allow your prompt to persist across multiple shells. Now to make it more fun you need to download a few things, first since I tend to find myself in Linux and Windows on a regular basis I sometimes find myself issuing linux commands in Windows. For a list of all the prompt variables you can use, visit ss64.com. In addition to that you also have access to all the regular environment variables. GnuWin32 has a whole suite of linux commands that you can download and install, but it’s a pain so someone created a project that downloads and installs all the tools for you, GetGnuWin32. I won’t go into details on how to install this, read the page it gives you what you need.

What would be nice right now is ANSI.SYS but that hasn’t been around for ages, so if you want to have nifty colors in your prompt you will need something similar. There may be several utilities that will do this for you, but I found ANSICON, it’s pretty straightforward, download and extract the files onto your computer. Once you’ve done that all that’s left is to load it into the registry with the following command:

ansicon –i

That’s about it, now I have posted up here and you know how to do it too!

Enjoy!

Google Reader feed to Blogengine blogroll.xml

So I wanted the list of blogs I follow in Google Reader to be displayed on my website. Blogengine uses XML files for just about everything, so I decided I would see how difficult it was to convert the Google Reader OPML to a format suitable for Blogengine. The first step is to export your list to an OPML file, once you have that you need to grab this XSLT file that will handle the conversion and finally some sort of utility that will read in the OPML and XSLT and output the appropriate XML.

Getting your feed

Login to Google Reader, and navigate to Manage Subscriptions. You can find that link in the lower left of your reader display. From there you will need you need to click the Import/Export tab, and then just click the “Export your subscriptions as an OPML file” link.

image That file will download to your computer, you’ll want to remember where it goes as you’ll need it shortly. Once you have that file you will need the following XSLT file. I found this code on codeplex where the original is located.





















You should save that as a file with a .XSLT extension, ideally this would live in the same folder as the .OPML file you received from Google. Now you need something that will convert those two files into what you need, blogroll.xml. I found the utility on Microsoft.com, msxml.exe and it did the trick, you will just need the msxml.exe file. I downloaded that to the same place as my OPML and XSLT files.

Now we can create our file, the syntax is pretty straightforward, and actually quite flexible you can literally key in your XML and XSLT from stdin. But this is what my syntax looked like.

msxsl.exe google-reader-subscriptions.xml google-reader-to-blogengin.xslt -o blogroll.xml

The first parameter is your input XML file, the second parameter is the XSLT file that will be used to create your output (-o) file. The resulting blogroll.xml file can be copied into your APP_DATA folder on your Blogengine installation, and you may or may not need to restart the webserver before it shows up. If you don’t have the Blogroll extension displayed you’ll need to login and add that to the site.

Updated Theme

So I’ve spent the past few days working up a new theme for the site. I’ve been wanting something that looked similar to a newspaper, and I think I came pretty close.

I used the NY Times, LA Times, and the Chicago Tribune as inspiration. I’m using some fonts that I found online. The site title font is Wedding Text BT Regular, the post title font is Baker Signet BT Roman and the body of the site is Baskerville Old Face Regular.

I’ve been using Blueprint CSS since I moved off Drupal and have been very happy with it. I wouldn’t say that I’m an expert by any means but I’m getting pretty good at using it and understanding what I’m looking at.

I hope you enjoy it!

Welcome to the new site

I’ve been running on an OpenVZ server from PhotonVPS for quite some time now. That server was running on Ubuntu Server 9.10 (I was wrong Carson), and the site was running on Django. I’ve had no complaints for the most part, Photon has always been very prompt and aside from the few minor annoyances which seemed to plague Carson and Nick more than I, it’s been fun.

Over the past weekend I decided to look for a different hosting provider, and was wanting to change the sites look and feel. Since I am at heart a Windows guy I felt I should move over to a Windows server. I looked at the Photon Hyper-V service, and compared that to the AccuWebHosting Hyper-V service and decided that for the money, AccuWebHosting was where I wanted to be.

The past few days we’ve had some crazy cold weather and so on Monday I moved my site over to the new server. I was able to setup Apache, Python and mod_wsgi and get my new server up and running in about 20 minutes, thanks to an article I wrote a while back. Then I started poking around at an alternative to Django on IIS (which I’ve not got working…yet). I found BlogEngine.NET, and so far I really enjoy it, it feels very Drupal-ish and I don’t think that I’ll stay with it for the long haul, but it works for now.

Over the next few days I’ll make more tweaks and move the rest of my content over.