Pages

Tuesday, December 25, 2012

Dvorak on stock Android keyboard

Settings -> Languages & Input -> Android Keyboard (Settings icon) -> Advanced settings -> Custom input styles -> Add style -> Set Language & Layout

Sunday, December 23, 2012

Google Docs Viewer

Google Docs Viewer can be used to preview online documents without downloading them to your device.

https://docs.google.com/viewer

Thursday, December 20, 2012

x86 Emulator on Android

Well, the day has come. One can carry a PC in one's pocket.
Limbo PC Emulator (link) is based on QEMU. It can load .iso images, for example Linux Live CDs, and use disk images from other emulators.
More info here.

Hacker's Keyboard (link) is recommended when working with emulator, as well as ConnectBot, an SSH client for Android.

Issue with Maps API on Cyanogenmod 10.1


Cyanogenmod 10.1 is out for Samsung Galaxy S2 (i9100), with Android 4.2.1. There is also new gapps package with Google libraries.
However, after installing these, all the apps depending on Google Maps API are failing to start or install.

The message that pops up during installation is "Error: Missing shared library."
Looking at logcat, this is the full error message: "E/PackageManager( 2208): Package com.google.android.apps.unveil requires unavailable shared library com.google.android.maps; failing!"

I fixed permissions on the files below:
/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar

The missing permissions were "read" for everyone. After changing these, the apps that use Maps API worked again!

Monday, December 17, 2012

KeePass Plugins

KeePassHttp & ChromeIPass

Integrate KeePass into Chrome.
Requires KeePassHttp plugin (https://github.com/pfn/keepasshttp/).

For integration using Mono, go to https://github.com/pfn/keepasshttp/tree/master/KeePassHttp and download KeePassHttp.dll and Newtonsoft.Json.dll. Put these files into Keepass directory.

WinKee

Caches and encrypts your KeePass file credentials with your Windows account credentials to allow quicker database opening.

WebAutoType 

"This plugin allows to execute auto-type based on the current web browser URL instead of the window title." Download page (link)


For more plugins, see the list of all KeePass plugins (link).

Sunday, December 16, 2012

Prevent Monitor Sleep in Gnome/Cinnamon

Edit: Currently using Screensaver Inhibit, a Cinnamon applet, and it seems to work well!

As I started using Cinnamon as a window manager, Caffeine shell extension for Gnome is not available anymore. This was a very convenient quick option to prevent screen going off in the middle of watching a movie. The root cause is that the option for screen going to sleep cannot exceed 1 hour in Gnome settings.
However, there are ways to modify this. I just wonder why something as simple as this is not already a part of standard system settings.
In order to prevent screen going off at all, these are the settings that need to be modified. This can be done either through command line (thus a perfect candidate for scripting, which is my current preferred option) or through a GUI, a program called dconf-editor.

org.gnome.settings-daemon.plugins.power sleep-display-ac
org.gnome.settings-daemon.plugins.power sleep-display-battery
org.gnome.desktop.session idle-delay

To display the value of these settings in a shell (command line), use "gsettings" with parameter "get" and then the name of the setting. For example:
gsettings get org.gnome.settings-daemon.plugins.power sleep-display-ac
To modify the value use "set" and a value at the end.
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac

Source: Disable GNOME3′s Habbit Of Turning Off The Display After Some Time (link)

Saturday, December 15, 2012

Disabling Group Policy on Windows 7

The articles below show how to disable background group policy refresh, the feature that can get really annoying, depending on the level of detail applied. Things like disabling setting the small icons on start menu is a particularly annoying one. Some customization features should be left to the users to choose simply because it makes them more productive.
For editing the registry the administrative credentials are required.

Disable background refresh of Group Policy (link),
Disable Group Policy Service on Windows Vista/7 (link)

Adobe Reader on Linux

Here is a link to a blog post on Adobe Reader blog, showing how to install Adobe YUM repository and Adobe Reader for Linux.
http://blogs.adobe.com/acroread/2008/02/14/adobe_reader_now_available_via/

Friday, December 14, 2012

Wood Theme for Cinnamon

Cinnamon shell has its own share of customization themes. Below is the link to one of my favorites, a wood theme.

http://cinnamon-spices.linuxmint.com/themes/view/24

Sublime Text 2 Tips & Keyboard Shortcuts

Here are some usage tips for (the awesome) Sublime Text 2:

  • Multiple selection: hold Ctrl and select. With multiple selection, when you type, the text will be written at all selected locations. 
  • Multi-selection with keyboard-only: Ctrl+Alt+cursor keys.
Below are some useful keyboard shortcuts for Sublime Text 2:
  • Un/Comment current line(s): Ctrl + /
  • Move code lines up/down: Ctrl+Shift+Up (or Down)

JavaScript Performance Tips & Tricks

Some great JavaScript performance tips, like replacing eval() with new Function().

Instead of writing
eval(strCode)
use
(new Function(strCode))()

http://moduscreate.com/javascript-performance-tips-tricks/

Integration Testing with LocalDb

LocalDb seems like a good choice as a storage mechanism for running integration tests.
Some general guidelines would be:

  • Add a service-based database to a project; 
  • Set the DbContext's connection string to use LocalDb engine with this database;
  • Populate the database prior to use (static data, test-specific data);
  • Run tests.

Add a Database to a Project

In Visual Studio, right-click on a (test) project and select Add -> New Item… -> Visual C# Items -> Data -> Service-based Database. The assumption is that we already have a working code, using a real database. Hence there is an existing context. So, during the creation of the database file we will not generate any db-access code automatically (press Cancel in the wizard) or we will delete the auto-generated code after it is added to the project.
By default, the database file is set to "Copy always" to output directory so no action required there. This means that it will be in our output directory when the project is built, and we can note that this is the location we will use in the connection string next.

Set Connection String

(to be continued...)

References:

Developer goodness - LocalDb (link)
Using SQL Server 2012 LocalDb in VS11 and VS2010 for testing (link)

IIS 7 Not Serving Images

Just had a case where, on a newly installed system, IIS 7 was not serving images in a web application. Everything else seemed OK, including scripts, CSS files, and the code.
Fortunately, the solution was simple. Serve Static Content option was not selected in Windows Features -> IIS.

More instructions - link.

Thursday, December 13, 2012

Cinnamon

Cinnamon is a Linux shell that runs on top of Gnome. It adds value to the Gnome experience by improving on some of the characteristics of Gnome 3 that drew complaints as of late.
While I like Gnome 3 interface, there is a nasty glitch in a combination of Gnome 3 + NVidia drivers + VMWare Workstation, where Gnome session will stop responding. One can still switch to another console and kill the session but that can take down any running Virtual Machine or other programs that were active in the unresponsive session.
So, as a suggestion from VMWare Community, I found Cinnamon and am giving it a try. So far the impression is positive but I'm missing my Caffeine extension that prevents the system from locking down in the middle of a movie.

More on Cinnamon: http://cinnamon.linuxmint.com/

Dropbox Installation Aborted

After installing Dropbox on a new workstation, but not setting up the account, I could not connect to the Dropbox service as the proxy details were missing. Due to installation of additional software I had to reboot before completely setting up Dropbox client. After that, the application was in some undefined state. I was unable to run it or re-install. When trying to re-install, I was getting the infamous "Installation Aborted" error.
The list of installed programs showed Dropbox and the removal worked but any subsequent installation would again fail.
These are the steps that I tried, in order to be able to reinstall:
  1. Uninstall Dropbox from Programs and Features
  2. Remove Dropbox directory from %APPDATA%. To do this, open Windows Explorer and type "%APPDATA%" into the address bar (without quotes). If there are any issues (with the shell extension, for example), use Unlocker to get rid of it.
  3. Remove "HKEY_CURRENT_USER\Software\Dropbox\" with RegEdit. See this help article.
  4. While in RegEdit, delete all keys containing "Dropbox". These are mostly related to ShellExtension.
  5. Clean-up registry with CCleaner, Wise Registry Cleaner (link), and Eusing Registry Cleaner.
  6. Remove other Dropbox entries with Autoruns. (Shell extension is in "HKLM\Software\Classes\*\ShellEx\ContextMenuHandlers"; "HKCU\Software\Classes\Directory\ShellEx\ContextMenuHandlers", "HKCU\Software\Classes\Directory\Background\ShellEx\ContextMenuHandlers", "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers")
  7. Unlink your computer from Dropbox (link).
However, none of these really helped. Then, after n-th failed attempt, a simple solution came - boot into Safe Mode and install from there. Installation was a success without performing any of the cleanups above.

In the end, it turns out the issue was caused by antivirus policy which blacklists dropbox.exe. Probably the policy was not updated during the first installation. Fortunately, Dropbox will work even if .exe file is renamed.

Unlocker

Unlocker is an invaluable tool on Windows. It allows you to release a lock on any file or directory.
For 64-bit systems there is a separate 64-bit version.
Since there are a lot of download links on the Internet, I always miss the original one that also has a 64-bit version. Here it is for reference:

http://www.emptyloop.com/unlocker/

Monday, December 10, 2012

.cmd syntax coloring for Sublime Text 2


Add .cmd file syntax support to Sublime Text 2 by appending
cmd
to the file extension array at the bottom of
c:\Users\\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage

Sunday, December 09, 2012

Mediaserver process on Android

Playing music on Samsung Galaxy S with Android seems to result in a pain of quickly-draining battery power. It is being consumed by process 'mediaserver', Media Storage, which scans the SD card with media (pictures, audio, video) and indexes it to a database.
There are lots of complaints out there and no straightforward way to solve the problem. I am trying the following:

  • Disable Media Server: Go to Settings -> Application Manager -> All, find Media Server and Disable (source: link)
  • Use PowerAmp for playing music and QuickPic for viewing images. These apps have their own media databases and don't suffer from the battery drain issue. (source: link)

Debugging Gnome Shell Extensions

Gnome Shell Extensions are written in JavaScript and it is quite easy to get started with development. Also, there is an easy way to trouble shoot other extensions in the system by using Looking Glass.
To start Looking Glass, press Alt+F2 and type "lg".
After updating an extension code, reload the Gnome Shell with Alt+F2 and typing "r".

Source: http://stackoverflow.com/questions/8425616/how-to-debug-gnome-shell-extensions-is-there-any-tool-for-that

Saturday, December 08, 2012

Gnome 3.6 Online Accounts and Google 2-Step Authentication

Here is a solution to Online Accounts integration for Google Talk in Gnome 3.6 if you are using 2-step authentication.


Open Seahorse, find your passwords for “GOA”
Create an application-specific password for your Google account in the web browser.
In Seahorse, open the entry and display the password. It will be very long, find the following section: 'password': <'your_password'>.
Replace your_password with your application-specific password you’ve generated.


Source: http://kparal.wordpress.com/2012/12/03/gnome-3-6-gnome-online-accounts-and-google-two-factor-authentication/

Wednesday, December 05, 2012

SQLite Browser standalone

Apart from Firefox plugin, SQLite Browser also exists as a standalone program. The project page is at

http://sourceforge.net/projects/sqlitebrowser/

Tuesday, December 04, 2012

Edit Start Menu in Windows 7

The simplest way to add shortcuts to Start Menu in Windows 7 is to open the Start Menu (with Windows key or clicking the Start orb) and then right-clicking the "All Programs" item. From the context menu you can either Open your own shortcuts or Open All Users.

For graphical details, see this link.

Monday, December 03, 2012

Computer Ergonomics


Looking for an alternative to EyeDefender on Linux, I found this great program. It is free (Open Source) and quite configurable. I love how it is implemented - the breaks, the notifications, timers. The default values might require some tweaking, depending on your situation.
The default settings from EyeDefender are 2-minute break every 45 minutes. The settings I'm using are taken from the following link in a good article on ergonomic set up for the workplace - http://lifehacker.com/5755870/how-to-ergonomically-optimize-your-workspace
and they are:
Microbreak every 15 minutes for 30 seconds;
Rest break every 45 minutes for 3 minutes;
and a Daily limit of 8 hours.

WorkRave includes exercises that one can trigger manually. These automatically pop up during rest break. I really like the program so far.

Some related articles with comments on break time and frequency:
http://cybernetnews.com/how-to-prevent-eye-strain-and-rsi/
http://www.working-well.org/workrave.html

Customize Visual Studio 2012

Set up casing of the menus. Run the following in PowerShell:
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\11.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1
Source: link.

Set up tab size and whether to use tab or space. Tools -> Options -> Text Editor -> All Languages -> Tabs. Set tab size to 4, indent size 4, insert spaces.
Source: link.

Colors. Use Color Theme Editor to set the VS theme. (link)

Friday, November 30, 2012

OSMAnd Default vs Development

Since I always forget which version is which...

OsmAnd versions at the nightly download page are as follows:
  • default = free version at Market 
  • development = OsmAnd+ version at Market 
The download page is here.

Update: The non-default version is now called -nightly.

Tuesday, November 27, 2012

Adding dependent files in VS 2012

Since my Web Workbench extension is messed up, I'm having issues adding CoffeeScript (.coffee) files with their dependent .js equivalents. The solution seems to be as easy as installing an extension.
As per answers on Stack Overflow (link), VSCommands for Visual Studio 2012 (link) enables managing dependent files through GUI rather than having to manually edit the project file (.csproj) and reload the project in IDE.
The way it works with VSCommands is to select .coffee and .js files, right-click, and select "Group Items" option, then select the parent item. Neat.

Tuesday, November 20, 2012

Managing services in Linux

A great overview of services in Linux, Fedora 18 in particular, is available here.
A nice GUI tool for managing services is called system-config-services and is installed by the package with the same name.

Tuesday, November 13, 2012

Entity Framework Visualizers

EFContrib on CodePlex (link) contains links to project related to Entity Framework. Some of them are DbContext visualizers:
  • Entity Visualizer (link)
  • Entity Visualizers (link)
See this post on how to install a visualizer in Visual Studio.

Monday, November 12, 2012

Google Earth 7 on Fedora 18

On Fedora 18, Google Earth RPM (google-earth-stable_current_x86_64.rpm) installation fails because it conflicts with package filesystem-3.1-2.fc18.x86_64. The reason is "/usr/bin" that is set inside the Google Earth package.
Using
rpm -U --force 
solves this problem. Then, if you get "/lib/ld-lsb.so.3: bad ELF interpreter", this means that 32-bit libraries are missing. Install them with
yum install redhat-lsb.i686 redhat-lsb-graphics.i686 redhat-lsb-printing.i686
However, after this Google Earth crashes. The issue has been reported here.

Edit: Tried with google-earth-stable-7.0.2.8415-0.x86_64. It still clashes with the filesystem package. Forcing installation succeeds but then again Google Earth crashes on start. The reported issue has been updated with the error log.

Sunday, November 11, 2012

Hibernate in Fedora 18

As there is no direct link to Hibernate in current state of Fedora 18, here is a way to easily create a script that will hibernate the system:

sudo /bin/sh -c 'echo disk > /sys/power/state'

Source: https://ask.fedoraproject.org/question/2181/the-final-battle-between-gnome-3-and-hibernating

As if that is not enough, there is an even easier way:

pm-hibernate

This utility is a part of pm-utils package.

Wednesday, November 07, 2012

Ranges in HTML5

Here are some useful texts about Range and Selection objects in HTML5.

  • Introduction to Ranges (link)
And relevant libraries:

Mobile Development with HTML5

Android and HTML5 have in common the fact that they are a free and open platform. And while Android is quickly gaining more market share, I believe HTML5 applications are the way to go in the long run.
Here I will list some resources that can assist in mobile development with HTML5 and related technologies.
  • PhoneGap (link) - open source framework that supports 7 mobile platforms
  • Building Android Apps with HTML, CSS, and JavaScript, book (link)
For getting started with Android and PhoneGap, see this article. To get started using command-line tools, see this page.

To set up PhoneGap, you need to set up the following dependencies first:
  • Java SDK
  • Ant
  • Android SDK
After installing Java SDK and Ant, set JAVA_HOME to paint to JDK installation directory, and ANT_HOME to Ant installation directory. Then add %JAVA_HOME%\bin  and %ANT_HOME%\bin to PATH.
To see more about setting JAVA_HOME, check this article by Oracle (link).

Data Access

As Web SQL standard has become obsolete, the data storage method to use with HTML5 applications is IndexedDb (link).

Monday, November 05, 2012

Setting up a Fedora 18 system

Kernel Panic with VMWare Workstation 9

There is a nasty kernel panic error when running guests in VMWare Workstation 9 on Fedora 18. Here are a few links that help resolve it:

Other occurrences: here, and here.

Threads on VMWare Community: 2103048,  400616.

Patch, vmware 9, kernel 3.5: here

Another issue that appears occasionally is "can not open /dev/vmmon"
As per this suggestion, the solution is to run "sudo service vmware start"

Setting up portable Sublime Text 2

Here are links to Sublime Text 2, some instruction texts, and plugin repositories I used to set up a portable instance of this excellent development editor. I also mixed Windows and Linux version so I'll see how that will work out.

Sublime Text 2 (link)

Dev Build (link)

Nightly Builds (link)

==================================

Data directory

See Basic Concepts (link).

Data directory in portable version contains user data which is located in

Windows: %APPDATA%\Sublime Text 2
Linux: ~/.config/sublime-text-2

when using installed version.

=====================================

Sublime Package Control

Package Control homepage (link).

I had issues loading the repository via SSL. In that case edit Package Control.sublime-settings, in Data\Packages\Package Control\, and use http instead of https.
=====================================

CoffeeScript

Instructions 1 (link), instructions 2 (link).
Instead of CoffeeScript compiler for Windows (link) install the official CoffeeScript compiler. See this link for more details. In essence, install node.js and then CoffeeScript as a node plugin. This will install a command-line version of the compiler.

In the file User/CoffeeScript.build-settings, Path parameter is pointing to the location of the coffee executable.

Build on Save (link)

Add "coffee" to the file types (Preferences -> Package Settings -> SublimeOnSaveBuild -> Settings-User).
=====================================

TFS

Sublime TFS (link)
Team Foundation Server Power Tools December 2011 (link)

Sunday, November 04, 2012

Mounting ISO to Wine prefix with q4wine

I like using q4wine as a helper tool for Wine. Having multiple prefixes and their administration gets much easier.
One of the things often required for installation of software is mounting ISO files as CD-ROMs to a Wine prefix. The way to do this in q4wine is the following:

When creating a prefix (or editing once it has been created), in the Quick Mount section on the General tab, set the mount point directory. The best is if this is within the prefix directory itself. For example, if the prefix is in "/home/user/wine/x86", the mount point would be "/home/user/wine/x86/cdrom". Create the mount point directory if it does not exist. Use full path directory names, not ~.
In the same section, set the Device (windows drive). The default is the next available letter, which is D:.

Once this is set up, install "fuseiso" package. This turned out to be the easiest way of mounting ISO files as an ordinary user. No root access needed, not even sudo.
Set q4wine to use fuseISO by going to File -> Options -> Quick Mount. Select FuseISO as a Quick Mount profile. Leave the commands at the default settings.

Then go to Tools -> Disc Image Manager and add the .iso file to the list of known images. The images from here will be available in the Mount menu.

After all this is set up, right-click on the prefix, select Mount ISO option, and select the .iso file added to the Disc Image Manager. It will become available to the selected Wine prefix. Then you can simply run any program from that Windows drive, as set in the prefix settings.

Friday, November 02, 2012

QUnit: Testing JavaScript

For getting started with QUnit, a testing framework for JavaScript, see a good introductory article here. This text is part of QUnit documentation. See Intro to Unit Testing (link).
Below are additional useful resources.

  • QUnit Presentation (link)
  • Cookbook (link)
  • API Documentation (link)
  • Article in MSDN Magazine (link)
Besides QUnit, there is Sinon.JS (link), a mock/stub framework. Useful when mocking window functions, for example.

Monday, October 29, 2012

designMode and window events in HTML5

One thing I noticed, working on HTML5 editable documents is that designMode will turn off window events in Firefox (16 and 17). So, if there is a line
document.designMode = "On";
in your document code, the timers, before-unload, and similar events will not fire in Firefox.
One way out of that is not to use designMode and stick to contenteditable attributes only.

This is a part of the spec. See here.
Even more important issue is that, when the browsers implement the HTML5 specification completely, designMode should block the scripts. As the above specification states:
Enabling designMode causes scripts in general to be disabled and the document to become editable.
and also
Thus, for instance, enabling designMode will disable any event handler attributes, event listeners, timeouts, etc, that were set by scripts in the document. 

Saturday, October 27, 2012

Skype 4 on Fedora 18

The magic command is


sudo yum install alsa-plugins-pulseaudio.i686


This will install all the required dependencies to remove "Problem with Audio Capture". Other than that, the installation is pretty good in that it installs all the other dependency libraries. No need to install them separately any more. 

Monday, October 22, 2012

Cryptography with JavaScript

JavaScript has become a full-blown object-oriented language with decent performance both on the server- and client-side. It can run with Node.js or inside a browser sandbox. This makes it a valid candidate for multi-platform development of commont tasks. One of which is cryptography.

Crypto Libraries

  • Stanford Javascript Crypto Library (link)
  • CryptoJS (link)

Password Managers

Some popular crypto implementations include online password managers. Some of these are Clipperz, LastPass, 1Password, etc. 
All of them can work offline but under different conditions. 

Steganography in Javascript

Steganography is the art of hiding the message in a way that is not suspected. Below there are a few examples of steganography with images.

  • The article with the same name (link)
  • Information Hiding: Steganography done with JavaScript (link)

Practical Steps

I am starting a project of creating a password manager implementation purely in JavaScript. The code is available here. The purpose is to gather and expand knowledge on the topic.

Additional Links

  • Cryptography with Javascript (link)

Sunday, October 21, 2012

Importing CAcert Client Certificate into Chrome

Client Certificate import from CAcert does not work in current Chrome Dev. After generating the certificate, click "Import Certificate" will result in a message stating "Server sent an invalid certificate."
The way I made it work in Chrome is by using Firefox. The process works fine in Firefox. Firefox has its own certificate store so, after importing the certificate, go to Firefox Settings and export the certificate, including the private key. Then, in Chrome Settings, go to Manage Certificates and click Import button. Select the previously exported certificate and you're good to go.
Then go to https://secure.cacert.org/index.php?id=4 to test logging in with the certificate.

As certificates build upon public-key infrastructure (PKI), I assume this should become the standard way for authentication. The important push ahead comes from CAcert (cacert.org), the organization that offers free certificates.

Tuesday, October 16, 2012

Minimalist Web Server

As modern browsers are restricting access from HTML pages to local files, it is becoming necessary to serve them from a web server. For this purpose it is an overkill to install or even just set up a site in Apache or IIS. In the past I've used Tiny Web Server (link) but nowadays there are better options.
Currently, my preferred option is using Node.js with node-static (link).
See the code below or click here to see it on Github.Gist.

This requires node-static to be installed. The most convenient way is to add it as a dependency to the package.json, like this:
and run "npm install".
Then, simply add index.html or other static files and the server is up and running.

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 http://nsubstitute.github.com/

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.

Links:

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)
Development
  • 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, http://code.google.com/p/json-xml-rpc/
    Not maintained any longer.
  • http://kuriositaet.de/javascript/jsxmlrpc.html
  • http://kuriositaet.de/javascript/xmlrpc.html
  • http://sourceforge.net/projects/jsxmlrpc/
  • http://www.zentus.com/js/xmlrpc.js.html
  • http://www.scottandrew.com/xml-rpc/
  • http://phpxmlrpc.sourceforge.net/jsxmlrpc/
    Last news posted on 5th of September, 2009.
  • http://www.vcdn.org/Public/XMLRPC/
  • http://mimic-xmlrpc.sourceforge.net/

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.

Friday, August 31, 2012

Dropbox Public Folder

Dropbox, as almost everyone knows, offers sharing publicly available files from a Dropbox account. This means putting a file into the Public folder and it will be publicly available to anyone with the full URL of the file. It is a neat and convenient way to store certain files to be shared with friends or just anyone, including yourself when on a public computer. Even more important, there are situations when we lose our mobile device or access credentials to our email or similarly important accounts.
Since now Dropbox also offers 2-step authentication with Google Authenticator, I strongly suggest you use it to protect your online files. But, since this also complicates access when you don't have your access devices, Public folder can be used for quick access to the files you might need on the go. Use at your own risk, of course.
The link to my public folder is here.

Thursday, August 23, 2012

RDP for Linux

XRDP (link) is an Open Source RDP server for Linux. The installation on Fedora 17 is pretty straightforward:
  • yum install xrdp
To run it manually, use
  • xrdp
  • xrdp-sesman
However, it is probably a better idea to add it as a service so that it runs on boot:
systemctl enable xrdp.service
You can confirm that the service has been created by running 'Services' from the Applications menu.

Set the RDP client to use 24-bit color and it will happily connect from Windows to your Linux server!

To set a custom resolution after you connect, go to System Settings -> Display and set any desktop resolution you like.

I also tend to use Dvorak keyboard layout. Simply changing the keyboard layout to English(Dvorak) won't work unless it is also set with "setxkbmap dvorak".

Automatic Login with Putty

To automatically log in to a remote SSH server with Putty client (from Windows), do the following:

On the Client:

  • generate a new key with PuttyGen
    • save the private key into a .ppk file
    • copy the public key string from the text box at the top and paste into authorized_keys file on the server
  • In Putty Session, go to Connection->SSH->Auth and add the private key for authentication.
  • Run pageant and add the key file with the pass phrase to it.

On the Server:

  • in your ~/.ssh/ directory create authorized_keys file
  • chmod 600 authorized_keys
  • make sure that, in sshd_config, only authorized_keys file is used to check for allowed keys


Sources:
Putty public keys (link)
ssh authorized_keys (link)
How to fix "Server refused our key"; comments (link)
Store passwords in Putty (link)

Enabling SSH Server on Fedora 17

In order to connect to your Fedora 17 Linux box via SSH protocol the following steps are required.

SSHD package is installed by default. You need to start the daemon/service. With elevated privileges do the following:
To enable the service

$ systemctl enable sshd.service

Start service

$ systemctl start sshd.service

Now you can test sshd service by logging in from the local terminal (not remote one, yet) -> ssh localhost, or ssh .

After this is done, allow access to sshd through firewall.

$ system-config-firewall

Make sure port 22 is allowed for access. This was done by default in my case. Then, I had to add a new interface in the Trusted Interfaces. The mask I added was "em+" for all em devices. Then enable this interface.

After this, I could connect to port 22 from a remote Windows box.

Sources:
SSHD service (link)
Firewall Tip (link)

Friday, August 03, 2012

Merge/diff tool settings for TFS integration

Merge/diff tool settings for TFS integration

Beyond Compare

  • Instructions (link)

CodeCompare

  • Instructions (link)
Add "/environment=standalone" parameter to CodeCompare configuration in Visual Studio (Tools -> Options -> Source Control -> TFS Settings -> Configure User Tools) in order to open diff/merge in a standalone CodeCompare window rather than in Visual Studio. This is my preferred setting.

Tuesday, July 24, 2012

ClickOnce: The directory name is invalid

Just had this issue after deleting the local application files from a ClickOnce-deployed application. The application would not update or start.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of https://qat.unvienna.org/APGUI-Global/APGAssignmentPro.application?ticket=87E653CC3B6235E1223144B171B4D17742B2DE7C2FD431ED56F2113BB77C694906107D95973A7731FB307B1C967CA8C71043FC3E0FD3EC191B53E9D2D07E4ACBB1D5EDE5ADF266215710F392A2889362AF3A6326DD63F52659923174E8E774FE793C69DFCEF57506C0D62A9E8011EE48B9506616&Location=Vienna resulted in exception. Following failure messages were detected:
+ The directory name is invalid. (Exception from HRESULT: 0x8007010B)
Fortunately, the solution is simple. Delete all the files and directories from the Apps directory, where ClickOnce applications are stored.


Reference: Missing Local Files (link)

RIOT - Free Image Optimizer

RIOT - Radical Image Optimization Tool - is a free image optimization tool that can run standalone or as a plugin in other image viewers and editors.

link

Friday, July 13, 2012

Installing Business Intelligence Studio - Reporting Services

Here is a brief on how to work (develop) Reporting Services based reports in an environment with Team Foundation Server 2010 used for source control and SQL Server 2008 R2 used as a database server / Reporting Services server.

Instructions on installing components are here.

Install

  • Visual Studio 2008 Team Explorer, 
  • Visual Studio 2008 Service Pack 1,
  • Visual Studio Team System 2008 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010

and connect to TFS server.

Friday, July 06, 2012

Period in the MVC application URL results in Error 404

We've just had a case where a parameter to an MVC method was resulting in 404 Error because it contained a period (.) in the name. The application was running in IIS 6, .Net Framework 4, MVC 4. 

The solution was to create a wildcard application map for aspnet_isapi.dll that does not verify that the file exists, as described in the following link.

LLBLGen Visualizers in VS 2010

To install LLBLGen Visualizers in Visual Studio 2010, simply copy
  • SD.LLBLGen.Pro.DebugVisualizers2010.dll, 
  • SD.LLBLGen.Pro.DQE.SqlServer.NET20.dll, and 
  • SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll 
into c:\Users\<your username>\Documents\Visual Studio 2010\Visualizers\
This enables previewing the Predicate Expressions, Relations collections, Entity collections, Sort Expressions, Prefetch Paths and what not.
More details (link).

Thursday, June 21, 2012

TortoiseHg (Mercurial) and Passwords

Using a remote repository usually involves passing the credentials from your Mercurial client (TortoiseHg) and the repository server. If you commit/pull often then it is a pain to have to enter username and password every time an access in attempted over network. At the same time, it is a no-no to store username and password in configuration files in plain text.
Mercurial Keyring is an extension that securely handles this. Additional configuration may be needed, as per this article (link) but changes in TortoiseHg and the extension itself may make these obsolete.

Wednesday, June 20, 2012

Changing home directory for IIS Express


If you want to bring your sites along when switching machines, or sync them via some cloud service, you can change the home directory for IIS Express. Home directory is where all the configuration for web sites is stored.

Changing the User Home Directory
IIS 8.0 Express supports changing the user's home directory, which is mapped to the %IIS_USER_HOME% variable in configuration. By default this path is located at %UserProfile%\Documents\IISExpress, but users can change this by setting a CustomUserHome registry property in HKCU\Software\Microsoft\IISExpress, or by specifying the "/userhome" parameter when launching iisexpress.exe.

From ReadMe (link).

Developer goodness - LocalDb

With SQL Server 2012 Microsoft has released a product named LocalDb.

"LocalDB is created specifically for developers. It is very easy to install and requires no management, yet it offers the same T-SQL language, programming surface and client-side providers as the regular SQL Server Express. In effect the developers that target SQL Server no longer have to install and manage a full instance of SQL Server Express on their laptops and other development machines. Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too." 
Currently available for download from here.
A few things to note, though. LocalDb can be installed only on OSes above Windows 2000. It requires SQL Native Client which has to be installed separately. It can only be managed with SQL 2012 management tools which have to be installed separately. It supports only local connections through Named Pipes. The maximum database size is 10 GB.
All this seems good enough for development, or even minimalistic production setups, and is offset with the ease of deployment.

The connection string to use with LocalDb is "Data Source=(localdb)\v11.0;Integrated Security=true".

A few introductory articles:
  • Introducing LocalDB, an improved SQL Express (link)
  • What is LocalDB? (link)

Tuesday, June 19, 2012

Adding ASP.Net MVC 4 to Web Forms Project


This is probably not what you think. But, since I don't know what you think and that is irrelevant at this point, we can get down to business.

I've just added MVC 4 to an existing ASP.Net Web Forms project. There were a few quirks, especially with all the advice out there in regards to versions of MVC. So, here are some notes I wrote down during the process that can come in handy when performing the same exercise again.

Adding MVC 4

A great start is this article here. However, this relates to older version of MVC so some adjustments are necessary. The section that relates to adding items to the web.config, in particular. Basically, all the 3.5.0.0 versions need to be replaced with 4.0.0.0. The modified contents are here.

Adding Razor

If you are going to add new Views using Razor view engine, a Razor section needs to be added to web.config. In appSettings add this. Add the following code to appropriate sections (declaration in configSections add the Razor section itself) from here.
In Views directory there needs to be web.config. Check the contents here.

Friday, June 08, 2012

AutoFac, IoC Container for .Net

Autofac is fast and simple Inversion of Control (IoC) container for .Net. (link)

There is a tutorial on Code Project (link).

#dependencyinjection

Monday, June 04, 2012

Installing latest Redmine on Windows

Ruby is required for Redmine.

Ruby installer adds the following to the PATH:

C:\Ruby187\bin;

Steps

  • gem install bundle
  • gem install webrick
  • gem install rails

json package

json native package requires installation of DevKit.

http://github.com/oneclick/rubyinstaller/wiki/Development-Kit


cd <devkit_install_dir>
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install

rmagick can't be installed on Windows. Use:


bundle install --without development test rmagick

Configuring Redmine


rake generate_secret_token

Running


ruby script/rails server webrick -e production

Thursday, May 31, 2012

Type umlauts on Dvorak keyboard in Linux

Here is an article explaining how to enable typing German umlauts (and others) in Linux. This is so convenient. Now I can type umlauts straight from Dvorak keyboard layout.
Basically, in the keyboard layout settings, set the Compose key. In Fedora 18 Gnome 3.6 this is in Keyboard -> Shortcuts -> Typing.
I use Right Alt for this. And then type key combinations to get umlauts:
  • ä = compose, ", a
  • ö = compose, ", o
  • ü = compose, ", u
  • ß = compose, s, s
and so on. There are many other special characters that can be typed this way.
Source Article.

Windows Server Update Services

Here are some resources for setting up a Windows Server Update Services (link).

Windows Server Update Services (WSUS) enables information technology administrators to deploy the latest Microsoft product updates to computers that are running the Windows operating system. By using WSUS, administrators can fully manage the distribution of updates that are released through Microsoft Update to computers in their network.

Download WSUS 3.0 SP2 (link). WSUS Installation Guide (link).

If you get a message indicating that "IIS role or additional IIS role services must be installed", it is probably because your Windows Server IIS is missing IIS 6 MetaBase Compability role service.

After installation, I gave Read permissions on "c:\wsus" directory for Everyone so that any computer on the network could access the updates.

Clients

Configure client updates (link). Configure clients to use WSUS as the primary source of updates (link). Setting the clients that are not in the same domain is done by editing registry (link).

Create the key HKEYLOCALMACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU and add a DWORD value "UseWUServer" and set its value to 1.

Then in HKEYLOCALMACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate add keys WUServer and WUStatusServer, type String (Reg_SZ), and set them to the same value. That being the HTTP(S) address of your update server.

These settings are available as a .reg file on my Dropbox (link). You should adjust the URL to point to your WSUS server installation.

After client workstation restart, it automatically uses the WSUS server for Windows Update. The first time it checks for updates it will install a different version of Windows Update components. After that it will allow checking against a WSUS server as well as against Microsoft online update.

Administration

As an Administrator, you may want to clean the database ocassionally. This is done by removing superseeded updates.

A convenient way to download updates is to look at Needed updates. These are reported as needed by the clients.

The updates will download after they are approved (by default). This option is adjustable.

Enabling Java applets in Chrome on Fedora

To enable running Java applets in Google Chrome under 64-bit Linux (Fedora 17 x86_64) the following steps should get you going.

Install Java Runtime Environment. The version 1.7.0_04 uses the directories specified below. 

# mkdir /opt/google/chrome/plugins

# cd /opt/google/chrome/plugins

and then either

# ln -s /usr/java/default/lib/i386/libnpjp2.so

for 32-bit version (i586), or

# ln -s /usr/java/default/lib/amd64/libnpjp2.so

for 64-bit version (x64) of JRE. 

After this, go here to test whether Java applet support is successfully installed in Chrome.

Tuesday, May 29, 2012

Setting the default file handler in Gnome

Changing the default image viewer in Nautilus (default file manager in Gnome 3.4) is quite easy. Right-click on an image, select Properties, then go to Open With tab. Either select a different image viewer from the list there and click 'Set as default' or select a different handler by clicking 'Show other applications' button and searching for the desired application.

This process works if you want to change the default file handlers for any file type.

More Node Plugins

The Node Toolbox (link) contains categorized links to plugins for Node.js with descriptions. Quite a useful site for a javascript developer.

Saturday, May 26, 2012

Changing GDM background

The Beefy Miracle wallpaper is not very pleasing to the eye so I looked into changing GDM background on Fedora 17 Linux. In order to accomplish this feat, we can use gdm3setup.

To get gdm3setup, clone its git repository:

git clone https://github.com/Nano77/gdm3setup.git

Then run install.sh script as root to install. It will install a shortcut (.desktop file) so the application is accessible from the Applications list as GDM3 Settings.

Apart from changing the wallpaper, it offers a few more options for customization of both GDM and Gnome Shell, like cursor theme, GTK theme, logo, etc.

Source: link

Friday, May 25, 2012

Useful Shortcuts in Nautilus

I'm getting used to Nautilus as a default file manager in Gnome. While at first it seemed inferior to Dolphin from KDE, after discovering plugins and shortcuts to different features, I find it quite convenient and capable. It has all the features I'm used to with Dolphin (or Windows Explorer for that matter).

Some of these features would be WebDAV support (mentioned earlier), integration with desktop search, being supported by Beyond Compare, terminal integration, and so on.

Here I will list some of the useful plugin packages and shortcuts when using Nautilus.

Plugins

  • File Roller
  • Gnome Exe Thumbnailer
  • Nautilus Actions
  • Nautilus Dropbox
  • Nautilus Extensions
  • Nautilus Open Terminal
  • Nautilus SendTo
  • Nautilus Terminal
  • Seahorse Nautilus
  • Sushi
  • TortoiseHg Nautilus
  • Tracker Nautilus Plugin

Keyboard Shortcuts

  • F3 = Extra pane
  • F4 = Terminal window (Nautilus Terminal)
  • F6 = Switch panels
  • F9 = toggle sidebar
  • Ctrl+1..3 = view (Icons, Compact, List)
  • Ctrl+T = New tab
  • Ctrl+PgUp (or PgDn) = browse tabs
  • Alt+1..n = browse tabs by number
  • Ctrl+F = search

At first I was not sure what the extra pane was used for. I prefered using tabs. Panel, however, is a completely new panel view that can have its own tabs. This allows a setup pretty similar to Total Commander (and the likes). Nautilus supports Copy and Move to the Other Panel commands, which is very convenient. This is one of the things I *loved* in Total Commander and was missing in Windows Explorer.

Vice, Commodore 64 Emulator on Linux

A night of fun and nostalgia - playing with Vice, Commodore emulator on Linux. Available as a package simply named "vice" in official Fedora repository, 5.8 MB in size, is a relatively quick download.

Some useful settings on modern screens would be to increase the size of the display by using Settings -> Vic-II Settings -> Double Size; or use Alt+D to turn on Full Screen mode altogether. To enable Full Screen mode, I had to switch Settings -> VIC-II setting -> Fullscreen settings -> Fullscreen device to VidMode instead of XRandR.

Then, going through the list of repositories of C64 games and programs listed earlier, searching for more online and adjusting the list. Hoping to find some of the old hits. Finding Elite, Le Mans, Infiltrator, Laser Squad, Usagi Yojimbo.

Wednesday, May 23, 2012

Running Google Earth on Fedora 17 x86_64

Today I've filed a bug report for an error trying to update redhat-lsb package (link). As a result of the latest changes, I had to uninstall "redhat-lsb.i686" package from my system.

Then I identified the cause for having this package installed in the first place. Trying to run Google Earth resulted in the message:

/usr/bin/google-earth: ./googleearth-bin: /lib/ld-lsb.so.3: bad ELF interpreter: No such file or directory

This package I had installed earlier in order to enable Google Earth to run on a 64-bit system. This was done following the advice in article Google Earth in 64-bit Linux (Fedora, Ubuntu).

Now, after installing latest lsb packages it was not possible anymore to install redhat-lsb.i686 package on Fedora 17 x86_64. Fortunately, I found an old bug report that also contains an extremely convenient workaround - LSB symbolic link (/lib/ld-lsb.so.3) is missing in x86_64 version redhat-lsb package.

Simply creating a symbolic link in /lib with

ln -s ld-linux.so.2 ld-lsb.so.3

will enable 32-bit applications to use the library and, in result, Google Earth will run without any problems on a 64-bit system.

Themes in Gnome

So I have decided it is about time to get rid of the large title bar on top of the windows in Gnome 3.4 (Fedora 17 #linux) and looked into customization options. The components I found can be customized are:
  • window look
  • icons
  • cursors

Where to find?

Gnome-look.org site contains lots of theme packages for any of the above components. Apart from these, there's lots of other Linux/Gnome components that can be customized, like Nautilus, GDM, and so on.

How to install?

Installation is quite simple. Once a theme is downloaded in .tar.gz format, unpack the directory from the archive into an appropriate location.
  • Window themes are to be found in /usr/share/themes.
  • Icons and mouse cursors are in /usr/share/icons.
The above locations are used as a shared location for all users. If you want to install a theme only for yourself then place the themes in an appropriate directory within your home location. Icons themes, for example, are found in ~/.icons/ and window/GTK themes are in ~/.themes/.
Once installed, these will be available through Gnome Tweak Tool or, in Cinnamon, through Theme settings.

My Favorites

My current favorites are listed below:
  • Window: Adwaita Cupertino (link)
  • Icons: Faience (link)
  • Cursors: Aero Mouse Cursors with Drop Shadow (link)

Tuesday, May 22, 2012

NPM Registry - node.js plugins

There are many plugins written for Node.js so far. They can be downloaded using NPM (node package manager). At NPM Registry you can see which packages are most popular. 

Packages can contain MVC frameworks, languages, modules for communication with data servers, etc.

http://search.npmjs.org/

Debugger Canvas for Visual Studio

A great add-on for Visual Studio: Debugger Canvas. Visual debugger, allowing you to visualize the whole code path being debugged, with all the related variables. It displays only the functions being stepped-through, not the whole content of the class or the code file the function belongs to. In their own words:

Debugger Canvas is a new user experience for the debugger in Visual Studio Ultimate. It pulls together the code you’re exploring onto a single pan-and-zoom display. As you hit breakpoints or step into code, Debugger Canvas shows just the methods that you’re debugging, with call lines and local variables, to help you see the bigger picture.

(link)

Wine Virtual Desktop from the Command Line

Some programs, when run with Wine under Linux, are next to useless when run without Virtual Desktop emulated by Wine. This usually happens when programs have dialog boxes, like Open File, displayed beside the main program window. In such a case, turning on the Virtual Desktop option in Wine solves these issues and the dialog boxes are displayed properly. 

Unfortunately, there is no option to instruct Wine to use Virtual Desktop when run from the command line. There was (is?) an option for older versions of Wine, using "wine explore /desktop=default,1280x1024 <program.exe>" but this does not seem to work when run under Wine 1.5.3 that I have.

The good news is that there is a workaround available. You can use q4wine. Create a shortcut in there, setting all the properties as desired. There you can specify which Wine prefix to use and whether to use Virtual Desktop or not. Then, you can right-click the created shortcut, select Copy to Clipboard -> q4wine-cli cmd, and it will copy something like

/usr/bin/q4wine-cli  -p "Quicken" -i "Quicken"

to clipboard. You can use this as an Exec line in the .desktop shortcut file that you can create in Gnome, for example. It will run the shortcut you created with the Virtual Desktop setting. This can be used for multiple purposes but I need it mostly in order to run Quicken, which prompts the user for certain input entries and confirmations on startup.

Monday, May 21, 2012

WebDAV in Linux

WebDAV protocol is supported by main file managers in Linux (Fedora): Nautilus and Dolphin.

In Nautilus, you would go to File -> Connect to Server and then fill out the server details, or type in "davs://" and the server address.

In Dolphin, you would use "webdavs://" plus the server location.

In the examples above, I've used Secure WebDAV, which uses SSL (HTTPS) protocol. To use WebDAV over HTTP just omit the 's' at the end and use "dav://" or "webdav://" as protocol.

There are also other tools, like WebDAV Sync. Download from here and check Manual for usage instructions.

Thursday, May 17, 2012

'Low Space' on Samsung Galaxy S

Using CyanogenMod 9 Android ROM on Samsung Galaxy S, lately I ran more often into the "Low space on device" message. The message was a bit confusing for an ordinary user because all the logical components were mostly empty. Those standard ones were:
  1. phone memory
  2. internal SD card
  3. external SD card
However, the things are a bit trickier than they seem at first glance. The devs of CyanogenMod used fast memory component in the phone to store application data (databases and configuration files mostly) onto it, effectively improving the system performance because reading these files was now much faster than on stock Samsung ROM. The stock ROM simply used the internal phone memory (2GB in size) to store all these files. In comparison to CM9 such a system would run extremely slow.
The drawback to the above approach is that the fast partition, where /datadata is stored, is only 170MB in size. Quite a few applications do not pay much attention where and how they store their files so this partition fills up pretty quickly. At first it was quite difficult to even understand how to see what has filled up. You can check the size and free space by using DiskUsage application and selecting /datadata as the location to be analyzed.
Some people recommended moving applications to SD card. This, however, does not solve anything in this case because it moves files from internal phone's 2GB partition to the SD card. But my 2GB partition was already 80% empty. Not knowing what was going on initially, I even used Titanium Backup to move some system applications to SD card. What a waste of effort.
The background information was scattered in different forum posts. A very useful one is here. That one contains a script that, if run on boot, would move all the files from /datadata to /data/data (from 170MB partition to 2GB partition) and then moves only the files that are *both* read and written into, back onto the fast /datadata partition. It creates symbolic links on the slow partition to these configuration files and databases, improving their performance. The /data location (being on 2GB partition) has good-enough read performance so libraries and other static files that are moved to /data/data still perform well.
This would be a great solution, only if it worked. I flashed the package into my Galaxy S, rebooted phone a few times but found out that /data/data was still a symbolic link to /datadata and all the files were still on the /datadata partition. As a result of running the script, /data/data was supposed to be converted to a real directory, with only the 'database' and a few other directories moved to /datadata. However, this was not the case.
So, knowing enough background information, and being encouraged to take things into my own hands by this post, I used Root Explorer to solve the problem:
  1. create /data/data_alen directory on 2GB partition,
  2. manually move iGo's whole directory (com.navngo.igo.javaclient) to /data/data_alen
  3. create symlink to com.navngo.igo.javaclient in /datadata
This was the simplest workaround that removed about 20MB from /datadata, freeing enough space for system to run for some time in the future. The apps that are clogging the system the most are browsers Google Chrome and Mozilla Firefox Aurora, with their cache. However, since I'm using these for testing and often, I prefer to keep them on the fast partition. Less used space hogs, like Google+ can, like iGo, be completely moved to /data partition.

Edit 2012-07-24: After installing new CyanogenMod, the applications for which the data was moved to a different partition would force-close. I tried a few things, like restoring the data with Titanium Backup and moving it back-and-forth with Total Commander, but that did not work. What worked was reinstalling the application (or restoring the data with Titanium Backup) and moving the data to the large partition and creating symlink to it with Root Explorer.
I haven't experimented much since this seems to work. The "low space" is handled for the moment. When it comes back I'll post back the findings of further experiments.

Wednesday, May 16, 2012

Python Development on Windows

Here I will summarize some useful links for Python development in Windows. Also check my page about Python in Dev Knowledge Base (link).
There are other posts in this blog that relate to Python. They can be found using the search box at the top of the page. I will link to useful ones here.

Development Environment

  • GUI Programming (link)
  • Boa Constructor (link)
  • WxGlade GUI designer (link)

Windows

For Windows, actually .Net platform, there is Iron Python project (link).

Other

Friday, May 11, 2012

Changing default system language in Fedora 17 Gnome

To change the default system language, use 

system-config-language

In case you don't have it installed, simply install the package with the same name.

Once changed, the settings apply when you log in the next time.

Application Shortcuts in Gnome

#linux, Fedora 17, Gnome 3.4

To create application shortcuts in Gnome, simply create a .desktop file in 

/home/<user>/.local/share/applications/

and they will become visible in the Applications menu or in application search. To get a sample, get one of the existing files or check the reference page below for the basic options.

References: Desktop Entry Files (link)

Fedora 17 Installation Checklist

Quick notes on Linux installation.

 

- Create Live USB drive.

- Run off the Live USB drive. Use Install to Hard Disk option.

- set Terminal window transparency and color scheme.

- install yum extension (yum-local, downloadonly, fastestmirror, priorities)

- Install apper (+KDE)

- install dolphin

- install Mono

- install Yakuake

- install workrave

- install Google Chrome and set up Chrome custom user agent (blog)

- install conky

- install nethogs

- set up KeePass with Mono, install xdotool

- install gnome extensions online

- install gnome-tweak-tool, add minimize to window context menu

- install mouse cursors

- install rainlendar (requires SDL)

- set startup apps using gnome-session-properties (rainlendar, conky, workrave)

- install lvm tools (system-config-lvm) and kde-partitionmanager

- install beyond compare

- add rpmfusion repositories

- install netactview

- install feh and set rotating desktop wallpapers

- unpack google appengine

- install google earth (redhat-lsb.i686, mesa-libGL.i686)

- install codecs for Totem movie player (ff...)

- sync Firefox

- install Adobe Flash plugin

- install download manager (gwget)

- install dropbox: download nautilus package, download daemon manually.

- install vlc

- install media codecs (mp3, mp4, ogg) - http://fedoraproject.org/wiki/Multimedia, http://ask.fedoraproject.org/question/1145/what-plugins-required-in-fedora-16-to-play-mp3 ( 'yum install gstreamer-{ffmpeg,plugins-{good,ugly,bad{,-free,-nonfree}}}' )

- install boost, boost-devel

- install git

- install skype (alsa-lib.i686 libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686)

- install banshee

- install p7zip, p7zip-plugins

- install Wine.i686 + q4wine 

- download winetricks, install cabextract, samba-winbind, libmpg123

- install freemind

 

ToDo:

*****

- install libreoffice

- install @kde

- install vmware

- backup app startup scripts & settings (conkyrc, shell scripts, wine)

- set up app shortcuts in /usr/local/share/applications/

- install Netvisualize Favorites under wine

 

Package locations: 

http://dl.fedoraproject.org/pub/fedora/linux/development/17/x86_64/os/Packages/

Wednesday, May 09, 2012

Gnome buttons on the titlebar

If you are missing Minimize and Maximize buttons in the window titlebar in Gnome 3, just install gnome-tweak-tool and go to Shell -> Arrangements of buttons on the titlebar, and set the value to All.

#linux

Source

Document Viewer for Linux

The best document viewer for Linux I found is Okular. It reads PDF, CHM, and mobile formats.

Installing Linux Dropbox on a slow connection

Default Dropbox installation includes downloading and installing Nautilus extension first. It will add Dropbox icon/application link. When this is run for the first time, it will download and install proprietary daemon. However, on a slow link this download often fails if I use the connection for parallel downloads. Running it again will not continue the download but will download again from the start.

To download the daemon manually, we can run the following command:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

Note that I'm using 64-bit version in the link above. Official instructions are available here.

Media Players on Linux

After a brief research into what to use as a media player(s) in #linux, I settled with three players:

  • Totem Movie Player as a fast-startup default player for audio and video
  • Banshee player for music, with playlists and library
  • VLC as a backup video player

Fedora 17: [Errno -1] Metadata file does not match checksum

Running updates for Fedora 17 on a slow connection and after I reset the repositories, I started getting the above error. I assume the reason is that the mirrors that get selected for the download of repolist.xml and the database are different and, hence, the database hash does not match the one in the repolist.
To solve this, I'm using dl.fedoraproject.org as the primary URL for the fedora repository until the repolist and the database are downloaded.
If you get the above message try "yum clean all" although some mention that "yum clean metadata" should be enough. Then, in the fedora.repo, comment the line for mirrors and add a new line for the baseurl and add a desired mirror URL. I went straight to the source, with:
baseurl=http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basearch/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
After the database is downloaded, I enabled the mirrorlist line and disable the baseurl so the updates continue as usual.

Tuesday, May 08, 2012

Installing Skype on 64-bit Linux (Fedora 17)

Since Skype is a 32-bit application, it requires 32-bit libraries to be installed on the system in order to run.
First I installed Autoplus and followed the instructions here.

That did not fully work so I went and installed the dependencies one by one, as per Skype Dependencies.

It turned out that some of these dependencies simply needed an update to be downloaded and installed first. After that a 32-bit version installed without problems and then everything worked.

The one-line command that installs all the required dependencies is:

yum install alsa-lib.i686 libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686

Monday, May 07, 2012

LibreOffice (OpenOffice/StarOffice)

After Oracle brought chaos into Open Source world, a number of projects got renamed. Version of OpenOffice that branched off is named LibreOffice (link). Windows version is available for download, while Linux version is installed by default by a number of distributions.

The same way Jenkins (CI) grew out of Hudson project.

Windows 7 Service Pack 1 Preparation

Installing Service Pack 1 for Windows 7 is proving to be a nuissance. Especially when considering that there are no major updates contained in case you've been installing the updates regularly.
Google Chrome in Windows is having an issue where it can not open sites via SSL (https). This has been quickly patched in stable versions because of publicity. However, the issue still exists in development channel. One way to get rid of it is to install Service Pack 1 for Windows 7.
While I had the offline installation of SP1, I was getting the dreadful error 0x8007000d (link) and had to install a whole bunch of other things first. Here's the list. (from Steps to follow before installing Windows 7 Service Pack 1, link)
  • Windows Update Readiness Tool (300+ MB)
  • KB2533552
  • KB2454826
  • KB2534366
These need to be downloaded and installed manually if you are using an offline installer for the SP 1. As noted in the instructions - "... these updates are not automatically installed when you install the service pack from the Microsoft Download Center").
Apart from these, I also did not have the option to install SP1 from Windows Update (described here - link). Running the readiness tool did not change anything.
In the end, I had to run the online installer, which did the magic behind the scenes and installed about 80 MB of updates.