Wednesday, September 26, 2012

Console system info for Linux

Here are a few useful console programs for Linux that help monitor the system performance. They can be run over SSH connection.

  • iftop - monitor network traffic
  • htop - monitor CPU and memory usage, processes

Tuesday, September 25, 2012

Problems with Visual Studio 11 (2012) and ASP.NET MVC 3

On a system with Visual Studio 2010 and all versions of ASP.NET MVC, I installed Visual Studio 2012. From the start it could not open an existing solution with MVC 3 project inside.
The steps to the solution:
  • Download ASP.NET MVC Tools Update for Visual Studio 11 (link)
  • Have your VS 2012 installation disc ready
As I could not install the tools update, I removed all MVC versions but v4. I also removed all the tools update packages. That still wasn't enough to let the latest update install.
So, in packages\WPT directory of your VS 2012 installation disc, find aspnet MSI installers. The installer for ASP.NET MVC 3 framework seems the same as the one in the latest package. Therefore, I removed the tools that come with VS by right-clicking the aspnetmvc3vs11tools.msi and choosing Uninstall.

Unpack AspNetMVC3ToolsUpdateVS11Setup.exe and install the tools MSI from there. Now I see all frameworks and tools in the list of installed programs and features in Control Panel.
*And* VS 2012 finally opens the solution with ASP.NET MVC 3 project in it.

Thursday, September 20, 2012

NSubstitute - simple mocking framework

I'm testing NSubstitute as a new mock/stub framework. The syntax is very simple and convenient. Here's a sample:
//Create:var calculator = Substitute.For();
//Set a return value:calculator.Add(1,2).Returns(3);
Assert.AreEqual(3, calculator.Add(1, 2));
//Check received calls:calculator.Received().Add(1, Arg.Any());calculator.DidNotReceive().Add(2, 2); //Raise eventscalculator.PoweringUp += Raise.Event();
See more at

Monday, September 17, 2012

Desktop System Info on Windows

So, a new round of search for desktop system-info tools. As I'm really missing Conky functionality on Windows, I'm about to test a few tools until I find one I'm happy with. Previously I've written a similar short article with links to some tools and this time I'll simply revisit the same applications and see if they got better over time. The previous article is here.
Currently I'm using Rainlendar and Networx on my desktop. Still missing some indicators, like processor, RAM, and disk queue and/or throughput. So, here are some tools and findings:

  • DesktopInfo: Nice. Integrates with desktop. Simple and easy. Missing network throughput in bytes/kilobytes.
  • Rainmeter: Great indicators. Skinnable and customizable. Can be displayed on desktop so it is not hidden with Win+D key combination. Seems a bit unresponsive at times. Has issues displaying the correct time for different time zones than local.
    Check the awesome skins here.
  • BGInfo: displays the system information on desktop.
Still no winner.

Friday, September 14, 2012

JavaScript Text Editors

Here are a few cool text editors in JavaScript that can be used in web pages:

  • CK Editor (link), full-featured text editor
  • jHtmlArea (linkdemo), lightweight text editor

Wednesday, September 12, 2012

HDMI Sound on Fedora 17

I'm connecting the TV to the PC via HDMI to watch movies on the big screen. Doing this on Fedora is still a challenge.
With the latest NVidia drivers the display on HDMI output is recognized properly and works beautifully. However, the sound is still a no-go. This text is here to store my findings in making the sound be heard on the TV speakers.

Some useful links to start with:

  • Nvidia HDMI out and Analog audio out combined (link)
  • HDMI Audio on NVIDIA GPUs (link)

Tuesday, September 11, 2012

Clipperz - JavaScript password manager

Clipperz (link) is an online password manager. It is implemented in JavaScript and requires nothing but your browser. A great thing about it is that you can download a copy of your password file and the password manager, all in one file, and keep it offline or someplace else, like your cloud storage. As the official description states:
Clipperz is a free and anonymous online password manager. Local encryption within the browser guarantees that no one except you can read your data. Nothing to install.
Clipperz offers an Open Source community edition, available at GitHub. As I am quite interested in JavaScript implementation for the sake of simplicity, and self-hosting for the sake of security, Clipperz makes a great choice.


Thursday, September 06, 2012

Adding 'node' link on Linux

Installing node-inpector fails on Fedora 17 since it, at some point during the installation, tries to run "node ". On Linux, node.js binary is "nodejs", not "node". So, to create "node" executable, simply link to existing binary:
ln -s /bin/nodejs /bin/node

Wednesday, September 05, 2012

Useful Node.js Packages

Here is a list of useful, not to say essential, node.js packages (install with npm):
  • express
  • connect
  • xmlrpc
  • forever, and forever-monitor (keeps the app running)
  • node-inspector (enables debugging with Chrome debugger)
  • supervisor (restarts node when .js files change, also keeps the app running)
  • nodev (link) - links inspector and supervisor

npm tips

Node Package Manager (npm) has some pretty cool functionality. Some of it is here for my own reference.

Install a package:
npm install

Install a package globally:
npm install -g

List all installed packages and their version
npm ls

Display current package version:
npm info version

Install all dependencies (from package.json):
npm install

Installing Forever on Fedora 17 Linux

Installing 'forever' package for Node.js turns out to be a bit more hassle than expected. The command is simple
npm install forever
npm install forever-monitor

However, more is required on Fedora 17:
yum install nodejs-waf
yum install waf
yum install nodejs-devel

Only now 'forever' package installation will go through.
I'm still getting errors installing forever-monitor.
Running 'forever' also results in an error:

module.js:337    throw new Error("Cannot find module '" + request + "'");          ^Error: Cannot find module './daemon.v0.6.18'    at Function._resolveFilename (module.js:337:11)    at Function._load (module.js:279:25)    at Module.require (module.js:359:17)    at require (module.js:375:17)    at Object. (/usr/lib/nodejs/forever/node_modules/daemon/lib/daemon.js:12:11)    at Module._compile (module.js:446:26)    at Object..js (module.js:464:10)    at Module.load (module.js:353:31)    at Function._load (module.js:311:12)    at Module.require (module.js:359:17) 

Tuesday, September 04, 2012

XMLRPC for JavaScript

As I'm looking for an XML RPC implementation in JavaScript, I'll post the findings on the topic here.

Starting from a question on Stack Overflow (link).

List of libraries:

  • Json XML RPC,
    Not maintained any longer.
    Last news posted on 5th of September, 2009.

A few Git tips

Synchronize with remote branch (master) - fetch remote code and merge with local (git fetch + git merge)
git pull
Update local version to master branch
git checkout master
The process when updating your fork of someone else's repository is described here. Basically, fetch changes from the original repository (upstream):
git fetch upstream
Merge the changes into local master branch:
git merge upstream/master
Push the changes to your remote repository (on GitHub). Easiest way on Windows is to use GitHub application.

Remove Git Explorer Extensions (Cheetah)

Installing different Git versions over time resulted in multiple "Git Init here" and related entries in Windows Explorer context menu. Removing Git Explorer Extensions - git cheetah - is relatively simple. Go to git-cheetah installation directory and unregister the dll:

C:\Program Files (x86)\Git\git-cheetah>regsvr32 -s -u git_shell_ext64.dll

You don't have to delete the dll. As soon as it is unregistered the entries will be gone from Windows Explorer.