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)