Wednesday, February 4, 2015

Amazon SDK Samples Target Framework, Reference Mismatch

Quick Description:  After installing the Amazon SDK for .NET, a Visual Studio (in this case 2010) solution from one of the samples doesn't recognize the reference for AWSSDK.  All usage of the namespace in the project's code generate 'type or namespace name 'Amazon' could not be found' errors.

Problem:  In this case, it was caused by a mismatch between the reference dll version and the project target framework version.  I'm just not really sure which dll the (AWSSDKAndSamples_2.3.18.0) are targeting by default, because I tested on both a 3.5 machine and a 4.5 machine, and while both came up targeting 3.5, the .dll was mismatched on both.  I brought the S3 sample up targeting both 3.5 and 4.x and in both cases, had to remove the existing reference and add the correct one for the target version.

To solve the problem, make sure both the Reference and the target Framework are the same version.  Logically, this should already be the case with the sample. 

To check your Target framework, right click your project, and under Target framework, select either 3.5 or 4.x.

To add a new reference to the right framework (adding the reference appears to be the clincher, switching between target framework versions didn't help me).  Right click references, select Add Reference and browse for AWSSDK.dll.  If you chose a default install the .dll is in C:\Program Files (x86)\AWS SDK for .NET\bin\Net35 or Net45.

Monday, January 6, 2014

How to install a wildcard certificate on Dell DRAC

This does not seem to be well documented, but I have tested this procedure on RAC/DRAC/iDRAC 6 and 7 with Internet Explorer (versions 6,8,11), Firefox (version 26 Windows and Linux), Chrome (version 32 Windows and Linux).  The process used an Entrust wildcard certificate.

  1. Obtain a wild card certificate, intermediate certificates (if any) and private key from a Certificate Authority (CA).
  2. Change the default key size on the DRAC using racadm -i config -g cfgRacSecurity -o cfgRacSecCsrKeySize 2048
  3. Upload your private key using racadm -i sslkeyupload -t 1 -f private.key
  4. Create a text file (yourfile.crt) that includes, in this order, your wildcard.crt, a Carriage Return Line Feed (CRLF) and your intermediate.crt.  Remove any other Carriage Returns (CR) except for the CRLF between certificates.  If you are performing this on Windows, you will probably need use something other than Notepad to succeed.
  5. Upload the text file you created using racadm -i sslcertupload -t 1 -f yourfile.crt

Firefox generally would not succeed without the intermediate certificate authorities, while Internet Explorer (and Chrome on Windows) would work without issue.

Monday, September 9, 2013

Oracle PL/SQL search for repeated substring

Short Description:  Query to find instances of a substring immediately repeated in a single string.

Description:  the query below finds a substring repeated immediately after the first.  My current example is searching username data for records for which the first and last name are the same.

trim(SUBSTR(USERNAME, INSTR(USERNAME, ' ', 1, 1)+1))= trim(substr(USERNAME, 1, instr(USERNAME,' ')))

SSIS 2012 Transfer Database task failure


Quick Description:  The SSIS 2012 Transfer Database task fails with error code 0x80131500 (An error occurred while transferring data)

Full Error:

Error: The Execute method on the task returned error code 0x80131500 (An error occurred while transferring data. See the inner exception for details.). The Execute method must succeed, and indicate the result using an "out" parameter.

There are multiple things to check here:

Check all the paths are correct in the destination database section of the task.  SSIS auto-populates this, but it isn't necessarily correct, and appears to just be the file locations of the source database.  If those path don't exist on the target server, it will fail.  See this thread for more information.

Check permissions to the data/log directories on the destination server for the machine account of the source server.


Verify you are not attempting to transfer from 2012 *to* an older version

Wednesday, August 7, 2013

Lotus SameTime doesn't start when launched

Short Description:  Attempting to launch Lotus Sametime results in the application being highlighted in the taskbar but not getting to the splash screen or subsequently launching.

Problem:  IM is way off topic for this blog, but this occasionally happens to me and is maddening.  In my case, TaskManager will show multiple copies of "rcplauncher.exe" are running but Sametime.exe is not.   It appears to be a copy of the file %APPDATA%\Lotus\Sametime\.rcp.lock is...well...locked and preventing the application from launching.

To fix step by step

  • Kill all instances of rcplauncher.exe
  • Remove the hidden attribute from %APPDATA%\Lotus\Sametime\.rcp.lock
  • delete or rename .rcp.lock (I'm not sure there are a lot of situations in which you would need to back up this file, but if you're concerned, back it up).

Or run this from command line/as a cmd file:

  • Taskkill /F /IM rcplauncher.exe (for earlier versions of windows kill.exe may be necessary instead of taskkill)
  • attrib -a -h %APPDATA%\Lotus\Sametime\.rcp.lock
  • del /q %APPDATA%\Lotus\Sametime\.rcp.lock
    • if the file isn't found and shows in explorer, check that the APPDATA environment variable is set correctly
      • "set |findstr APPDATA" should return
        • <users>\<your username>\AppData\Roaming

Tuesday, July 9, 2013

T-SQL: Underscores must be escaped in a like statement

Quick description:  a like statement with a string containing an underscore will return strange results.


This is just a quick note on an issue that caused me some pain today, when looking for a string not like '%string_%' , I was excluding everything containing the string plus subsequent characters.

This means that while I want to see Not like '%string_%' return values like 'string2' but not 'string_2', what I actually get is nothing.


Underscores have to be escaped in like statements.  The correct syntax is Not like '%string[_]%', this will return values like 'string2' but not 'string_2' 

For more information see Using Wildcard Characters As Literals (like)

Wednesday, May 22, 2013

Using VMware PowerCLI to get LLDP switch information

This script is based on a CDP version on VMware’s site. CDP is used by Cisco, but most other vendors use LLDP.  The LLDPinfo object is setup differently from the CDP object.  Hopefully this will save a lot of time clicking thru the GUI.

$vmh = Get-VMHost | sort
If ($vmh.State -eq "Connected")
  Get-View $vmh.ID | `
  % { $esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} | `
  % { foreach ($physnic in $_.NetworkInfo.Pnic) {
    $pnicInfo = $_.QueryNetworkHint($physnic.Device)
    foreach( $hint in $pnicInfo ){
      # Write-Host $esxname $physnic.Device
      if ( $hint.LLDPInfo ) {
        $results = New-Object –TypeName PSObject
        $results | Add-Member –MemberType NoteProperty –Name ESXHostName –Value $esxname
        $results | Add-Member –MemberType NoteProperty –Name DeviceName –Value $physnic.Device
        $results | Add-Member –MemberType NoteProperty –Name PortName –Value $hint.LldpInfo.Parameter[4].value
        $results | Add-Member –MemberType NoteProperty –Name SwitchName –Value $hint.LldpInfo.Parameter[6].value
        Write-Output $results