March 2005 Entries

I took a chance and installed a CTP of Whidbey on my laptop. Thing is, I still use WebMatrix from time to time for POC stuff for v1.x of asp.net.

Problem is, when you run the Cassini webserver from webmatrix, it picks up the latest version of the .netfx and will give you different errors based on which version is installed. To get around this and ensure that the WebServer.exe runs on version 1.1 of the .netfx, simply add a WebServer.exe.config file with the following contents:

<configuration>
	<startup>
		<requiredRuntime version="v1.1.4322"/>
	</startup>
</configuration>

If you want to ensure WebMatrix runs on version 1.1 of the .netfx, you can add the above startup element to WebMatrix.exe.config.

posted @ Saturday, March 26, 2005 8:39 PM | Feedback (0) | Filed Under [ .NET ]

Straight from ScottW, I added

<MarkUp>
	<globalAttributes>
		<class enable = "true" />
		<align enable = "true" />
		<style enable = "true" />
		<id enable = "true" />
	</globalAttributes>
 

notice the style element? That cleared up the little non-formatted code issue that I had in my previous post.

Keith told me that CSBlogs was returning relative urls for its Metablog API implementation. After I installed it, I noticed the same thing - so I decided to hack it a little bit and find out what was going wrong. It turns out that the software is just doing what the guys at telligent are telling it to - thankfully I've got the code and I can poke around when I find little issues like this :)

First, I added a call to the Globals class to return a formatted url with the application path intact. This was in Components.SiteUrlsData.cs:

public virtual string FormatUrl(string name, params object[] parameters)
{      	

    if(parameters == null)
        return Globals.FullPath(this.Paths[name]);

    else
        return Globals.FullPath(string.Format(Paths[name],parameters));
}

But wait! This causes the rss feed to show up with something silly like http: / /localhost/cshttp://localhost/cs/blog... for the links in the RSS and Atom feeds produced by CSBlogs. So, I tried it without the "HostPath" to see if I could get the same results. This was in Blogs.Components.BaseWeblogSyndicationHandler:

/// 
/// Appends http://Host:Port to all blog urls
/// 
protected override string BaseUrl
{
    get
    {
        return ""; //return Globals.HostPath(Context.Request.Url);
    }
}

That's it right? Nope, not if you have galleries enabled. One of the methods (that I know of :) uses the modified FormatUrl above to try and get a MapPath to a directory. You'll find out really quickly that MapPath doesn't like fully-qualified urls passed to it...I know I did. So, I modified one more line to make sure that I've got a relative path passed into the photo gallery. This was in Galleries.Components.Picture:

/// 
/// This static method gets the location of the picture cache directory, mapped on the local filesystem.
/// 
/// string
public static string CacheDirectory()
{
	Uri uri = new Uri(GalleryUrls.Instance().PictureCache);
	return CSContext.Current.Context.Server.MapPath(uri.AbsolutePath);
}

After that, everything seems to be running as normal. I don't know if I'd recommend doing something like this on your install, especially if things are working well enough for you. I just use this particular feature of the Metablog API quite often, so it bit me a lot.

update: It looks like the trackback feature uses fully qualified urls as well as the rss/atom feeds. I'll post a fix tomorrow when I find out where the BaseUrl is set for the trackbacks.

update2: Found it :) I would've got it done last night, but I don't have the broadband yet. Any ways, like I thought it was just a removal of a baseUrl parameter (case notwithstanding). I found this in Blogs.Controls.TrackbackMarkup:

protected override void Render(HtmlTextWriter writer)
{
            
    if(IsValid)
    {
        string baseUrl = Globals.HostPath(Context.Request.Url);
	writer.WriteLine(tag,/*baseUrl+*/PermaLink,Title,/*baseUrl+*/PingUrl);
    }
}

[ Currently Playing : Rooster - Alice in Chains - Unplugged (6:40) ]

This is a message that my boss recently sent to a customer that had an issue with one of our software packages (I don't own it :)

Brian, in the finest tradition of Microsoft, VDB's engineers have returned an error message  that has absolutely nothing to do with the problem at hand.   Time Steps should be in the range of 1 to 10.  Instead, of limiting the input (1 to 10). VDB's fine engineers, it seems, prefer to give a worthless message, then plow on with  a 10 millisecond TD-Chart.  I conclude, the only reason for this is that they are trying to kill me.   I will have the problem fixed.   Maybe we will replace all messages with one that says "Call Tom, we are trying to kill him, sorry for any inconvenience."

Anyway, I have attached a new release 2.8.4, it has some new features like ZOOM, Undo, and a way to graph Well markers (horizons). It will also launch the help guide from the help button, now there is a novel ideal.  Though not fully tested, I'm sure it has an entire new array of useless error messages designed to kill me.


Sorry for the problem


Tom

[ Currently Playing : I Just Wanna Love U (Give It 2 Me) - Jay-Z - The Dynasty Roc la Familia (3:47) ]

...but I've decided based on some recent feedback to release the latest version of PostXING!

This version of PostXING will optionally support Http Proxies if you need that functionality - I had been waiting on some feedback from a couple of folks who could real-world test this functionality before releasing it to the wild. Thanks Chris, Keith, and Laurent for helping me track down some of the issues that this release addresses.

You're still reading this? Go get it! :)

[ Currently Playing : Paranoid Android - Radiohead - OK Computer (6:23) ]

So, mainly because of my comment problems with dottext 0.95, I decided to go ahead and take the plunge. Here's how I got CS installed in less than an hour:

That was it. My only gripe so far is the MetaBlog API doesn't return fully-qualified urls like the dotText implementation did. I can't believe they'd introduce a regression like that, but maybe there's a reason for it. It totally breaks some features of PostXING tho - like the view blog feature. I guess I could code around it (or, maybe I should code around it :) but I'd like to see if it's addressed first. Another thing that I should probably address is the fact that one user can have many blogs in Community Server. The way PostXING works now, it would only grab the first one returned b/c that's the way that I've always worked with it.

Another thing that irked me was that Community Server broke an nGallery vdir I had running up here. Funny thing is, it only broke one that was version 1.6.1. I have a v1.0 (I think) nGallery up as well, and it works just fine afaict. Weird.

Anyways, that's my story and I'm stickin to it.

[ Currently Playing : Everything I've known - Korn - Take a look in the mirror (3:34) ]

I'm going to be installing community server here today. There's going to be a little downtime because of that. As if you cared.

This shouldn't have gotten this out of whack, but it did, sorry. I've made sure that all of the folders are inherited now, and tested the get latest version on a different directory on my machine.

WARNING: The only thing to watch out for is that I like to copy my assemblies to my C:\bin folder so I can dogfood the output immediately. If you don't like that, go to the main PostXING project and clear out the build events. Also, the code that is now in the repository is more recent than the release on Project Distributor. It supports proxies for the web connection and has a couple of other bug fixes in it like handling FTP files with spaces. One more thing - not all of the projects in the trunk are either deployed to the world or active - the Client Template plugin project allows you to define a custom template on the client side (since dotText doesn't implement this particular metablog api feature) and the offline plugin was going to be the save/load posts feature but that got put into the main project instead. It's still there because someday I may decide to make it handle online/offline capabilities differently.

[ Currently Playing : Bombtrack - Rage Against the Machine - (4:04) ]

...at a time when people are actually leaving comments. Balls. Josh - I'm checking the vaultpub repository on a clean directory right now, I probably forgot to add all of the files to the repository. Genius, Chris.

update: I'm such a jerk. I have this repository set up all bass ackwards. I'll fix it up lickety split.

[ Currently Playing : Born of a Broken Man - Rage Against the Machine - The Battle of Los Angeles (4:40) ]

Teirnan asked for a few features for PostXING. I started to write a comment, but it got too long-winded for a comment. You get a post Sir:

Can I help you? I think maybe so :) In order:

  • I did this in a very early build of PostXING, but got some feedback that asked to be able to immediately edit the post that was just, erm, posted - in case of typos or whatever. I guess I could make it configurable, that shouldn't be too hard. Since you are literally the first person to ask for this feature, I think I'll make the current behavior the default.
  • I don't know how to tackle this one - PostXING is basically just a wrapper for SOME functionality of the Metaweblog API. Generally, the blog engine will handle the entry IDs. Sometimes it gives you an int, sometimes it gives you a string.
  • I actually tried to do this at one point, but I'm not sure how stable it would be. Think about it this way: in order for this to work, images would have to be parsed out (not a problem) and each one uploaded one at a time using the FTP component. The resulting url would have to be pumped back into the post and then and only then could you finally post/publish the entry. If you have a lot of images, this could take a really long time and thus give the perception that PostXING performs poorly. I guess I could make this a config option too with the caveat that it could possibly take a really long time to make a post.
  • This one is easy :) If you want it to be zippy, download the latest version of Vault from http://vaultpub.sourcegear.com . Login as the guest account (I think it's guest/guest) and go to the PostXING repository. Set a working folder and click Get Latest Version. The latest code release should be there, although it may be a little out of sync with the most current version that I'm dogfooding on my local machine. You can also find any plugins code that is associated with PostXING. If you don't want to install vault for whatever reason, I'm pretty sure you can download from their web interface using the same uid/pwd, but I'm sure it would be about 100 times more painful.

Thanks for the feedback, Tiernan.

[ Currently Playing : I'm done - Korn - Take a look in the mirror (3:23) ]

I totally geeked out tonight.

I was searching for something else and happened upon a tutorial for tunneling VNC on windows, which led me to another article that was inspiration for the first article I found. Here was the problem with both: the webserver that I wanted to get to is behind an OpenBSD firewall. So, first things first: I added a rule to pf.conf that allowed ssh to be redirected to the private address of my webserver using rdr syntax:

rdr pass on $ext_if from any to $public_address port ssh \
-> $private_address

This rule passes ssh calls bound for the external address to be sent to the internal network address (192.168.1.blah).

But what about ssh running on Windows?

Well, if you don't already have cygwin installed on the server, I ended up using sshwindows (linked from the OpenSSH site under Windows) Just follow the instructions in readme.txt or quickstart.txt and you should be good to go there - it comes with an installer, so it was pretty easy to get up and running.

But what about the client on Windows?

For this, I use PuTTY. I've used it for a while to ssh into my OpenBSD machines from windows. What I didn't know of is the Tunnel feature that sits near the end of the config setup tree...this is how the magic happens.

See, before, when I needed to get into a firewalled computer, I would just add rules to the firewall to punch temporary holes while I did what I had to do remotely. I know, bad Chris. Using OpenSSH to tunnel the traffic that would normally be sent unencrypted over the wire makes me feel a lot safer, even tho the server in question doesn't have a whole lot of goodies to look at. It's still important to me.

So how does the magic happen?

Using the tunnel feature of PuTTY, I added a link to port 5901 and mapped it to localhost:5900. Here's the rub: localhost in this case refers to the ssh server, not the computer the client is running from. The 5901 refers to the machine that the client is running from. This wasn't clear to me in either tutorial that I read thru. So you add the tunnel link to the SSH/tunels node of PuTTY and when you fire up VNC, have it sent to localhost:1. This was also not very clear from either article (but that just probably means I'm dense).

Is that it?

For VNC, yeah, it is. However, I also run a couple of applications on my network that contain sensitive data: namely SourceGear Vault and Dragnet. I want to get to these too! Can I do it in a similar way to the VNC deal? You betcha!

This time, for the tunnel link I specified an arbitrary (but often used) high port in PuTTY: 8000. I also wanted to point to the internal server (say, 192.168.1.2) so instead of specifying localhost:80 (which is already exposed -duh!) I pointed it to 192.168.1.2:80.

Fire up PuTTY, login as some user that's configured for OpenSSH, and point my browser of choice to http://localhost:8000/dragnet. Nice!