Showing posts with label utilities. Show all posts
Showing posts with label utilities. Show all posts

Monday, December 1, 2008

Open WebDAV from Windows

WebDAV stands for "Web-based Distributed Authoring and Versioning". It is a set of extensions to the HTTP protocol that lets users collaboratively edit and manage files on a remote web server.

This post summarizes the ways to open WebDAV folders:

1. WebDAV plug-in for Total Commander: http://ghisler.fileburst.com/fsplugins/webdav.zip

2. It's possible to use Window's built-in support: My Network Places / Add Network Place

3. Another option to use IE: File -> Open and check the "Open as Web Folder" checkbox.

Thursday, November 27, 2008

Launching command prompt (cmd) on remote Windows machines

Another feature, I was always missing in Windows, is the ability to launch the command prompt on the remote windows machines.
In Unix it's trivial: telnet or ssh allows to launch the shell.

It appears that in Windows PsExec of the Sysinternal Suite solves this problem:
The following command launches an interactive command prompt on \\marklap:

psexec \\marklap cmd

Tuesday, September 2, 2008

Implementing your own encoder in the Encoder Tool - Part 2

I the previous post I have explained how to create a custom encoder. The encoder that takes input and encodes it to output. But what happens, if the encoder needs an additional input to perform an encoding? E.g. the Inflate/Deflate encoders needs to know if they need to use gzip. The Digital Signatures encoders need access to the key stores with the keys and so on.
So how can the encoder receive the additional input?

Actually I tried to do it as simple as I could. To tell the Encoder Tool that your encoder needs input, you'll need to annotate the field with the InputField annotation.
So the Encoder Tool will know that prior to performing the actual encoding, it should pop-up the input dialog, get the input from user and populate the fields.

Let's take a look on the example:
package tarlog.encoder.tool.encoders;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;

import tarlog.encoder.tool.api.AbstractEncoder;
import tarlog.encoder.tool.api.fields.InputField;

public class DeflateEncoder extends AbstractEncoder {

@InputField(name = "GZIP compatible compression")
private boolean nowrap = true;

@Override
public Object encode(byte[] source) {

try {
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
Deflater deflater = new Deflater(Deflater.DEFLATED, nowrap);
DeflaterOutputStream deflaterStream = new DeflaterOutputStream(
bytesOut, deflater);
deflaterStream.write(source);
deflaterStream.finish();
return bytesOut.toByteArray();
} catch (IOException e) {
showException(e);
return null;
}
}
}


The field nowrap is annotated with the InputField. So when the user invokes the encoder, the following dialog will pop-up:



I guess that the idea is clear. So let's just mention what java types are supported as input fields:
  • String - can be a single line, a text box or a combo box. See TextField annotation for more details.
  • Boolean - check box
  • Integer - spinner
  • Enum - combo box
  • File - input dialog for a file or a directory. See InputFileField and InputDirectoryField annoations for more details.
  • Properties - table of properties
  • Arrays - list. See InputListField for more details.


The input dialog supports on going validations. To do so, the encoder must implement the tarlog.encoder.tool.api.fields.Validator interface. Let's take a look on the example:

public class X509CertificateEncoder extends AbstractEncoder implements
Validator {

private X509Certificate cert;

@InputField(name = "Certificate File", order = -300)
private File file;

@InputField(name = "Algorithm", readonly = true)
private SignatureAlgorithms algorithm = SignatureAlgorithms.SHA1withDSA;

@InputField(name = "Signature")
@InputTextField(multiline = true)
private String signature;

public String isValid() {
if (file == null || file.equals("")) {
return "Certificate File cannot be empty";
}
if (signature == null || signature.equals("")) {
return "Signature cannot be empty";
}
return null;
}

...


The method isValid() will be invoked each time the user changes input.

Friday, August 29, 2008

Encoder 0.1.0

And here just another neat tool I have developed for my personal needs and decided to make it public. Meet the Encoder!

So what is it used for?


It is used to encode things from one format to another. The input can be either text or bytes and the same about output. The tool is easily extendable: if you need to perform some special encoding you can implement encoder yourself and plug it into the tool. I'll expand about this functionality in the later post.

Built-in Encoders


Currently the build-in encoders are:
  • To/From Base64
  • Url Encoder/Decoder
  • Inflate/Deflate (optionally uses gzip)
  • Create signature using a private key
  • Verify signature using a public key
  • Verify signature using a certificate


Running the tool


The tool can be run either as an eclipse plugin or as a standalone application. UI is implemented in SWT, which makes it cross-platform. To run the Encoder standalone, download the distribution zip and execute "javaw -jar encoder-0.1.0.jar". You'll need at least Java 5.

I guess that all for now. I'll be happy to get any feedback about the Encoder and see people using it.

Enjoy!

Saturday, August 23, 2008

Desktops v1.0

Mark Russinovich and Bryce Cogswell have recently released a Desktops application as part of the Sysinernal Suite. Desktops allows you to organize your applications on up to four virtual desktops. Read email on one, browse the web on the second, and do work in your productivity software on the third, without the clutter of the windows you’re not using. Unix users are usually familiar with this feature and have it built in their UI frameworks. But in Windows it was always missing.
Especially nice that it comes in one file of 117KB size and requires no installation.

Thanks to LiM for first sharing this stuff.

Monday, April 7, 2008

Useful Software

Some time ago I decided to organize the utility software I'm using.
Now I have organized it using the Google Spreadsheets:



I'll be glad if you notify me about the interesting software you using that doesn't appear in this list.


Original post