Month: May 2005

  • SSL Certificates Rant…

    It’s May; it’s coming to that time of the year where I have to update my SSL certificate again. As I did last year I had a good look round for an official SSL option. Since I only use it for accessing my own web-mail and a few other toys, I loath the thought of…

  • Prolific PL-3507 Hi-Speed USB & IEEE 1394 Combo to IDE Bridge Controller

    I have a generic USB2/IEEE1394 (Firewire) external hard drive enclosure. It is built on the Prolific PL-3507 Hi-Speed USB & IEEE 1394 Combo to IDE Bridge Controller; this is a record of my recent troubles with it. Currently it house’s a Maxtor 6 Y130M0 (120Gb) Hard Drive. I’ve found it to be totally unreliable over…

  • Java Snippet – ANT Jar Task

    by

    in

    Builds a JAR file Test.jar and generates a manifest specifying that class Test is the Main-Class. [xml] [/xml]

  • Java Snippet – Using SecureRandom

    by

    in

    A better random number generator [java] import java.security.SecureRandom; … public static SecureRandom random = null; static { try { random = SecureRandom.getInstance(“SHA1PRNG”); random.setSeed( random.generateSeed(256) ); } catch( Exception e ) { e.printStackTrace(); } } [/java]

  • Java Snippet – Fast File Copy

    by

    in

    When using JDK 1.4 and above… [java] public static void copyFile(File in, File out) { try { FileChannel sourceChannel = new FileInputStream(in).getChannel(); FileChannel destinationChannel = new FileOutputStream(out).getChannel(); sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel); // or, you can also copy it this way // destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size()); sourceChannel.close(); destinationChannel.close(); } catch ( Exception e ) { e.printStackTrace(); } }…

  • Java Snippet – Recursive Directory Deletion

    by

    in

    Returns true on success, false on failure: [java] public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i=0; i<children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } [/java]

  • Instant Password Recovery Tool

    I made this back in April 2004, it only took a couple of hours to write and build the database. Basically, I took a wordlist of 535,683 words and hashed them in MD5, SHA1 & LANMAN. The results are stored in a simple MySQL table, indexes on that table make lookups REALLY fast and thats…