Posts

that new old thing: a date2num implementation in vb.net

Hell must be freezing over because I'm doing a lot more VB.NET development these days. Visual Studio 2013 and the .NET 4.5 framework are, in my opinion, the first usable versions of these products. As part of a project to port some of our legacy code from VB6 to VB.NET I've been converting all of the common functions and shared utility libraries we've built up over the years. Some libraries date back to the migration from QuickBasic/PDS 7 on DOS to Visual Basic on Windows. Back in those days we used very simple yet powerful functions to do things like date math accurately. For example, in the old days, programmers had to account for leap year manually, if they didn't have a good toolset on hand. One of those toolsets was called QuickPak, a library of handy functions written in Assembler that could be linked to your BASIC program to do these things accurately and easily. The function that sold systems -- our systems -- as being the most accurate product on the m...

Handy OpenSSL Commands

To convert a certificate from PEM to DER: openssl x509 -in cert.txt -inform PEM -out cert.bin -outform DER To convert a certificate from DER to PEM: openssl x509 -in cert.bin -inform DER -out cert.txt -outform PEM To convert a key from PEM to DER: openssl rsa -in key.txt -inform PEM -out key.bin -outform DER To convert a key from DER to PEM: openssl rsa -in key.bin -inform DER -out key.txt -outform PEM Convert a PEM+KEY to PKCS12: openssl pkcs12 -export -out client.pfx -inkey keyfile.txt -in cert.txt -certfile root.txt Extract Private Key from PKCS12: openssl pkcs12 -in client.pfx -nocerts -out keyfile.txt Extract Public Cert from PKCS12: openssl pkcs12 -in client.pfx -clcerts -nokeys -out cert.txt Remove Password from Private Key: openssl rsa -in keyfile.txt -out unpassworded.txt Generate a client key: openssl genrsa -out client.key 4096 Build a certificate request: openssl req -key client.key -new -out client.req Build a certificate request (advanced): openssl req -n...

Updating Firmware on legacy Dell Hardware in Ubuntu Linux

It took a bit of Google searching and hocus-pocus to figure out how to patch the BIOS rev A04 on our old Dell PowerEdge SC1420 Server. Here's the magic incantation. ############################################################ # Dell Firmware Update for Ubuntu Linux, on Legacy Hardware ############################################################ # Install firmware update tool out of the universe repository apt-get install firmware-addon-dell # Not sure if this is needed, I didn't need it, but it's documented modprobe dell_rbu # Dump a list of all device ids in the system bootstrap_firmware -a # open http://linux.dell.com/repo/firmware/bios-hdrs in a browser # search for IDs that appear in bootstrap_firmware output # In my case, the SC1420 is system_bios_ven_0x1028_dev_0x0173 wget http://linux.dell.com/repo/firmware/bios-hdrs/system_bios_ven_0x1028_dev_0x0173_version_a04/bios.hdr # Queue the new bios to be updated durning the next warm-boot dellBiosUpdate -u --force-mono -...

Using PowerShell To Get Citrix ICA Client Versions In Use On a XenApp 6 Farm

################################################# # XenApp 6 Client Version Retrieval Script # Created by Ben Piper # http://blog.benpiper.com, ben@benpiper.com ################################################# function convertToVersion($build) { switch($build){ 6685 {"13.0"; break}30 {"12.1"; break}6 {"12.0.3"; break}6410 {"12.0"; break}142{"Java"; break}317{"3.0"; break}324{"3.0"; break}330{"3.0"; break}349{"3.0"; break}304{"MAC 6.3"; break}314{"MAC 6.3"; break}323{"MAC 6.3"; break}326{"MAC 6.3"; break}400{"MAC 7.0"; break}402{"MAC 7.0"; break}405{"MAC 7.0"; break}406{"MAC 7.0"; break}407{"MAC 7.0"; break}402{"MAC 7.0"; break}411{"MAC 7.0"; break}500{"MAC 7.1"; break}600{"MAC 10.0"; break}601{"MAC 10.0"; break}581{"4.0"; break}606{"4.0"; ...

Citrix client version build list

''---------------------------------------------------------------------------------------------------- '' this routine converts citrix internal build numbers to actual client version numbers ''---------------------------------------------------------------------------------------------------- '' Sources -- '' '' http://forums.citrix.com/message.jspa?messageID=558285 '' http://support.citrix.com/article/CTX112613 ''---------------------------------------------------------------------------------------------------- '' Last Update: 2013-03-04 15:18 ''---------------------------------------------------------------------------------------------------- ShortVer = "": LongVer = "" Select Case session.ClientBuild Case 0: LongVer = "Disconnected": ShortVer = " " Case 1: LongVer = "12.1.44" Case 3: LongVer = "11.2.2" Case 6:...

PRB: Windows 8, MSXML4 Application Error 429: ActiveX component can't create object

Image
This article was previously published under MSXML4 WIN8 ELEVATION FAIL On This Page SYMPTOMS When you create an instance of an MSXML2.DomDocument40 in VB6 or VBSCRIPT (32-bit), you will receive the following error message: Application Error 429: ActiveX component can't create object The error only occurs if your process is running with elevated (administrator) privileges, on Windows 8.   CAUSE Microsoft broke this for some reason but chances are its an unmitigated security vulnerability.  (And, we like to be jerks). RESOLUTION To work around this problem, use either of the following methods: Downgrade to Windows 7, 2008, Vista, or XP Replace references to msxml4.dll with msxml6.dll  Replace MSXML2.DomDocument.4.0 with MSXML2.DomDocument.6.0 in your code STATUS This behavior is by design.  Or, maybe its a bug.  We really don't care, as long as you port your crappy VB6 code to .NET. MORE INFORMATION Steps to Reproduce Behavior Execute the following code in a compi...

Raising events in VB6 from .NET via COM Interop

Image
So I've been experimenting with VB6 and a .NET DLL compiled with COM interop to see how it behaves.  The results are a little surprising. What I did was I built a test scenario where the "Client" (vb6 app) hangs for 5 seconds while the "Server" (.NET COM object) fires an event once per second. First, I start the timer.  Inside the DLL on each timer tick, it adds 1 to an internal counter ("Count").  When the timer fires, it raises an event and passes the value of Count at that time as a parameter (nTicks). When the client app (vb6) hangs, internally the count continues to run, but the events get queued up.  VB6 gets all the events in a rush when the 5 second sleep is over.   Here's the part where it gets interesting.  During that rush, the events come in out-of-order .  The order seems random.  I've run it several times and the order always varies.  I circled the interesting part in red, below. Aside from the return order issue I think this th...