Blog      Products      DotNetWiki      Support      Contact  
     Blog Categories
 - All
 - .NET
 - 4 Word Book Reviews
 - AllPodcasts
 - Business Thoughts
 - Clueless Idiocy
 - Norn Iron
 - Personal
 - Podcasting
 - PowerPack
 - Weird Interweb Stuff
 
     Geoff on Twitter
 
     Local Blogs
 
  ASP.NET PowerPack
The ASP.NET PowerPack contains 28 rich, cross-browser controls including:
 - RichTextBox
 - ComboBox
 - DatePicker
 - No-Repost validator

Try the ASP.NET PowerPack free today!
 - More Info
 - Download
 - Price List
 - Licensing
 - Buy Now!

 
     Web Tools
 - The DotNetWiki
 - OPML Viewer
 - RSS Viewer
 - ASP.NET Colors
 - Base64 Encode
 - Base64 Decode
 - HTML Encode
 - HTML Decode
 - URL Encode
 - URL Decode
 - Crazy IPs
 - Whois

 
     Windows Tools

ADO.NET ConnTest
A simple, free Windows program to test ADO.NET connection strings.

Lines of C#
Ever wanted to know how many lines of C# code are in a file or folder hierarchy?  This free Windows program will tell you.

XmlTools
Free tools to process XML files from the command line.

 
Some base64 tips

I just saw a post on Novell's 'Cool Blogs' blog that has a useful tip on base64 decoding.  Apparently, if you save your base64 text to a file with an extension of '.b64', Winzip can open the file and allow you to extract the content.
 
That's pretty neat, if you ask me.  But since I don't have Winzip installed, I can't check it out for y'all.  (OK, I could install it, and I already have a valid license for it, but I've been running for months with just Windows ZIP handling and a bunch of PowerShell scripts for command-line ZIPping and I'm reluctant to change now.)
 
Speaking of PowerShell, I have a couple of PowerShell scripts for base64 encoding and decoding too, if anyone's interested.
 
Those PowerShell scripts can come in handy for folks that the web interface isn't quite right for.  I got another un-replyable email (here's a link to the last one) a few days ago, that said: 

I want to encode over 100 passwords so that I can use LDIFDE to change them. My question is how do I format my input file so that the results I obtain show 100 difference encoded entries.

And, just in case he's reading this (or in case it's something someone else wants to do), here's my reply:
 

Hi there,

 

If you believe in using the right tool for the job, I wouldn't use the base64 web page on my site...  It'll always just generate one output based on all the input, not separated out the way you need.

 

If I were you, I'd use PowerShell for this kind of task.  It's fairly straightforward to put together a simple PS script that generates the base64 value from text on the command line, then you can just use a PS command to read in the file and pipe line-by-line to your script.

 

For instance, here's a simple file:

 

PS> get-content test.txt

This is line 1

This is line 2

Some more text

 

I've got a script called encode-texttobase64 that takes one command-line parameter - the text to encode - and it base64 encodes it and outputs the result.  So here's running the script, getting one base64 encoded value per line:

 

PS> get-content test.txt | %{ encode-texttobase64 $_ }

VGhpcyBpcyBsaW5lIDE=

VGhpcyBpcyBsaW5lIDI=

U29tZSBtb3JlIHRleHQ=

 

It's pretty straightforward.  I can give you the PowerShell scripts for encoding and decoding from the command line, but I thought you might relish the opportunity to create them yourself first (although they're really trivial).

 

BTW, I've never used LDIFDE, so I don't know if this does exactly what you want or if there's some other hurdle you need to overcome.

 

Good luck!

 

                                                Geoff



Categories: .NET
Permalink #.Posted by 'geoff' on Saturday, 12 January 2008 at 2:48PM


Comments, Trackbacks and Pingbacks

heres a bookmarklet that may do what you want.. however trivial,

Posted by 'Moonman' on Tuesday, 29 April 2008 at 1:16PM

Post A Comment

Your Name:
Your URL (optional):
Comment Title:


View my Technorati Profile.
RSS 2.0 Subscribe to the RSS 2.0 feed for Geoff's Blog.