Archive for May, 2008:
Console2 – A worthy cmd window replacement
Anywho, I have experimented with a few prompt replacements and have finally settled with Console2. This is an open source development effort, and is currently at version 2 (beta). I had a little bit of trouble with it and figured it deserved its own post, so here goes.
I downloaded the latest build from SourceForge’s repository (currently at build 120). You want this build because it adds all sorts of goodies over the stable (1.5) version. You don’t need the src zip. Having downloaded it to my default Downloads folder, and unzipped it (yes, there is no installation required) and double clicked Console.exe only to get the following error –
Quick note here – If you are to get an error dialog like this, merely hitting Ctrl-C with the dialog active will copy to the Windows clipboard. Didn’t know that one, did ya?
Anyways, Google returned with a link to dll-files.com and I managed to get the dll file, which I downloaded the Console2 folder (which still remained in my downloads folder). Cool. Think I am done. Double click Console.exe file again to get the following –
Ok. Hopefully I am done. Double click Console.exe and voila! There is the beautiful prompt. Thank you! Its beautiful. Resizable, copy-paste, nice looking fonts and colors, tabs (woohoo!). I have to admit, not a big fan of the transparency, so I changed Edit -> Settings… -> Appearance -> More -> Window transparency to None. Great.
After a few days of using it, I decided I liked it enough to venture into customizing it. As I mentioned earlier, I have a “projects” directory directly under the root, and prefer to have a console open at that location. Went to Edit -> Settings… -> Tabs, added a new tab, named it Projects (creative, don’t you think?) and pointed the open dir option to C:\projects. Hit Ok, and close Console.
Another quick note – Console does not seem to reload changes to its settings on the fly. If you make a change to the settings, you are better off restarting Console (thats been my experience anyways).
Click on File -> New tab -> Projects. Expecting a new tab? Nope. Console just hung on me. I had to go to the ProcessExplorer to kill it. I wonder what went wrong? Honestly, I never figured it out.
I figured I could always live without that. One thing I could not live without was Cygwin. So far, I had been using PuttyCyg as a prompt to Cygwin. I figured I could hook up Console to Cygwin. Again, Edit -> Settings… -> Tabs, added a new tab, named it Cygwin (yeah, I am that good), and this time pointed the “Shell” option to Cygwin.bat. Hit Ok, close Console.
Wash, rinse, repeat. Tried File -> New tab -> Cygwin, and guess what, Console freezes again!
I was reconsidering Console2 at this point. I could continue using PuttyCyg as the Cygwin prompt as I had been doing earlier. But being persistent (Ok, Ok, obstinate) I tried another tactic…
Rather than pointing the “Startup dir” or the “Shell” options to where I felt they would be most appropriate, I decided to hack the Console2 settings file directly. Console2 stores its settings in a console.xml file, which you can edit in any worthy text editor. This is what my xml file looks like (only the relevant portion) –
<tab title="Projects"> <console shell="cmd.exe /k cd c:\projects\" init_dir=""> <cursor style="" r="255" g="255" b="255"> <background type="0" r="0" g="0" b="0"> <image file="" relative="0" extend="0" position="0" /> <tint opacity="0" r="0" g="0" b="0"/> </image> </background> </tab> <tab title="Cygwin"> <console shell="cmd.exe /k C:\utils\cygwin\Cygwin.bat" init_dir=""> <cursor style="" r="255" g="255" b="255"> <background type="0" r="0" g="0" b="0"> <image file="" relative="0" extend="0" position="0"> <tint opacity="0" r="0" g="0" b="0"/> </image> </background> </tab>
Restart Console, and everything works! Ctrl-2 opens a new command in my “projects” directory, Ctrl-3 opens a Cygwin prompt.
Now, I decided, it felt good. I think I got it doing kinda what I wanted it to do, so I went ahead and moved the folder from the downloads folder to my utils folder. Updated my shortcut in my “Quick Launch” menu, and when the right time came (which was a few seconds later) clicked the icon to get the exact same dll error that I got in the beginning! What is going on here people?!
Now I was really desperate, and hurt, and angry. I figured, take a copy of the two dll files and the console.xml file, paste it in my temp directory, and blast away the Console2 directory. Unzipped again, only this time I unzipped it right under my util folder. Pasted the dll files and console.xml, and clicked again. Everything works beautifully! My only explanation to this was that Console2 was holding on to the full path of the dll files, which previously was C:\…\downloads\Console2\xyz.dll, and that path no longer existed. I guess it makes sense. But now I am happy
Yet another quick note – Do not map your Ctrl-C to copy. The problem here is that Ctrl-C in cmd is mapped to canceling a running batch script. Rather, select the Edit -> Settings… -> Behavior “Copy on Select” option. You have to select to Copy, yes?
Hope this helped. Let me know how you managed to hack your Console2 install in the comments.
Windows reinstallation
A couple of weeks ago, I decided to reinstall windows on my work laptop. The primary reason for this was that I was moving on to a new project, and I had been experimenting with a few different approaches with my setup, so I figured a clean start would not hurt. Further more, I had to get the mammoth RSA off my machine! I was not convinced a simple uninstall would do it, so figured I would just nuke it.
Now this post is mostly documentation of how I performed my reinstall and all the steps I needed to take to get my machine up and running just the way I like it. Though I do hope this helps some of you out there.
My machine is the run-of-the-mill Dell Latitude D820. I just slipped in the OEM supplied Windows CD and let her rip. Complete with the full format option and everything. To be honest, it felt good. A nice, clean slate to start working with. Of course, I backed my documents folder prior to doing this. If you are here, don’t forget this step, its kinda important
Once this is done, is when the fun begins. First step, set up appropriate accounts, privileges and passwords. In my case, it was only me, so it did not matter that much.
Now, to set up my home directory. Most windows users default to the “C:\Documents and Settings\…” option, but in my case, I prefer to spend a lot of time at the command prompt. After a while, its get tedious to navigate around with all those double quotes. So I took up Lifehackers advice [Scroll down the page to the section named "A word about Windows' default home directory"] on the issue and created a “C:\home\raju” directory. Go ahead, read that section, I will wait.
Done? Good. Do keep in mind that moving your “My Documents” folder will not prevent programs like Eclipse and NetBeans from creating application specific directories in “C:\Documents and Settings\…”. This is the only downside of this arrangement, but I have lived with it so far
Now, the following step is crucial if you use Emacs and/or Cygwin. These tools look for a “HOME” environment variable. You want to set up right off the bat. Right Click on “My Computer” -> Properties -> Advanced Tab -> Environment Variables. Under the “System Variables” section, hit the “New”. In the dialog box that shows up, put “HOME” (all caps, without the quotes) and put the value as the path to your newly created home directory (in my case its C:\home\raju). Hit Ok to close that dialog, and then hit Ok twice to close the remaining dialog. There is another way to get to the System Properties dialog. Just press the Windows key on your keyboard (right next to the left Alt key) and Pause/Break key simultaneously. There, done and out of the way.
Having done that, I went ahead and created three more directories under the root note, namely developer, projects and utils. The developer directory is mainly for storing development tools that I use, the projects is for any and all projects that I am working on, and the utils directory is for utility tools that I use for maintenance, backup, ftp’ing etc. I will cover the tools shortly. There is some ambiguity sometimes as to whether a particular tool is for developer or utils, for e.g. Cygwin. Just flip a coin to break the tie, it doesn’t really matter.
Now, all the tools that I installed. Its quite a list, and it changes all the time. I constantly move from one tool to another for the same purpose all the time, so this list may not prove to be accurate a few months from now, but this is as it exists right now. I am breaking up based on which directory they are installed in (developer or utils).
C:\developer -
- Emacs-22.1
- InstantRails-2.0-win
- Intype
- Java
- NetBeans 6.0.1 [Moving soon to NetBeans6.1]
- PostgreSQL
- PostgreSql Driver
- ruby
- SQuirreL SQL Client
Now for C:\utils
- Aptana [IDE for (X)HTML, CSS, JavaScript and much more]
- CCleaner [Optimization tool for Windows]
- ClamWin [Open source anti-virus scanner]
- ClipX [Clipboard history manager]
- Console2 [Windows console window replacement]
- cygwin [Linux environment for Windows]
- ALZip [Archiving and compression program, think WinZip, only better]
- Evernote [For keeping notes]
- foobar2000 [Audio player]
- Foxit Software [Adobe Reader replacement]
- Launchy [Quicksilver for Windows, well almost...]
- Ad-Aware [Malware/Spyware protection program]
- Mozilla Firefox ['nuff said]
- Pageant [Work related]
- Paint.NET [Paint replacement]
- ProcessExplorer [Task manager replacement]
- puttycyg-20071202 [Cygwin terminal]
- Subversion [Source control]
- Taskbar Shuffle [Allows you to rearrange taskbar/tray icons]
- TortoiseSVN [Subversion client]
- twhirl [Twitter client]
- VLC [Media player]
- WinSCP [FTP client and much more]
I do allow most Microsoft programs (like Office) to install themselves in “Program Files” but thats the only exception (except those that don’t allow you to change their installation directory, which are far and few between).
That’s all for this time. I will detail my Firefox installation and several others soon.
Anyone out there have any ideas/suggestions? Feel free to drop a comment.
