Friday, March 29, 2013

Workaround IE Class/Style Sticking Bug

In my click event handler for a tr element, I'm toggling the class with jQuery, but in IE 7,8,9, and 10 the style of the class doesn't get removed until I click a different row.  I fixed it by prepending a space (' ') to the tr content after calling toggleClass.

Javascript Dates and Internet Explorer

Internet Explorer 8,9, and 10 all handle dates differently.  Here's an illustration of that:

Thursday, March 28, 2013

Copy VMs from one ESXi host directly to another

I found out today that esxi's firewall prevents outgoing ssh by default.  It was blocking my scp attempts.  Once I turned it off (vsphere client->host->configuration->security profile->firewall properties, check the ssh client box and hit ok), it was a simple matter to clone the one host to the other by enabling ssh on both, logging on as root to the target machine, and running

scp -r root@sourcehost:/vmfs/volumes/datastore1/* /vmfs/volumes/datastore1/

And that cloned all the VMs.  Change the firewall back when you're done and all that's left is registering them with esxi and dealing with any guest OS license/SID issues.  If you use the vmware ovftool, it will be faster (my observation, not based on real benchmarking) and automatically register your vm with the target host, but you have to leave the machine running the ovftool running and connected to your network or the process will die.  Also, no wildcards with the ovftool so you have to do the VMs one by one.

Wednesday, March 27, 2013

Monday, March 25, 2013

OSS Endpoint Manager + Polycom 501 LineKeys Fix

Using OSS Endpoint manager and our polycom phones, I could not get any lineKeys settings to propagate to the generated _reg.cfg files.  I could edit the files after they were generated and reload the phones just fine, but if I made any changes in the freepbx gui, my changes would just be overwritten.  So, under Connectivity->OSS Endpoint Template Manager, I created a new template that was a clone of the polycom 501 templates.  I edited my template (clicked the pencil), then I edited $mac_reg.cfg and changed line 33 from:
on the assumption that $lineKeys just wasn't being defined no matter what you enter in the GUI.  After that, I regenerated the config for all of my phones and rebooted them all because I like hearing that beeping sound go all the way through our offices and it worked fine.

Next up is removing all the config that doesn't apply to the 500 series phones since they are taking like 8 times longer to boot up now than they did with trixbox.

Wednesday, March 20, 2013

Json Serialization Bug in .NET w/ Json.NET

I tried to conditionally serialize an object to Json using the ShouldSerialize function method described here.  It didn't work because I defined the ShouldSerialize functions as members of a child class and the reflection code is using only the DeclaringType to look up the ShouldSerialize methods.  Using a ContractResolver worked around the bug.

Friday, March 08, 2013

Fun with PBX

Working on a new pbxinaflash experimental vm to replace trixbox.  So far I've learned that I know way less than I thought I did and trixbox and freepbx are miles apart.  Also, pbxinaflash and incrediblepbx are related, but different.  Also I have no idea whether to use pbiaf-purple or piaf-green.  The main difference appears to be 32 vs 64 bit.  More bits is better, I guess, and it would get me incredible pbx 11 instead of 10 to use the 64 bit version.  It might be worthwhile to at least try out YATE while I have a little time . . . .