Tips & Tricks : Add Sublime Text to right-click menu in Windows


To make using Sublime Text 3 more convenient, you can add this to right-click context menu.

It will simplify ability to open any file and/or folder with Sublime Text right from Windows Explorer.

@echo off
SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe

rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"         /t REG_SZ /v "" /d "Open with Sublime Text 3"   /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f

rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"         /t REG_SZ /v "" /d "Open with Sublime Text 3"   /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f

Tips & Tricks : Remove Event Log Source


To remove Event Log Source use this:

Remove-EventLog -Source "Desktop Window Manager"
Replace Desktop Window Manager with Event Log Source you want to remove.

Code snippets : Adobe Flex : Open file dialog


So, I’m doing my first attempts to write some simple apps in Adobe Flex using Flash Builder 4.6. One of funny things I came across was how to generate open file dialog windows and get name of the file which user picked from dialog windows. I guess still have to get used to specific way Flex applications are developed.

Here is quick code snippet of the tiny application which allows to open file dialog box and pick file. File dialog window will be OS specific.



How-to : L2L IPsec VPN between Cisco ISR 2811 and DrayTek Vigor 2850n


Whole idea for that article came from real environment. At home I have DrayTek Vigor 2850n as my broadband router (and in fact it is really nice piece of equipment). Same time I’m using some Cisco equipment located in remote Lab for testing purposes. Remote Lab is connected to Intrenet and before to get access to devices and systems located there I was using EzVPN. However, as Lab has Cisco ISR as main router I thought, why not to establish L2L IPsec between my home network and remote Lab. Now, question how to do that. I have DrayTek on one end and Cisco ISR on the other. After few attempts, mis-configurations and troubleshooting it did work quite well in fact. So, here it is.

Here is what needs to be achieved:

Equipment available:

  • Cisco ISR 2811 – on the left side of the diagram – internal network
  • DrayTek Vigor 2850n – on the right side of the diagram – internal network


  • Establish IPsec VPN Tunnel between Cisco and DrayTek to make communication available between and



Tips & Tricks : SQL Server “Cannot connect to WMI provider”


Recently I had issue which occured without any particular reason on SQL Server 2012. All of the sudden I start getting error message:

Cannot connect to WMI provider. You do not have permission or the server is
Note that you can only manage SQL Server 2005 servers with SQL
Server Configuration Manager.
Invalid Namespace.

when tried to run SQL Server Configuration Tools.

What resolved situation is command:

mofcomp C:\Program Files\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof

Config snippets : Activating Windows Server 2012 Core


As there is no GUI in Windows Server 2012 Core, we have to use command line and script in order to acivate system.

slmgr.vbs is a VBscript which allows to set product key and activate operating system. Below most common use of slmgr.vbs.

Set product key


Activate Windows

slmgr.vbs /ato

Display information about licenses

slmgr.vbs /dli
slmgr.vbs /dlv

How-To : openSUSE & keepalived for Firewall HA


Current expectations from all type of systems and services is to be available without any disruption. One of mission critical systems is gateway/firewall. Of course you can use multiple products available on the market. One of them is openSUSE, which is perfect to act as gateway/firewall between Internet and production systems. So, how to provide redundancy for openSUSE and same time be able to keep it up-to-date without any disruption for production systems?

openSUSE 13.2 with keepalived provides all technology required to make your firewall high-available.

Here is diagram of Lab created to configure and test openSUSE with keepalived:



How-to : Enable SSH on Cisco Nexus 1000v


In order to enable SSH access to Cisco Nexus 1000v (if it’s not enabled yet) followign commands have to be issues from Console or Telnet connection:

Nexus 1000v Switch
login: admin
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2012, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under
license. Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or the GNU
Lesser General Public License (LGPL) Version 2.1. A copy of each
such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
nexus1000v# conf t
Enter configuration commands, one per line.  End with CNTL/Z.
nexus1000v(config)# ssh key rsa 2048 force
deleting old rsa key.....
generating rsa key(2048 bits).....
generated rsa key
nexus1000v(config)# ssh server enable

Now you can use SecureCRT or PuTTY to connect to Cisco Nexus vis SSH of course if IP address is configured on the device and it is connected to network 🙂


Tips & Tricks : Session log files in SecureCRT


I use SecureCRT quite often to access Linux systems as well as network devices.

When going through one of the presentations on SecureCRT web page I found handy tip how to configure session logs to have it divided by date, time and session.

Screenshot below demonstrates settings for log file:

SecureCRT Log File configuration

Basically parameters are set to:

  • Log file name: %Y-%M-%D–%h-%m-%s.%t__%S(%H).txt
  • Options / Start log upon connect: checked
  • Custom log data / On each line: %h:%m:%s(%t):

These settings will create separate log file for each session every time connection will be established.

In addition to that each line will start with timestamp added by SecureCRT.


Code snippets : Exchange Server : Count messages submitted by user


In some companies performance is measured based on number of emails someone sent. regardless the reason for those emails and content, what matters the most is if someone is sending something to others. So, I was asked to produce quick count how many emails one individual sent.

Here is quick PowerShell command which I ran on Exchange 2007 Mailbox server to find requested number: