Sunday, April 28, 2013

Going fallback mode in Ubuntu 13.04 due to performance issues with Unity

I configured Virtualbox guest machine to run Ubuntu 13.04 (Raring Ringtail) but performance is just not acceptable. It probably has to do with my host machine not having a good enough graphics hardware.

Anyway, to make it bearable, I have gone Gnome Fallback mode. Anyway, below is my clean configuration from scratch to have a better performance running under VirtualBox.

Initial clean-up and pre-requisites, open terminal (Ctrl+Alt+T):
$: sudo apt-get update
$: sudo apt-get upgrade
$: sudo apt-get install gnome-session-fallback

Log out from session
$: gnome-session-quit
From the GDM, select Gnome Fallback(No effects), see below for screen capture.


Log back in to Ubuntu. To make it even better, install VirtualBox guest additions. But first let us install the pre-requisites and some clean-up.
$: apt-get purge xserver-xorg-video-vmware libxatracker1
$: apt-get install dkms build-essential

From VirtualBox Guest main UI, select Devices | Install Guest Additions....Hit on cancel for the window like below.
Now, install guest additions, like:
$: cd /media/timus/VBOXADDITIONS_4.2.12_84980
$: sudo ./VBoxLinuxAdditions.run 
$: sudo reboot

Of course you have to change folder location (with your username) and version based on your VirtualBox. After reboot, you have pretty good setup for daily use.


Vi Editor common keys

My commonly used vi shortcut keys:

CommandActionNotes
File operations
:qQuit VIThis will exit VI editor
:q!Force quitThis will exit VI editor even if buffers are dirty
:wSave current bufferSave currently active buffer
:bdKill current buffer
General
:set numberShow line number
:set nuShow line number
Text Operations
vStart Visual Mode(for copying)
yYank/copy selected text
yyCopy line
pPaste _after_ the current line
PPaste _before_ the current line
xDelete char under the cursor
dwDelete the word under the cursorThis will also delete the space after it
3dwDelete 3 wordsThis will also delete the space after it
ddDelete lineDeletes the entire line
Navigation
0Jump to beginning of line
$Jump to end of line
bMove to the beginning of the word
eMove to the end of the word
geJump to previous word ending
gEJump to previous word ending, ignore punctuation
ggStart of file
GEnd of file
21GGo to line 22
Search
/{string}{ENTER}Search for string
Merging
Note** run vimdiff file1 file2
]cJump to the next difference
[cJump to the previous difference
doCopy line diff from right buffer to the left buffer

Tutorials
VIM Introduction and Tutorial (link)
VI Cheat Sheet (link)
VIM Tips (link)
Code Merging with VIM (link)

Saturday, April 27, 2013

Check if package is installed in Ubuntu/Debian/Mint

Check if package dkms is installed:

$: dpkg -s dkms


Reference(s):
http://www.cyberciti.biz/faq/find-out-if-package-is-installed-in-linux/


Sunday, April 14, 2013

Delete files in a directory that is older than specified

Delete all files in C:\temp which was older than 04/14/2013.
c:\temp> forfiles /D -04/13/2013 -c "cmd /c rmdir /s /q @file"

Wednesday, April 10, 2013

The following add-ins could not be started MonoDevelop.GnomePlatform

Installing MonoDevelop in OpenSUSE 12.2 from its repository was very easy. When running it for the first time though I got the message:
The following add-ins could not be started:
The root of the trace shows
MonoDevelop.GnomePlatform,2.8
A quick search shows that MonoDevelop depends on libgnomeui. This should have been part of dependencies when installing the application but well....

Below is the screen shot of the error message.
References:
http://software.1713.n2.nabble.com/MonoDevelop-and-openSUSE-12-1-td7462957.html

[2013/04/09] - Same issue observed in OpenSUSE 12.3 and also the same fix.

Saturday, March 16, 2013

Using Coded UI library in VS2012 Express Windows Desktop

Pre-requisites:
  • Visual Studio 2012 Express Windows Desktop
  • Agents for Visual Studio 2012 Update 1 (link)
Steps:
  1. Install VS2012 Express Windows Desktop
  2. Install Test Agent from "Agents for Visual Studio 2012 Update 1
  3. Download a copy cuitemplate from https://apisamplecode.codeplex.com/. This link goes directly to the source location (link)
Sample code below uses ApplicationUnderTest class. For it to work, you need to reference the following assemblies:
  • C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\11.0\Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll
  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.TestTools.UITest.Extension.IE.Communication.Interop.dll
  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.TestTools.UITest.Framework.dll
  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.TestTools.UITest.Logging.dll
  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.TestTools.UITest.Playback.dll
  • C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.TestTools.UITesting.dll

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UITesting;

namespace cuitemplate
{
    class Program
    {
        static void Main(string[] args)
        {
            ApplicationUnderTest app;
            
            Playback.Initialize();
            app = ApplicationUnderTest.Launch(@"c:\windows\system32\notepad.exe");
            app.Close();
            app.Dispose();
            Playback.Cleanup();
        }
    }
}