Testing Restful APIs with Curl

Ultra simple way to test a JSON API POST response using curl

Watch out for single quotes, they don’t pass well in windows

My Chocolatey list

You know what Chocolatey is, right?

 

Atmega328p at 3.3v

Venturing down the path of low voltage Atmega (Arduino)?  The following references the two steps (set your fuses and add a board entry) to allow you to use an off-the-shelf 328p “naked” and at very low voltage ranges (disabling brown-out).

If your 328 chip is using the default fuses (16 MHz external clock setup), run
the following avrdude commandline to re-write fuses. This disables
brown-out detection completely (allowing for low voltage thresholds), and sets to use the internal, 8MHz clock:

avrdude -c usbtiny -p m328p -B 1.0 -u -U lfuse:w:0xe2:m -U hfuse:w:0xd8:m -U efuse:w:0xff:m

Last but not least, add the following to your “boards” entry in the ArduinoIDE:

Copy File Contents to the Clipboard

Via right click (context menu) within Explorer, save the following to a .reg registry key file.

TortiseSVN’s Revision in as version number in .NET

From scavaging the around the web, I pieced together the follow steps to setup TortiseSVN’s revision number (aka subwcrev) and time stamp as part of the assembly version.

  1. Copy the existing Properties\AssemblyInfo.cs file to a file named AssemblyInfo.template
  2. Edit the file, changing to the following:
  3. Edit the Project properties, adding the following Pre-Build events:
  4. Build your code, and display the assembly version info with the following snippet:

Defrag All Harddrives

The version of defrag that comes with most recent installs of Windows does not allow for scheduling…to get around this limitation, the following VBScript will enumerate all fixed harddrives on a machine, and launch defrag via command like for that drive. Set it up as a scheduled task and forget about it.

Extract DER format x.509 public certificate from IIS 4 pfx

IIS 4 certificate files usually contain both the private key and public certificate for SSL. To convert these to RSA private key and x.509 public certificates from NET to DER format, you need to manually edit the binary key file as documented on Thawte’s site <http://www.thawte.com/html/SUPPORT/server/msiis4.html> then run the following OpenSSL commands:

Eck…no thanks. The Thawte site skips over pulling out the public certificate (yes, I know you could actual just get the certificate from within a browser, but do that for 50+ certificates). Anyways, the following perl script will located the magic hex number “30 82” followed closely by with the string certificate0, copy all the file from that point on to a tmp file, and then make a system call to OpenSSL (must be in your path on Windows platform) to convert it to x.509 formated. Example:

Where file1.key ect are the IIS4 pfx key files to extract the public crt in DER format. Get a copy of OpenSSL for Windows <http://gnuwin32.sourceforge.net/packages/openssl.htm>. Make sure to renamed the two dll files under the bin directory before running the script.