Posts

Global SQL Procedure, System Objects and sp_ms_marksystemobject

You may come across a need to have a database of utils full of generic procedures which work on indvidual databases (say client databases). You can't pass the database name into the procedure as a parameter and say "use @dbname" in the procedure and dynamic sql sucks. One workaround is to create the procedure in the master database and then mark it as a system object. eg use [master] create procedure sp_doThis // note the sp_ prefix is required begin // etc etc end go exec sp_ms_marksystemobject 'sp_doThis' // second note, this procedure is undocumented, so I wouldn't be relying on this for life or death. use [myotherdb] exec sp_doThis go All done!

Design best practice for an image library

If the library holds data in a raw format (ie a big sized image), then can then make all sorts of algorithms out of that to produce images. Generate different sizes, eg 100x100, 200x400 or what ever is required from the original Generate different types of images, either by conversion (png etc) or type, maybe base 64 for CSS and separate style sheet images for non base64 supporting CSS (like IE8 etc) Overlay another graphic on top (like a sash or otherwise) to generate only 1 image that needs to be retrieved All of this requires the smarts that you allow the original image to have coordinates stored against it as to where the center is or maybe use something like  https://github.com/tapmodo/Jcrop to create and store these coordinates of the box sizes. I've found it quite useful when uploading images through custom application to write the files as (for example) full_raw.png (usually stored in a database somewhere) full100x100.png (resized, re scaled depending how ...

Nice Table sorter (Jquery)

Ok so there are quite a few out there, but I've never seen one which I've had to do absolutely no customization at all; well done https://editor.datatables.net/ . Very nice exporting to CSV, great sorting, great custom display and filtering (allowing tables to be summed up depending on what you filtered on). Honorable mention http://tablesorter.com/docs/ I used this for quite a while, but the datatables has the exports and filtering which I had to write an extension of for tablesorter.

Diffie-Hellman limit issues with java 1.7 and Connection Failure

Suppose calling a https url. Error is was returning: ErrorDetail    I/O Exception: peer not authenticated Filecontent    Connection Failure Mimetype    Unable to determine MIME type of file. Statuscode    Connection Failure. Status code unavailable. Debugging this ended up with with an error like so: javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair Added certificate of the URL to the cacerts file with keytool No luck Changed to unlimited strength like so http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html No luck Added this to JVM 1.7 config (not sure this is even supported) -Djdk.tls.ephemeralDHKeySize=2048 No luck Tried switching to JVM 1.8 config; -Djdk.tls.ephemeralDHKeySize=2048 No luck Added DH to in java.security disabledAlgorithms jdk.certpath.disabledAlgorithms=MD2 ,DH Bingo Given that Diffle-Hellman key exchange of 1024 can be possibly broken, this...

JVM 1.7 and Coldfusion and Connection Failure

A lot of connection failures were showing up due to servers upgrading their certificates to the latest and greatest versions (256 bit) which (by the looks of things) weren't really working on Java 1.6 (128bit). Anyway, to upgrade CF 9 to 1.7 (1.8 not supported and the server monitor stopped working if this was done); installed Java 1.7, opened up the jvm.config for ColdFusion and changed the path for java.home. Copy of msvcr100.dll from JDK\bin in JRun4\bin Restarted the service and all went well. Then it fell over! Then I restarted the service. Then it fell over... Turns out, need to remove -XX:MaxPermSize=192m  from the jvm params, else preapre for some see sawing! Also, good idea to use the  -Duser.country= &  -Duser.language= parameters if required, as I ended up constantly getting US set up (despite the OS saying otherwise) Any other Connection Failure issues with these new certificates were resolved by importing missing chains using keytool . ...

keytool & importing new certificates / missing chains for Java

Everyonce in a  while new root certificates come out that ain't trusted by your server. JRun4\jre\bin\keytool -import -keystore \JRun4\jre\lib\security\cacerts -file \somenewcertificate.crt See these links also for the issues these caused with ColdFusion  https://docs.google.com/document/d/12Ef1SwddMh0oO11TS3lt5E8VGiVCsdI8WmYn8qQLW4c/edit# https://bugbase.adobe.com/index.cfm?event=bug&id=3041494    Remember also if using Coldfusion with a different JVM version, the cacerts is in the JVM version!

RDP SSL Causes PCI Compliance to fail

Found another issue crop up with a firewall rule change that opened up and RDP availability RDP should be configured using strong encryption methods or use SSL as the privacy and integrity provider. To configure RDP encryption methods, launched in mmc.exe to run the  'Terminal Services Configuration' or 'Remote Desktop Session Host Configuration' snap-in. The 'Terminal Services Configuration' or 'Remote Desktop Session Host Configuration' properties dialog box General tab for the Encryption Level 'High' should be selected. See more here for Windows 2008 R2 basically Start> Administrative Tools> Remote Desktop Services> Remote Desktop Session Host Configuration Click on Connection Click General Tab Change Security FROM Negotiate to SSL(TLS 1.0) Click Encryption Level to “High” A restart may be required (hopefully you won't get kicked out)