PFSense on OVH VM

  1. Create a virtual MAC for the failover IP in OVH Manager
  2. Add an additional switch to VMware
  3. Create a VM for pfSense (FreeBSD 64bits), add 2 nics, one connected to each switch (WAN and LAN)
  4. Set the VM’s WAN adapter MAC address to the OVH virtual MAC created on step1
  5. Install pfSense using the LiveCD
  6. Add both NIC’s in pfSense. WAN should be em0 and LAN will be em1
  7. Once pfSense is booted, set the WAN IP
  8. Choose option 8) Shell
    1. route add -net x.x.x.254/32 -iface em0
    2. route add default x.x.x.254
    3. ** WHERE x.x.x is the IP address of the VMWare HOST
    4. Ping (if this doesn’t work, review previous steps)
  9. In another VM which has as NIC on LAN and IP in 192.168.1.x, goto
    1. admin:pfsense
  10. In Firewall > NAT, Outbound add a rule.
  11. Leave everything unchanged except Source Address: and add a description
  12. In Services > DHCP Server, LAN set the Gateway to
  13. Done (almost). You should now be able to ping the Internet from your VMs on the LAN

The routes added will clear themselves when the firewall is rebooted.  Here is how to make them permanent.

  • Install the package: System > Packages, Shellcmd
  • Services > Shellcmd and add the commands you ran in 8-a. and 8-b.
  • Reboot and you should be good!

Optionally but suggested, install Open-VM Vmware tools

  • System > Packages, Open-VM-Tools
  • Reboot

Writing to windows event log and fixing “the description for event id cannot be found”

When developing a .Net application and trying to write to the eventlog, the actual message in the event log might contain:

The description for event id 0 cannot be found

This is usually due to the registry key HKLM\SYSTEM\CurrentControlSet\services\eventlog\[myLog]\[mySource]\EventMessageFile not being correctly set or not set at all.

In my case, the application was running with insufficient permissions to write that value.  Changing the key permissions to my username fixed that issue.  Running the application with administrative privileges should also do the job.  This is on a development computer, if that happens on production/user computers, this key should probably be created at installation.

Sample code to write to the event log

string sSource="Debugging";
string message="Test";

if (!System.Diagnostics.EventLog.SourceExists(sSource)) 
 System.Diagnostics.EventLog.CreateEventSource(sSource, "MyLog");

System.Diagnostics.EventLog.WriteEntry(sSource, message, System.Diagnostics.EventLogEntryType.Warning);

Access a VMFS drive under windows

Here is a procedure how to access a hard drive formatted in VMWare’s VMFS file system from Windows. This could be handy if an ESXi host crashes, if a hard drive fails or for digital forensics.

1- Download VMFS driver :
2- Unzip it to a path-friendly location (C:\vmfs)
3- Make sure java.exe is in your PATH environment variable, if not, add it.
4- Test-run fvmfs.jar by typing in administrator command prompt:
cd \vmfs
java -jar fvmfs.jar

5- Connect the external drive to your computer and check its disk number in Windows Disk Management. Disk 1 will be named \\.\PhysicalDrive1 in vmfs

6- Check if we can access the disk

java -jar fvmfs.jar  \\.\PhysicalDrive1 info

7- Share using webdav

java -jar fvmfs.jar \\.\PhysicalDrive1 webdav

8- Make sure the webclient service is running

9- Mount the drive

net use * http://localhost:50080/vmfs

10- Your drive should now be mounted as a standard windows drive.

This driver gives you read-only access to the file system.

Plesk users passwords

If you need to get your Plesk users’s password, the information is stored in a database named psa and in a table named accounts.  The passwords are not hashed, they are only stored as BLOBs in Plesk 10 or later (previous versions were clear text) so a simple CONVERT can list them.

Start mysql and prompt for password.  Then select database to use.

mysql -p
mysql> use psa

Run the query (Plesk 10)

CONCAT(m.mail_name,"@", AS email_address,
CONVERT(a.password USING utf8) AS password
FROM mail m
LEFT OUTER JOIN domains d on

Optionally, you can add the following search criteria

WHERE IN ('','')


OpenVZ / Proxmox – How to share folders between VMs or between Host and VM


  • This must be run on hardware node (host)
  • Replace 102 with your container ID (Id of virtual machine)
  • Create /common-stuff folder in VM before restarting
 vi /etc/vz/conf/102.mount


source /etc/vz/vz.conf
source ${VE_CONFFILE}
mount -n --bind /common-stuff ${VE_ROOT}/common-stuff
 chmod +x /etc/vz/conf/102.mount

Restart VM


BizTalk and OAGIS xsd – building Component_Schemas

I tried following this procedure to use OAGI schema in BizTalk and got a few problems so here are the solutions.

Problem #1
On build of project Component_Schemas:

Error: Node “<Schema>” – This schema file has a TypeName that collides with the RootNode TypeName of one of its root nodes.

Solution #1
For all errors, select the “<Schema>” node and change the RootNode TypeName property to something unique.  What I did was to add the folder name to the current TypeName.

Problem #2
On build of project Component_Schemas:

Error: The type or namespace name ‘SerializableAttribute’ does not exist in the namespace ‘ProjectName.System’.
Error: The type or namespace name ‘NonSerializedAttribute’ does not exist in the namespace ‘ProjectName.System’.

Solution #2
According to this article on Microsoft’s website, the problem happens because some xsd files are stored is a folder named “System”. Sadly for us, OAGIS uses a folder structure with a folder named system.

  1. In Solution Explorer, expand “System” folder.
  2. Click each file in the System folder and in any subfolders, and then change the namespace entry in the Properties window so that any occurrence of System becomes _System. For example, change the MyProject.System.SubFolder namespace to the MyProject._System.Subfolder namespace.


Remote Desktop Session automatic logoff on Windows 2008 R2

This is another annoying setting in Windows 2008 R2, especially when a virtual machine is used for development.  To deactivate the automatic logoff of a disconnected session in Windows Server 2008 R2…

  1. Go to Administrative Tools > Remote Desktop Services > Remote Desktop Session Host Configuration
  2. Select top left node (RD Session Host Configuration)
  3. In the middle window, right-click on RDP-Tcp and click Properties
  4. On the Sessions tab, change the End a disconnected session to the wanted value.

SharePoint 2010 – fix changing computer name

If you have a SharePoint installation and for some reason you changed the name of the machine on which the SQLServer instance is running, SharePoint won’t be able to connect to the database server anymore. The reason is because SharePoint stores the computer name (netbios name) in many places in its configuration database.  In order to fix this issue, you must reconfigure SharePoint to let it know the new SQL Server location.

On my developer machine (Windows 7), I installed SharePoint as suggested by Microsoft for developer computers so this creates a separate instance for SharePoint on the local SQL Server.  It is not required to enter the instance name when you configure the server, only the computer name will be enough.

The following steps are based on Pinal Dave’s procedure he posted on his blog: Great blog by the way, go take a look!

1- Start SharePoint 2010 Management Shell (Run as administrator)

2- Run the following command:

stsadm -o setconfigdb -databaseserver myComputer -farmuser myDomain\myUser -farmpassword myPassword

NOTE: This might take several minutes to complete.

3- Go into Internet Information Services Manager

4- Remove the SharePoint Central Administration v4 site. It will be re-created automatically later.

5- Run the SharePoint 2010 Products Configuration Wizard

6- Click Next > on the Welcome Screen.  NOTE: You might need to run the SharePoint Configuration Wizard twice if the removed administration site is not created the first time.

7- You’re done, you should now be able to connect to your SharePoint Central Administration website.

Next time you configure your SharePoint server, do it with database aliases instead of server names.

SSRS report execution time

This query will list the 100 reports that took the longest time to run today.

You must be connected to the SSRS engine, not the database engine.

use [ReportServer]
select top 100 
datediff(s,EL.TimeStart,EL.TimeEnd) as 'Runtime(secs)',
C.Name, EL.Status, EL.Username, EL.TimeStart, EL.TimeEnd, 
EL.TimeDataRetrieval/1000 as TimeDataRetrieval, --Time it took to get the data from the datasource
EL.TimeProcessing/1000 as TimeProcessing, --Time it took to group, filter, aggregate and subreport
EL.TimeRendering/1000 as TimeRendering, --Time it took to render, page, expression evaluation
(EL.TimeDataRetrieval + EL.TimeProcessing + EL.TimeRendering)/1000 as TotalRunTime,
C.Path, EL.Parameters
from dbo.ExecutionLog EL
Inner Join dbo.Catalog C on EL.ReportID=C.ItemID AND C.type=2 --Type=Report
where EL.TimeStart >= DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) --Today
order by 'Runtime(secs)' desc