Now we turn to the other feeds. Those area a bit more straightforward as I really just want the output from them. So, add another Feed Fetch source and enter the URLs to the other two feeds into it. But, now we have two sources and if you look at the Pipe Output tool, you'll see it's only got one input! Fortunately, there's an easy solution: the Union tool. This simple tool provides multiple inputs and a single output. If we attach it to the Pipe Output and then highlight that, we see we've got my one iPhoneTunes.net entry and all of the entries from this blog. It pulled all of them, so you can't see the TEDxRochester blog items in the debugger, but they're there.
Sunday, November 15, 2009
It's all a series of tubes, Part 3: I'll bet you think this Pipe is about you
It's all a series of tubes, Part 2: And what is a Pipe if not a tube?
If I click on the Fetch Feed source, it turns orange. The really interesing bit happens in the debugger, though:
The fetcher, once highlighted, does its job and you see the result. It has fetched all of the items from the RSS feeds and is showing me what my output would be if I ended the chain here. Unfortunately, at the moment, only one person has tweeted recently enough to show you. But, were there tweets from other people, you'd see all of the intermingled into one continuous stream.
Since this is just supposed to be a simple aggregator, I'm going to end it here. To do so, simply click the little bubble on the bottom of the Fetch Feed source. You'll see the bubble on the top of the Pipe Output tool turns orange. This is to let you know that it's an acceptable place to terminate the pipe that's now coming out of the bottom of the feed fetcher. Simply drag that pipe down and drop it onto the output tool and a link is formed. If you then click on the Pipe Output tool, you'll see the debugger refresh and the same data as before will display. That's it, we've now got a simple aggregator for our Twitter feeds. Hit the Save button, give it a name and we're done!
So, now what do we do with this? Well, click on My Pipes at the top of the page. Your new Pipe will show in the list. Click it, and you should see the tweet feed. All you need to do now is right click the "Get as RSS" link, choose "Copy link location" and paste it into your feed reader. If you use Yahoo or Google Reader, it's even easier: just click the button.
Now, this was just a simple first Pipe to get our feet wet, but it really shows how powerful this tool can be. It gets even more powerful when you start to take advantage of the filtering capabilities as well. But, that's for Part 3...
It's all a series of tubes, Part 1: Ping 'em all and let THEM sort it out.
Monday, March 9, 2009
Are you free, Mr. Kay?
For example, if we're going to be on PTO, aside from letting our supervisor and HR know, we have to let the team know. We could easily setup a team calendar to handle time off information, but we find it's just easier to send each other all day appointments with titles like "Tony - PTO". What we normally do is set the busy information to "Free" before we send it out so that it doesn't block off our coworkers days. Sometimes, though, folks forget to do that and I'll end up with entire weeks blocked off and project managers screaming because they can't find any free time in my schedule. Deciding today I'd had enough, I wrote a little program to take care of this for me. What the below VB does is open my Outlook calendar and iterate through all of the items in there. It checks the subject line, and if it contains "PTO", it then checks to make sure it's set to free (BusyStatus of 0). If not, it changes it, saves it and then writes the subject/free/busy again to confirm it's been changed.
Imports Outlook = Microsoft.Office.Interop.Outlook
Module Module1
Sub Main()
Dim objOLApp As Outlook.Application
Dim objOLNS As Outlook.NameSpace
Dim objCalendar As Outlook.Folder
Dim colItems As Outlook.Items
Dim objappointment As Object
objOLApp = New Outlook.Application
objOLNS = objOLApp.GetNamespace("MAPI")
objOLNS.Logon("", "", False, True)
objCalendar = objOLNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar)
colItems = objCalendar.Items
For Each objappointment In colItems
If InStr(objappointment.Subject, "PTO") Then
If objappointment.BusyStatus <> 0 Then
Console.WriteLine(objappointment.Subject & " " & objappointment.BusyStatus)
objappointment.BusyStatus = Outlook.OlBusyStatus.olFree
objappointment.Save()
Console.WriteLine(objappointment.Subject & " " & objappointment.BusyStatus)
End If
End If
Next
End Sub
End Module
It's not the most efficient code, I know. But, it went through my calendar in about 30 seconds and changed a few hundred entries. I had planned on using it just this once, but it might be a good thing to schedule to run once a week or so. Now, I have LOTS of free time for my PMs to fill up! Oh, wait, that might not be a good thing.... :)
Thursday, March 5, 2009
Mining event logs for useful information
So, if I could write a utility that will cull the useful data from the logs, I wouldt need to rely on users. I can find the exact date and time of each disconnect and with the help of our Network team, we might be able to pinpoint where the issue actually lies. So, to that end I did a little research as I'm familiar with reading frmo the eventlogs with VBscript, but I'm trying to do more with VB.net since I can use the VB 2008 Express Edition for free. The first issue I encountered was that pulling EventIDs is a deprecated propert, and I had to use the EventLog object's InstanceID property instead. The results recieved from this property need to have the top two bits masked off in order to get the EventID. That's what's going on in the "intEventID = objentry.InstanceID And &HFFFFFF" line:
Public Sub ListEventLog()
Dim objLog = New EventLog()
Dim intEventID As Integer
Dim strUsername(), strEventMessage, strDate, strTime, strDateTime() As String
objLog.Log = "System"
For Each objentry In objLog.Entries
intEventID = objentry.InstanceID And &HFFFFFF
If intEventID = 9007 Then
strEventMessage = objentry.Message
strUsername = strEventMessage.Split("\")
strDateTime = Split(objentry.TimeGenerated, " ")
strDate = strDateTime(0)
strTime = strDateTime(1) & " " & strDateTime(2)
Console.WriteLine(strDate & "," & strTime & "," & strUsername(1))
End If
Next
End Sub
Once compiled, you simply run this utility piping the output to a text file. You then have a nice CSV you can pull up in Excel to process the data with.
Monday, February 9, 2009
Some basic MFCOM scripting
Each server serves one or more hub locations in our environment, and the hubs are consistently numbered with a four-digit number that begins with 0. So, the below script (which is very inefficient, I know) simply finds every application in the published application list that has that hub number in the title. Once it finds these apps, it looks at the server list from which the app is published, and if it's a production server, replaces the server with the BCP and vice versa. What used to take 16-24 minutes now takes 16-24 seconds.
Set objFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
objFarm.Initialize(1)
strHubNumber = Wscript.Arguments.Item(0)
For Each objApp In objFarm.Applications
objApp.LoadData 1
If Instr(objApp.Appname,strHubNumber) Then
strAppDN = objApp.DistinguishedName
Wscript.Echo strAppDN
For each server in objApp.Servers
If Instr(server.ServerName, "MMSPC") Then
strNewServer = Replace(server.ServerName, "MMSPC", "MMSBC")
Wscript.Echo vbTab & "Replacing " & server.ServerName & " With " & strNewServer & vbCRLF
Set objAppSrvBind = CreateObject("MetaFrameCOM.MetaFrameAppSrvBinding")
objAppSrvBind.InitializeByName strNewServer,objApp.BrowserName
objApp.AddServer objAppSrvBind
ElseIf Instr(server.ServerName, "MMSBC") Then
strNewServer = Replace(server.ServerName, "MMSBC", "MMSPC")
Wscript.Echo vbTab & "Replacing " & server.ServerName & " With " & strNewServer & vbCRLF
Set objAppSrvBind = CreateObject("MetaFrameCOM.MetaFrameAppSrvBinding")
objAppSrvBind.InitializeByName strNewServer,objApp.BrowserName
objApp.AddServer objAppSrvBind
Else
Wscript.Echo "Server doesn't match naming convention"
End If
objApp.RemoveServer(server.ServerName)
objApp.SaveData
Next
End If
Next
Thursday, January 29, 2009
Third party root certificates on the iPhone
When I tried to do this in Mobile Safari on my iPhone, I kept being told it couldn't download the PEM file. So, I did some searching and I found the solution: e-mail yourself the cert. Follow the same steps as above, but instead of clicking the "PEM Format" link, you're going to want to right-click the "DER Format" link and use your browser's method of sending links. When you get the e-mail open the attachment, accept that you trust the cert and you'll be good to go.
While the solution was small, can you believe I had to compile it from three different sources to get it to work right? :)



