Lance's TextBox

For software developers using IPWorks, PowerShell, RSSBus, etc.


News

 Subscribe Add to Technorati Favorites

 

 

 

 


 

 

Search My Blog:

 

 

My Stats

  • Posts - 447
  • Comments - 193
  • Trackbacks - 265

Twitter












Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Blogs


Miscellanous


Noteworthy Stuff


Popular Posts



An easy way to convert data to/from base64 (or uuencode/uudecode, quoted-printable, url encode/url decode, JIS, Yenc, hex, or even creating md5 or sha1 hashes) is to use the NetCmdlets convert-data cmdlet. To encode:

PS C:\> convert-data -data "Hello, World!" -to base64

Data                                                             Size Format
----                                                             ---- ------
SGVsbG8sIFdvcmxkIQ==                                               20 base64

To decode:

PS C:\> convert-data -data $encoded.Data data -from base64

Data                                                             Size Format
----                                                             ---- ------
Hello, World!                                                      13 Plain

Technorati Tags: , ,

If you’re an RSSBus user who is using my Google Calendar –> Twitter or Flickr –> Twitter services, you might notice a minor change to both.  I changed Twitterminder so that tweets resulting from Google Calendar entries are prepended with “GCal: “.  I did the same thing with the Flickr->Twitter script, it will now prepend “Flickr: “.

Related: How to call these services from your own applications.
Related:  How I converted TwitterMinder into Flickr->Twitter by changing 4 lines of code.


This is cool – FriendFeed created the SUP protocol (format) for web services that produce multiple feeds.  In order to reduce tons of frequent feed polling, services can offer one “SUP feed” that indicates what feeds on the service have been updated.

It works very simply.  Each RSS/Atom feed includes a link tag with that feeds SUP-ID (so each feed has its own SUP-ID) and the URL of the SUP feed.  The SUP feed contains a list of all the SUP-ID’s of feeds that have been updated.


I’ve always had excellent service from Amazon, and Amazon MP3 is no different.  Last week I blogged about how I purchased the new Rehab album from Amazon MP3.  It turns out I accidently bought the censored version, which is annoying to me.  So given Amazon’s uniquely amazing customer service, I decided to email them and ask if I could download the explicit version of the album without having to re-purchase it.  No more than 2 hours later I had a response:  a refund is being issued for my mistaken purchase.  Wow.

Technorati Tags: ,

The latest from Antoine Habert is that PoshBoard 0.3 is out at codeplex.  He's posted release notes and a quickstart on his blog.

update: fixed links.

 

 

Technorati Tags: ,

One of the cmdlets I use most often in my scripts is test-path, which simply tells you whether or not a particular file or path exists.  Below is test-remotepath, which I use to tell me if a remote file or path exists.  This particular script uses get-ftp from NetCmdlets, but it could also just as easily be done with rexec, rshell, or even ssh (sexec).

## test-remotepath.ps1: Tests if a remote file/path exists 
## This script uses ftp to determine whether or not a remote file or path exists.

## This could also easily be done using the invoke-ssh or invoke-rexec, or invoke-rshell

## cmdlets. FTP authentication can also be done with PSCredentials (see other demos)

##

## Returns a boolean.

##

## usage: test-remotepath [-server] <string> [-user] <string> [-password] <string> [-path] <string>

##


param( [string] $server = "",
[string] $user,
[string] $password,
[string] $path )

($results = (get-ftp -server $server -user $user -password $password -path $path)) | out-null
if ($results -eq $null) { return $false }
else { return $true }

 


My buddy James and me were discussing Amazon’s Kindle today at lunch.  To us, its such an appealing product, but the price is just too high.  But…I noticed today that if you sign up for the Amazon Rewards Visa Card you get $100 off - Amazon Kindle for only $259.

I didn’t click over and buy one yet, I’m going to think it over a bit instead.  I really want one…  Hmm.. Who  has one of these already and how much do you love it?

Technorati Tags:

Dear RIAA,

Please address your thank-you note to Pandora Radio.  Pandora is where I was able to listen to a bunch of songs by Rehab, and where I then proceeded to purchase the Rehab album "Graffiti The World" (through Amazon MP3 of course, where I purchase all my DRM free music).  Matt Miller brought it to my attention that Pandora may be on the way out because our the members of the Copyright Royalty Board have their eyes wide shut (just to be a little bit overly dramatic, there is no doubt in my mind that they are receiving some sort of monetary “encouragement” from the RIAA).

RIAA: while you’re at it, address another thank-you to Grooveshark, who’s ass you should also be kissing. 

Fellow nerds, follow the Pandora blog and/or the Grooveshark blog.
Related:  don’t forget to contact Amazon about Audible DRM.

 

Technorati Tags: , , , ,

ImapBack:

ImapBack makes a complete copy of your emails, on any IMAP server, from Gmail to Google Apps, to your own custom IMAP server located anywhere in the world! These backups can be stored on another IMAP server, on our servers, or on your local hard drive. You can schedule any interval of backups (Daily, Hourly, Weekly, Monthly) as well as creating a backup on-demand.

On a related note, if you need an easy way to view and control IMAP access control, check out my IMAP ACL Manager application.

Technorati Tags: ,

No, lostphonebook.com doesn’t exist.  But I was thinking of buying it, and putting up a little mock “lost” flyer, complaining that I have lost my phonebook.  The flyer would ask that if you have found a “lost” phonebook in your driveway or yard, that you simply return it to its owner.

Then of course, I would proceed to offer my address by asking you for your zip code, and what type of phonebook you found.  The website would look for the closet phonebook publisher (ie, AT&T publishes “The Real Yellow Pages”) to your zip code and provide directions to that location, asking you to simply deposit said phonebook in their driveway or yard.

I would love nothing more than to see the front of the AT&T Raleigh offices littered with so many useless phonebooks that workers couldn’t even get through the front door.

Technorati Tags:

My friend Julie told me about Pandora Radio a while back, but I never got around to checking it out.  Well, I finally did today, and she is right about it.  Its awesome!  Pandora allows you to custom make your own radio station, playing the music you request and other music similar to it.  You can also share your station, and listen to the shared stations of other members and friends.  In my case, just what the doctor ordered for a Sunday morning of background music while doing some chores around house.

If you’re reading this (and you’re not just one of my friends or acquaintances who is stalking me), you know you’ve done it.  Yep, you know you have.  You’ve spoken to someone or written to someone in various computer languages.  It just happened here at /n software in an IM conversation between two of my co-workers, James and Tom.  James is trying to get a group of people together to see the Pink Floyd Experience.  James IM’d Tom in RSBScript (For you nerds that don’t know, RSBScript is an xml-based language used to help create and consume web services with RSSBus):

<rsb:equals attr="Tom.isGoingToFloyd" value="true">
   <rsb:else>
     <rsb:unset item="Tom" />
   </rsb:else>
</rsb:equals>

Translated into C#, this says:

if (Tom.IsGoingToFloyd()) 
{
}
else {
    Tom.Dispose();
}

Only a true nerd could appreciate something like this, so naturally I laughed.  :)

The first example of this extremely nerdy yet all too common act I can think of was a silly one that my friend Todd signed in my yearbook in high school (yep, we were nerds then too).  Todd and I we were in AP Computer Science together, where Pascal (no, not even turbo pascal, the use of which actually lost me points on my final project!) was taught.  Before you read this, know that me, Todd, and Luther used to all be best friends.  Todd and Dana were a bit of an item, me and Aimee were dating, and Rose was this strange girl who seemed to be obsessed with Todd, and poor Luther had no women in sight.  Here’s what Todd wrote (warning: do not read unless you are prepared for some serious high level nerdiness):


Lance; {Crackers is what we used to call you }

program TheEndOfTheYear (var Dana, Aimee:Babes; Lance, Stodd:Studs);

type funtype:char;

var Luther:needsagirl;

begin

{ //ok, this part was random stuff that Todd wrote, which I'll skip }

Girls:=0;
Luther:=Girls;
Joy := plenty;
Todd + Lance := Joy;
repeat
    Kiss(Lance, Aimee);
    Kiss(Todd, Dana);
until (Death or ExtremeHappiness);
for Counter := head to toe do
    LoveYourWoman;
while Rose = Alive do
    HitAndKick(manytimes);
end.

Yes, I am aware of the nerdiness level.  No, I am not ashamed.  Pascal Lance out.  (:P Tom)

 


Updatedeadline pushed back (another week?) for the scripting contest.

In case you missed it, the guys over at the PowerScripting Podcast are hosting a scripting contest.  Hurry though, the deadline is Sunday!  They’re giving away free licenses of NetCmdlets and PrimalScript 2007.

Technorati Tags: ,

This incomplete tutorial gets a person started, but then bails on the second half of the process of configuring actual users.  Instead it points you to the man page, which is basically useless and conflicts with directions mentioned in the snmp.conf man page!  Ugh!

This page is a little bit better, it helps me get an authNoPriv user up and going.

From there, I was able to add my authPriv users too:

  1. As described in the first tutorial mentioned above, run snmpconf –g basic_setup and then copy over the conf file.
  2. net-snmp-config –create-snmpv3-user –a “auth_password” –X DES -x “des_password” desuser
  3. net-snmp-config –create-snmpv3-user –a “auth_password” –X AES –x “aes_password” aesuser
Technorati Tags: ,

On last week’s PowerScripting Podcast, Jonathan Walz and Hal Rottenberg interview /n software’s Eric Madariaga about NetCmdlets and PowerShellToys (PowerShellASP).

My favorite part was when Hal was shocked to hear that a telnet cmdlet was added to the v2 beta.  Hahaha.  I completely agree – who uses telnet anymore?  But that was actually the biggest request we got from people who were using v1 of NetCmdlets!  We already had cmdlets for executing commands over ssh…but people really wanted telnet.  This shows you how many sys admins are still using this older means of working remotely.  Jonathan was under the impression that telnet isn’t included on Vista – he’s correct that it is not installed by default, but you can install it from the Windows Features Control Panel tool.

Hal asked Eric how the PowerShell server managed the keys that are used for its SSH authentication.  The answer is that it doesn’t.  The PowerShell server only supports user/password authentication, not public key authentication.  If the demand is there, public key authentication can be added pretty easily (we already have this technology implemented in our IP*Works! SSH developer toolkit). With PowerShell Server, you point it to a Windows user group that is allowed to authenticate, and when you connect to it you use that user/password.  I’ve been meaning to do a blog post comparing remoting through WinRM (what PowerShell 2 uses) with remoting through the NetCmdlets PowerShell Server, but I haven’t gotten around to it.  Long story short?  PowerShell Server is SIMPLE.

Eric mentioned the fact that Sapien has integrated PowerShellASP support into PrimalScript, which is awesome.  PrimalScript is a fabulous editor.

Also mentioned in the interview: 

  • PoshBoard, which is an awesome PowerShell dashboard that Hal told me about a while ago.  The developer, Antoine Habert, contacted me about integrating PowerShellASP with it.  Lots of really cool potential here.
  • On the NetCmdlets road-map: SharePoint cmdlets, EC2 and SimpleDb cmdlets, BizTalk cmdlets, Shipping (FedEx, UPS, USPS) cmdlets.
  • Free hobbyist license of NetCmdlets.
  • The famous PowerShell stickers.  There’s a “PowerShell Driven” Flickr group where you can upload a picture of your car (or laptop, or whatever else) sporting your new PowerShell sticker!
  • /n software doesn’t have a NetCmdlets blog.  At least not an official one.  :)

Technorati Tags: ,

I hate when people send me an email with a .rar (or similar non-.zip) attachment.  I realize that rar has some special features that set it apart - but those features are not really very important when you're just talking about sending me a small non-commercial c# project in an email.

I think I will create my own custom compressed archival format, and start sending out .lnc files (which doesn't stand for "lance", but something creative that implies its the worst compression format ever, like "loco nasty compression" or "like...not compressed" or "lame non-zip creation") instead of .rar or .zip.  Then everyone who wants to open one of my email attachments will have to download and install my software. 

And when someone replies back to me and says - "Can you send me a zip instead of an lnc?"  I'll just be like "What??  You're still using zip?  Ugh.  Dude download WinLNC already, its 2008.  I sure hope you're not using that 'compressed folders' crap that is built into Windows like all the other Microsoft sheep."  Then I'll post information on the WinLNC website about buying the WinLNC subscription package, and false testimonials from all my "customers" raving about how WinLNC is soooo much better than all the other available tools.  Then I'll upload the free trial version to download.com and similar sites and write a script that automatically passes through anonymizing proxies and downloads my software once every 5 minutes. 

Before my PowerShell friends think they're immune, soon to follow will be the read-lnc and write-lnc cmdlets.

Are you thinking the same thing I'm thinking, Pinky?  I'm going to take over the world [of compressed archives]!

posted @ Friday, July 25, 2008 11:23 AM | Feedback (4) | Filed Under [ General ]


On the home front:

I’m planning on trying some triathlon events, although I really would prefer to try some adventure racing instead.  First I’m going to start with a tiny little super sprint triathlon, where the distances are very short.  First I have to wait for my ankle to get healed though, but the swimming part will be the only tough leg for me so I can train for that even with the injury (for those who don’t know, I took a bad sprain playing volleyball about 5 weeks ago).  I’m also planning on my first half marathon in November.  I need to get to work training for this one ASAP if I am going to make it.  I’m sure that I’m out of shape since I haven’t done any running in the last 5 weeks.  For now swimming and mountain biking will be the bulk of my exercise.  Got any good advice for me?

I have recently enjoyed live performances of Iris Dement, The Bowerbirds, and Tom Petty.  I love live music!  We also went to see Dave Attell, who was absolutely freakin’ hilarious!  I went to all of these with someone I met recently, and I’m having a blast spending time with her.  Her music taste is much like mine (which is not exactly common), and we get along great.

prius My friends keep making fun of me because I have it in my head that I want to buy a 2009 Toyota Prius.  I don’t think the Prius body style is as lame as they say, but for all that mpg I don’t really care either.  Right now I drive a 2002 F-150 gas guzzler, which has its uses of course…but also has its hefty gas price tag.  Maybe I’ll keep it too and just park it most of the time.  Maybe whatever gas money I save on a new hybrid I can throw into buying a boat!  Thats not exactly a step in the carbon-neutral direction, huh?  Everytime I drive over the lakes around the area I am so completely jealous of those people I see riding their waverunners, skiing, wakeboarding, etc.  I want to get out there, but a ski boat is a big chunk of money to drop.  Is it worth it?

Its almost time to go white water rafting!  Can't wait for that!  :P  Then I want to learn how to do some river kayaking.


From the work front:

What have I been doing at work lately?  I’ve been spending a lot of time at work playing with SharePoint, the PowerShellToys’ PowerShellASP which lets you create ASP.NET apps with PowerShell script, and I set myself up with a brand new openSUSE 11 (this is a great distro) machine where I’ve been spending a lot of time in MonoDevelop.

Speaking of PowerShell and ASP.NET – check out PoshBoard [at CodePlex], Antoine Habert’s PowerShell driven ajax portal.  Antoine has a nice little video on his blog.

/n software has also made a small flurry of new announcements over the past week or so.

  • New release – IP*Works! EDI/AS2 V8.  Another fresh round of Drummond cert tests are complete.  On top of the insanely popular AS2 components, we’ve added OFTP, FTPS, and a new java GISB component.  A new AS2 Connector application is coming out of the pipeline soon too!
  • New release – Paymentech Integrator v5.  Paymentech Integrator is probably my personal favorite of all of our credit card processing components.  With PABP/CISP compliance being so important, this new release has been highly anticipated.  This release adds Canadian Debit and Health Care/FSA support.
  • New beta – UPS Integrator.  Unlike the other /n software shipping integrators (FedEx and USPS), this one does NOT include the ability to generate shipping labels.  While the technology is there, unfortunately UPS licensing restrictions will not allow us to release a component that generates UPS shipping labels, but we are trying to work with them to change this.  If this is something you’re looking for, do contact me so that I can get your comments passed on to the right people at UPS!
  • New beta – SharePoint Workflow Extensions.  The toolkit includes SharePoint Activities for Internet communications, namely FTP (ssl & ssh), RSS, email, sexec, SMPP (sms messaging), SNPP (paging), and XMPP (jabber).

In the past I gave examples of using the get-ftp and send-ftp cmdlets for PowerShell, but recently a user pointed out that I didn’t show any examples of public key authentication using the cmdlets.

Of course the –ssh flag tells the get-ftp and send-ftp cmdlets to use SSH (instead of plain text FTP, or an SSL connection which is turned on with the –ssl flag).  For SSH connections, the AuthMode parameter determines what type of SSH authentication to perform – in this case that will be “publickey”.  The “Cert” parameters (-CertStoreType, –CertStore, –CertPassword, and –CertSubject) are used to point to the specific private key you’d like to use for authentication.  If you’re using a pem key, –CertStoreType will be “pemkey”.  Use –CertStore to point to the actual file itself, and –CertPassword will be the password required to open the file.  -CertSubject is used to refer to the specific certificate in the file – or just use “*” to pick the first (or only) certificate in the file.

get-ftp -server 10.0.1.159 -user lancer -ssh -AuthMode publickey -CertStoreType pemkey -CertStore C:\id_rsa -CertPassword (read-host -assecurestring "Enter Password") -CertSubject "*"

 

Technorati Tags: , ,

I uploaded a new version of the IMAP Access Control List Manager today.  This new version adds support for SSL/TLS implicit and explicit connections, CRAM-MD5 and NTLM authentication, an IMAP communication log, and a few other minor and cosmetic changes.

Technorati Tags: , ,