Welcome to my website. I am always posting links to photo albums, art, technology and other creations. Everything that you will see on my numerous personal sites is powered by the formVistaTM Website Management Engine.

icon.linkedin.jpgicon.twitter.jpg

  • Subscribe to this RSS Feed
  • Setting Up SSH Keys to Connect from Windows to a Linux Server with Putty
    04/15/2010 1:58PM

    The following is a how to on getting putty set up putty on a Win XP box to enable you use an RSA (or DSA) private/public key pair to connect to a linux server over SSH.

    • Generate your keys on the linux server to which you want to connect.
    • SSH to your server
    • go to your home directory .ssh/
    • Enter the following command to generate the key pair:
    • # ssh-keygen -t rsa
    • Enter a passphrase for your keys
    This will generate two files: id_rsa and id_rsa.pub.? id_rsa is the private key. Transfer the id_rsa file to your client/local machine.? Delete the id_rsa file from the server. Use puttygen.exe to convert the private key to a format that putty.exe will like
    • Fire up puttygen.exe
    • Select File/Load Private Key
    • Enter your passphrase that you entered when generating your key pair
    • Click on the "Save Private Key" button to save a format of this private key to your local drive.
    Open putty.exe
    • By default putty.exe starts with the "Session" screen selected.
    • Click on Connection/SSH/Auth
    • Under "Private key file for authentication" click on "Browse" and select the private key that you converted in the aforementioned step.
    • Go back to the Session screen, specify the IP address or name of your server and save the session.
    Connect to the server:
    • Run putty.exe
    • Simply double-click on the saved session and it will open up an SSH session to your server and you will be prompted to enter your passkey.
  • Searcing for a dot "." character with a Java Regular Expression
    03/14/2010 8:24PM

    When you want to search for the dot (.) character in a regular expression and not use it as a metacharacter use the following syntax:

    String regexPattern = "[.]";

  • Java In-line Initialization of a Map in the Constructor of an Enum Constant
    03/01/2010 8:52PM

    With Java 5.0 enums became much more powerful, click here for an overview.

    I am working on a project that is using an enum to keep track of an attribute of one of my objects and wanted to initialize a HashMap inline in the call to the enum's constructor.? Such was my delight to find out that using a simple initializer block that it was a snap.

    Here is the relevant snippet of code that illustrates the syntax:

    public enum MediaFileType{
        IMAGE( new HashMap<String, String>() {
                {
                    put(".jpg", "image/jpeg");
                    put(".jpeg", "image/jpeg");
                }
            } );

  • An Introduction to WSDL
    01/24/2010 11:00PM
  • An Introductoin to SOAP
    01/24/2010 10:53PM
Advanced Search

Categories

Archives