in

This Blog

Syndication

Advertising

mystyleit

  • Finding Messages inside Exchange using EntryID

    Finding Messages inside Exchange using EntryID

    Recently I have had a need to locate messages inside Exchange using only the EntryID. Ideally I wanted to do this through Outlook but all evidence points towards this not being possible.

     

    The only thing I could find was to use Outlook shortcuts/hyperlinks:
    http://www.slipstick.com/outlook/links.htm
    But these proved very unreliable.  In fact I only managed it make it work once.

    Other Possibilities

    Based on everything I read, the only way to find the message is through API/SDK. Specifically using GetItemFromID:
    http://msdn.microsoft.com/en-us/library/bb219902%28office.12%29.aspx

    Solution

    My solution was to write a really small C# command line that app that will open the message based on EntryID and StoreID.

    The hardest part was getting my Visual Studio app to hook into Outlook 2003/Outlook 2007. The following MSDN articles were very helpful:

    Requirements

    In order to use this application, you must have the Office Primary Interop Assemblies (PIA) installed for your version of Outlook.

    I do not believe that Office 2003 ships with PIA, see Hello Word Outlook Add-In using C# but I believe Office 2007 does.

    You can download the PIA for Office 2003 and Office 2007 using the following links:

    Here is a link about doing development with PIAs
    http://blogs.msdn.com/b/vsto/archive/2008/05/20/common-pitfalls-during-pia-deployment-and-installation.aspx

    Results

    I ended up making two apps. One for Outlook 2003 and one for Outlook 2007. From the command line I can now open a message using the storeID and entryID. Here is the prototype for app:

    When you run the app with the right command line parameters, the app will start Outlook and open the email.

    The compiled versions of the app (both Outlook 2003 and Outlook 2007) can be downloaded here:
    EntryID.zip



    Update: Finding Messages inside Exchange using EntryID

    After continue working on this I had problems getting EntryID2003.exe working on Outlook 2003. I believe this is a problem linking into Outlook. Since then I have come up with a new solution in the form of a VB script.

    Here is the script

     

    The script can be downloaded here:
    EntryIDScript.zip

  • Xbox 360 Musings

    Xbox 360 Musings

    I recently bought a used Xbox 360 and have been messing around with it for the last couple weeks. Since then I've learned some things and thought I would put them all in one place.

    Original Xbox Support and System Update 9199

    The Xbox 360 can play some Xbox 360 games. The official ist is here:
    http://www.xbox.com/en-US/games/backwardcompatibilitygameslist.htm

    The real trick is getting it to actually work. It seems like nearly every link on the Internet points to this update:
    http://www.xbox.com/en-US/support/systemuse/xbox360/console/systemupdates.htm

    But that link is wrong.. The real update to play Xbox games on Xbox 360 is here:
    http://download.microsoft.com/download/d/1/8/d181ee58-de70-4484-936b-0e9161ccd6b2/BackCompat_11-2007.zip

    You must have a Xbox 360 hard drive in order to apply this update and to the best of my knowledge it can only be applied by buring the file to a CD or by connecting to Xbox Live. You cannot apply with USB drive

    Applying both update 9199 and the SystemUpdate_12-2007 will not do anything to a modded Xbox.

    Media and Xbox 360

    As best I can tell, there are two ways to play media on the Xbox 360.

    1. Through Media Center
    2. Video Library

    Media Center

    Media Center does not support playback of XVIDs. The updates that add XVID support do not apply to Media Center. Which makes Media Center pretty useless, for me anyway.

    I believe the update that adds this is 2.0.6683.0.
    http://en.wikipedia.org/wiki/Xbox_360_System_Software

    Video Library

    This is the big one. From here you can play XVIDs, connect to streaming servers (which I will cover later). But there is a big gotcha. In order to make it do all this great stuff you need the Optional Media Update.
    http://marketplace.xbox.com/en-US/games/media/66acd000-77fe-1000-9115-d802fffe07df/?of=3

    From what I have read, the Optional Media Update comes with some limitations:

    • Can only be downloaded from Xbox Live
    • It is signed to your console, if you take your HDD to your friends house and download it and bring it back to your house it will not work unless you connect to Xbox Live

    If the update is installed correctly it will work while not being connected to Xbox Live.

    I have read some sketchy tutorials that say you can hack it onto the Xbox 360 HDD but I doubt that work because they do not address the signing. I have not personally tried.

    You will also need a Xbox 360 HDD to get this update. I believe all of this is part of Microsoft's plan to punish those with modded consoles.

    If you do not have the update you will get the following error code:

    51-coodf236

    Streaming Media to your Xbox 360

    If you want to play movies on your 360 you can either copy the files to/stick in a USB thumb drive or you can stream directly to the Xbox.

    Two popular options exist for the streaming:

    I have only used PS3 Media Server and it's great. Really good.

    Here is a link all the video formats that Xbox 360 supports:
    http://support.xbox.com/support/en/us/nxe/gamesandmedia/movies/videofaq/viewvideoplaybackfaq.aspx

    Conclusions

    Hopefully this info hels out somebody!

  • Getting started with X10

    Getting started with X10

    If your anything like me you are always looking for some sort of IT project. Recently I started messing around with X10 and here is a summary of what I have learned.

    X10 is home automation technology that uses your homes electric system to send/receive commands. X10 old but still the most popular home automation technology. It has retained its popularity mostly due to the fact the it is a open standard. But the technology definitely has its problems, like it isn't 100% reliable.

    Here are some wiki links to X10 and X10's competitor technology:

    • X10
      X10 is old and sometimes problematic but the most popular.

    • Insteon
      Insteon backwards compatible with X10 but uses more a mesh technology. It is proprietary and more expensive than X10.

    • Z-Wave
      Proprietary wireless home automation.

    • UPB
      Similar to X10 but not nearly as popular.

    X10 Pitfalls

    X10 Summary

    Simply put, X10 is made up of Controllers and Modules. Controllers broadcast signals to modules through your homes electric wiring and the modules change state when they receive a command addressed to them (ON/OFF). There is also a RF standard for X10 controllers, meaning that you can issue X10 commands using a RF remote control.

    Signal Loss/Filters

    X10 has a bad reputation for not working. The main reason it doesn't work is because there is noise on the line. You get noise on the line when you have something plugged causes interference, like a TV, Fridge, or Computer. In order to ensure reliable signal transmission you need filters on these devices.

    Here are some links to some filters:
    http://www.smarthome.com/1626/FilterLinc-Plug-In-X10-Noise-Filter/p.aspx
    http://www.smarthome.com/1626-10/FilterLinc-10-Amp-Plug-In-X10-Noise-Filter/p.aspx
    http://www.smarthome.com/4845ACF/15-Amp-Plug-In-Noise-Filter-AF120/p.aspx

    Reaching all Modules/Phase Coupler

    If your in North America (and most likely other countries) you might find it is impossible to control all of your modules from one controller, from one location. In short your 120V is divided into two phases and signals from controllers plugged into one phase cannot "jump" to the other phase.

    You can read more about it here:
    http://kbase.x10.com/wiki/Phase_Coupling

    The easiest solution I have found in a Phase Coupler that plugs into your dryer outlet. Below is the link:
    http://www.smarthome.com/4816A2/SignaLinc-Plug-In-Phase-Coupler/p.aspx

    Computer Driven Home Automation

    Controllers

    If you get into X10 and get a collection of modules working the next step is of course to hook it up to your computer. The first thing you are going to need to do is connect your computer to your X10 system. There are several different components that can do this. Here is a short (most likely incomplete) list.

    Internet searches return many more results. Most of the controllers that come back are USB Insteon controllers that are backwards compatible with X10.

    Software

    There are many, many different home automation packages. Here is a short list of some of the major names:

    I personally use X10Server. It has the basic functionally I was looking for. Client/Server app and it allows you to schedule jobs in a ini file. And it is pretty simple to use. The only setback is that it is difficult to get running. It has very specific JVM requirements.

    Conclusion

    Home Automation is very time consuming, technically complicated, and somewhat expensive. Despite a lot of hard work X10 systems can still become completely unreliable if you plug a appliance that creates a lot of noise on the line. But if you enjoy messing around with technology and look at these types of projects as entertainment it can be pretty fun!

    Hopefully you have found this guide useful.

    Posted Oct 28 2009, 11:27 AM by mike.clarke with no comments
    Filed under:
  • IP Cam Streaming to Blackberry

    IP Cam Streaming to Blackberry

    So you have a IP Cam and that's pretty neat. But now you want to be able to check in on it from your Blackberry. Well get ready, this is going to be crazy.

    Before getting into it, it might be worth it to review the following:
    (Terrible) Adventures with WVC54GC IP Cam
    (Notice the word Terrible)

    Review of Streaming Technology

    Understand some of the following:

    RTSP: This is a protocol for streaming media to clients. It works like HTTP over Port 554. The client makes a request and the Streaming Server responds.
    RTP: Protocol used to deliver audio and video. RTSP goes over RTP.
    3GP: This is a container format for the stream that the Streaming Server sends out. Most phones (like the Blackberry) support 3GP.
    Darwin Streaming Server: DSS is a streaming server that supports 3GP. A streaming server is like a web server but for streams.
    Windows Media Services: We aren't going to use this but I just included it to illustrate that there are different streaming servers.
    VLC: Amazing media player among many other things.
    SDP: This is file that VLC spits out to describe the outgoing stream to DSS.

    Blackberry Support Streams

    Review the following:
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB05482&sliceId=SAL_Public&dialogID=185006185&stateId=1%200%20185004605

    According to that, all Blackberries support RTSP, 3GP and MPEG4.

    Solution

    The easiest solution is to buy a pricey IP cam that supports MPEG4 stream. Many do as viewing the cam on your phone is a attractive feature. But if you cheaped out (like me) you will need something else:

    VLC is going to pull in the stream from the cam, transcode it to MPEG4, write out the transcoded stream using RTP to DSS (announce itself to DSS). The Blackberry is going to make a request to the streaming server (like a browser request) and boom! If everything goes well the DSS will serve up the live stream.

    Alternatively, VLC has a web server (a streaming server) built into it. I couldn't find any documentation on that, but it may be possible to use VLC instead of DSS.

    Install and Configure DSS for Windows

    1. Download and install ActivePerl
    2. Download and install DSS

    DSS requires ActivePerl to run the web based admin console. ActivePerl can be downloaded from here:
    http://www.activestate.com/activeperl/

    Download DSS for Windows here:
    http://static.macosforge.org/dss/downloads/

    Here is a guide on setting up DSS. Get it installed and tested:
    http://generally.wordpress.com/2007/08/07/how-to-setup-darwin-streaming-server-on-windows/

    Install VLC for Windows

    VLC for Windows can be downloaded here:
    http://www.videolan.org/vlc/download-windows.html

    Configure VLC to RTS to DSS

    Review the following:
    http://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line

    Start VLC in command line mode with all the parameters to create a sdp in the media folder of DSS.

    This one line took me a very long time to figure out. I wanted to run this on Ubuntu but I could never get it to run stable. Oddly enough it works perfectly on Windows.

    Replace http://192.168.0.152/img/video.asf with the URL with whatever stream comes out of your IP Cam.

    Test the Deployment

    Open up Quicktime and open up the URL rtsp://server/stream.sdp if it works, try it on your Blackberry!

    Conclusion

    Hope you found this guide useful.

  • Installing pkgutil and webmin on Solaris

    Installing pkgutil and webmin on Solaris

    pkgutil

    blastwave.org is a group of people who create Open Source software packages for the Solaris Operating System. Ensure you the right package for your Architecture.

    They use to provide a tool called pkg-get to download Solaris packages, but that tool fell into legal troubles and has now been abandoned. The replacement tool is called pkgutil. It can be downloaded here:
    http://www.blastwave.org/howto.html

    It can be installed using the following:

    If you add /opt/csw/bin path you can use pkgutil and all the software downloaded from blastwave.

    webmin

    webmin is great web management console for administering unix machines brought to you by the good people of http://www.webmin.com/. There is Solaris package of it that can be downloaded and installed. Ensure you the right package for your Architecture.

    You can then access webmin web console using the following URL:
    http://servername:10000

    See http://www.webmin.com/solaris.html for more details.

    Login using your root (or equivalent) username and password.

  • Playing Worms Armageddon over the Internet

    Playing Worms Armageddon over the Internet

    Worms Armageddon is a great game. Maybe you played in University over LAN and now you want to play it over the Internet. Inside Worms there are two multi player options: LAN and WormNET.

    I have no idea what WormNET is, I've never been able to make it work. This guide is going to explain how to play a LAN game over the Internet.

    LAN's and Worms

    A LAN is a group of computers connected to each other that can talk to each other. LANs are great for gaming and a LAN is required for Worms multi player.

    When you have the Internet in between a bunch of computers, the LAN model doesn't work anymore and neither does multi player worms.

    So the answer is obvious, make a LAN over the Internet. This can be done through Virtual Private Networking (VPN). VPN is the technology that allows you to create LANs over the Internet.

    Playing Worms Armageddon over the Internet

    Hamachi is a free VPN service that works really well for gaming because it route's UDP packets, something that not all VPN does, like PPTP. So download and install Hamachi. You can download Hamachi here:
    https://secure.logmein.com/products/hamachi/vpn.asp?lang=en

    Once you've downloaded, installed, configured Hamachi it creates a additional NIC on your computer. This NIC is going to used in the VPN connection and is going to fool Worms into thinking it is on a LAN -- so you can player LAN games over the Internet.

    So in Hamachi you can make password protected groups. These groups are your LAN, you can create a group and send the name and password to your friends and instand LAN, instant worms LAN party.

    Multi Homed PC's and old Games

    So with Hamachi installed you will have at least two NICs. Some old games don't function right with two NICs installed. They don't know which NIC to use. I think worms is one of these games. I'm not sure, but this will ensure that it will definately work.

    Download this program called ForceBindIP. Get the ForceBindIP-1.2-Setup.exe. It can be downloaded here:
    http://www.r1ch.net/stuff/forcebindip/

    So ForceBindIP makes a program only see one NIC. We are going to use it force worms to only see one NIC.

    So create a new Windows shortcut and in the location of the item type the following:

    %windir%\system32\forcebindip.exe HAMACHI_IP "C:\MicroProse\Worms Armageddon\wa.exe"

    But replace HAMACHI_IP with the IP address you got from Hamachi.

    Update Worms

    Worms v3.0 crashes for me when using my Hamachi shortcut. You need to get the latest patch to make it work. The latest version of worms is v3.6.29.0 Beta. The patch can be downloaded here:
    http://wormsarmageddon.team17.com/main.html?page=supp&area=upda&file=15

    Install it.

    Worms!!!

    Finally, get on Skype, connect up with Hamachi, start worms through the customer shortcut and let the sheep fly!

    Posted Jul 26 2009, 10:14 PM by mike.clarke with 7 comment(s)
    Filed under: ,
  • Running Mecury Mail as a Service

    Running Mecury Mail as a Service

    Mercury mail is a great, free mail server that can be used for dozens of things. Unfortunately the free version does not run as a a service.

    This post will explain how to run the free version of Mercury Mail as a service. This procedure could be extended to run other processes as services as well.

    Creating a Customer Service

    Review the following KB article:
    http://support.microsoft.com/kb/137890

    In short, you can use Instrsrv.exe to create your own services and srvany.exe to start executables. Instrsrv.exe and srvany.exe are included in the Windows Server 2003 Resource Kit Tools which can be downloaded here:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en

    Both instsrv.exe and srvany.exe have worked for me on x64 Server 2008

    Creating the Mercury Mail Service

    Create a folder called service in your MERCURY installation folder. Copy instsrv.exe and srvany.exe. Create to batch scripts, call one service.bat and the other remove.bat. You should have something that looks like this:

    Add the following to service.bat (this batch file will create the service)

    Add the following to remove.bat (this batch file remove/uninstall the service)

    Next run service.bat. This will create the service entry.

    The final step is to setup the registry for srvany.exe. Create the following keys and values:

    Finally start up the service.

    Be careful not to start Mercury in the native app mode while the service is running, or you might make it angry. The best way to do it is to stop the service, launch Mercury, make your configuration changes, close Mercury, restart the service.

    Conclusion

    Hope you found this information useful!

    Posted Jun 15 2009, 02:24 PM by mike.clarke with no comments
    Filed under:
  • Using Your Laptop As A Wireless Router

    Using Your Laptop As A Wireless Router

    So for some reason you want to use your laptop as a wireless router.

    This can be done using the Windows Internet Connection Sharing feature. This guide will cover how to set it up for Windows XP. For more information see:
    http://support.microsoft.com/kb/306126
    http://en.wikipedia.org/wiki/Internet_Connection_Sharing

    If you review the above links you will see they don't mention how to use ICS to turn your laptop into a Wireless Access Point. So here how you do it.

    You cannot use ICS if the network you are sharing has a IP range of 192.168.0.*

    Step 1 - Create Your Wireless Network

    Create your Ad Hoc wireless network

    I personally like WPA because I find WEP keys very hard to remember.

    In order to make this connection always available, ensure the following setting.

    Step 2 - The Big Secret

    In order for ICS to work with your wireless NIC you must set your wireless NIC with the following static settings:

    Thank you so much to this post!
    http://shepherdnick.wordpress.com/setting-up-a-pc-as-a-wireless-router-using-ics/

    You will need to change this back to use any other wireless network with your laptop.

    Step 3 - Enable ICS

    On your physical network (the connection you want to share) enable ICS

    Step 4 - Start Using Your Network

    Join your wireless network the way you would join any other wireless network.

    Unanswered Questions

    I'm not sure if it is possible to not broadcast the SSID of your network. I was unable to locate any information on this. If anybody know please but it in the comments.

    Conclusion

    Hope you find this guide useful. You wouldn't believe how long it took me to figure this out.

  • 32bit Windows Memory and Java

    32bit Windows Memory and Java

    Understanding 32bit process limitations in Windows is complex. The following is a quick run down of basics, followed by a quick explanation of JRockit (and why it rocks!).

    The Problem

    Physical Address Extension

    So as you can see from above, Physical Address Extension allows a 32bit OS to address up to 64GB of RAM. 32bit Windows can in fact have up to 64GB of RAM depending on the version. See the following to learn about the memory limits of each version of Windows and PAE:
    http://msdn.microsoft.com/en-us/library/aa366778.aspx
    http://www.microsoft.com/whdc/system/platform/server/PAE/pae_os.mspx
    http://en.wikipedia.org/wiki/Physical_Address_Extension

    In short, if you run 32bit Server 2003 Enterprise you can put up to 64 GB of RAM in your machine (provided your hardware has PAE). From a process perspective, PAE is unimportant.

    Process Address Space (No /3GB switch)

    Now we talking about how much memory a 32bit process can use in Windows. By default without modifications the theoretical limit is 2GB. In practice the limit is usually around 1.5GB.

    This is because for a 32bit process Windows cuts the Process Address Space in half. Half goes to Kernal Memory (which a user process cannot use) and the other half goes to user mode (which you can use). It doesn't matter how much RAM is in the box, a 32bit process can only use 2GB of RAM. See below for more info:
    http://msdn.microsoft.com/en-us/library/ms189334.aspx

    Process Address Space (With /3GB switch)

    When you use the /3GB in the boot.ini what this does is it decreases the Kernal mode memory and increases the user mode memory. But there is a catch, the program must be compiled/linked using the /LARGEADDRESSAWARE switch.

    See the following under the Application Changes section:
    http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx

    Address Windowing Extensions

    The final thing is Address Windowing Extensions. This when a program is written to use more memory that what is in the Process Address Space. I think Exchange, and SQL have this ability. Below is more information:
    http://en.wikipedia.org/wiki/Address_Windowing_Extensions

    Summary

    Some hopefully that helps to focus what's going on with 32bit processes in Windows. If your into Java hopefully know your asking yourself is the JRE compiled with the /LARGEADDRESSAWARE switch?

    Finding the answer to that has proven very difficult, but the answer is a disappointing no.

    This is the best answer I could find. See:
    http://download.boulder.ibm.com/ibmdl/pub/software/dw/jdk/diagnosis/dw3gbswitch3.pdf

    This is the important part:

    So what does the /3GB switch do for Java then?
    The /3GB switch does enable the Java heap to grow a bit from a practical max of about 1.5 GB up to 1.7 GB or maybe even 1.8 GB. If you are already struggling to fit everything into your Java heap, the /3GB switch is not going to be of much help. The key advantage lies in the extra space available for threads (stack space), and native code (either for JIT’d code or application requirements).

    Below is another explanation:
    http://blogs.sun.com/moazam/entry/why_can_t_i_allocate

    JRocket

    JRocket is the Oracle version of the JRE. It is compiled with the /3GB switch. In addition it doesn't need a continues Process Address Space.

    Usually when the Sun JRE/JDK asks Windows for a ton of memory, say like 1.5GB. What it really says to Windows is I need 1.5GB of continues memory. This can be a hard order to fill for the OS depending on what it is doing at the time. JRocket doesn't require the memory be continues which is great!

    More information about JRocket can be found under the following links:
    http://www.oracle.com/appserver/jrockit/index.html
    http://www.oracle.com/technology/software/products/jrockit/index.html
    http://web.archive.org/web/20080119012415/http://dev2dev.bea.com/blog/hstahl/archive/2005/12/how_to_get_almo.html

    Just to illustrate that drastic difference you can get between the Sun JRE/JDK and JRocket below are some screen shots from a JBOSS server. The box has 5GB of RAM and the /3GB switch enabled. Using the standard JRE I can't start JBOSS with more than 1536MB of memory. Using JRocket I can start it with a whopping 2560MB of memory.

    With Sun JDK

    With JROCKET

    Conclusion

    JRocket kicks ass! Not only can it use more memory than the Sun JRE it's also optimized for speed!

  • Tomcat Authentication to Active Directory

    Tomcat Authentication to Active Directory

    Love IIS and its easy Authentication Model (Anonymous, Basic, Integrated)? Me too! The following post will, to the best of my ability, explain how to make Tomcat to Basic and Integrated Authentication to Active Directory (AD). It actually isn't to bad but the information is all over the place.

    In order to be successful at this you will need to have a good working knowledge of Tomcat. If you don't I suggest reading this:
    http://mystyleit.com/blogs/mystyleit/archive/2008/12/05/adventures-with-tomcat-5-5.aspx

    Tomcat LDAP Authentication to AD (aka Basic)

    If you have read the official Tomcat documentation, hopefully you know that we need to create a JNDI Realm. In this example we are going to create a Global Realm, the means it is going in the Service area of the server.xml.

    Here is the link to the official documentation:
    http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#JNDIRealm

    If you have read the documentation you will see that JNDI Realms support to modes, Bind mode and Comparison mode. Based on everything I have read, Bind mode does NOT work with AD. Only Comparison mode modes does.

    Creating the authentication is a two step process. The steps are:

    1. We must create a global JDNI Realm
    2. Create a security constraint in the web.xml (equivalent checking off the Basic Authentication check box in IIS)

     

    So lets have a look at a Comparison mode JNDI Realm. This would go in the server.xml:

    So lets have a look security constraint. This goes in your applications web.xml:

    Below is a link to a great MSDN web cast about setting up the same thing:
    http://blogs.msdn.com/alextch/archive/2007/06/25/configuring-tomcat-to-authenticate-against-active-directory.aspx

    Tomcat NTLM Authentication to AD (aka Integrated)

    Next up is setting up Tomcat to use NTLM authentication (aka Integrated). This one is more complicated.

    NTLM

    NTLM is complicated stuff. In short there are two versions of NTLM, NTLMv1 and NTLMv2. NTLMv2 is the good stuff. NTLMv1 is the bad stuff. If you would like to know more I recommend reading the following:
    http://en.wikipedia.org/wiki/NTLM
    http://technet.microsoft.com/en-us/magazine/2006.08.securitywatch.aspx

    JCIFS

    JCIFS is a open source client library that can do all sorts of things, including to NTLM Authentication for a web app. See the following:
    http://jcifs.samba.org/
    http://jcifs.samba.org/src/docs/ntlmhttpauth.html

    Deploying JCIFS

    There are many deployment scenarios for JCIFS. The deployment I'm covering getting JCIFS to Authenticate against a Network Share. In this approach you create a secure network share, only the users who have access to the network share can access the web site.

    The installation has several steps:

    1. Create a secured share and secure using NTFS permissions
    2. Download the jcifs.jar and copy to the lib folder of your web app
    3. Create the JCIFS filter in you web app's web.xml file

    This guide is not going to cover how to create a network share. So look elsewhere.

    Let's have a look at the JCIFS filter we need to create in the web.xml:

    For more information see:
    http://jcifs.samba.org/src/docs/ntlmhttpauth.html#install

    The above configuration works on my Server 2008 native domain with no change to the Domain Security policy.

    Conclusion

    When I went to set all this up myself the first time I had a really hard time finding examples of configurations. Hopefully these examples are helpful to you.

  • (Terrible) Adventures with WVC54GC IP Cam

    (Terrible) Adventures with WVC54GC IP Cam

    I was looking for a new, relatively inexpensive, gadget for my house. I was looking at the flyer for Canada Computers and there was a deal on a Linksys WVC54GC IP Cam. So I figured OK.

    Anybody who has bought a WVC54GC knows that this IP Camera has a complicated setup and not to many features. I learned this the hard way. The positive thing about this camera is that, if your crafty, you can make it do everything with a lot of work. What following is the things I managed to make mine do.

    Streams Coming out of the Cam

    The cam has three streams coming out of the cam:

    • http://[camera address]/img/video.asf [ASF Stream]
    • http://[camera address]/img/mjpeg.jpg [Motion JPEG]
    • http://[camera address]/img/mjpeg.cgi [Motion JPEG]

    Opening one of the Steams

    The cam is designed to be used either through Internet Explore (via ActiveX control) or using the Linksys IP Cam think client, available for download here:
    http://www.linksysbycisco.com/CA/en/support/WVC54GC/download
    The Setup Wizard is actually the Think Client

    However the above mentioned streams can also be directly opened in VLC. VLC is a cross-platform media player and streaming server.
    http://www.videolan.org/vlc/

    Capturing a Still Image from the IP Cam

    So as complained about by many, the Cam cannot capture a still jpg. Can't do it. The WVC54GCA can but not this guy. Plus it needs a ActiveX control to view anything so, checking in on the cam from any browser just isn't possible.

    Solution

    So here starts the terrible adventure. There are ton of open source encoding tools that can literally do everything in the right hands. As with most open source projects, they are not that polished and more geared for Linux users. One of them is mplayer.exe. The mplayer project can be found here:
    http://www.mplayerhq.hu/

    As you may have noticed, only the source code is available. Thankfully, somebody has compiled it for Windows and posted it here and lots of other places:
    http://majorgeeks.com/MPlayer_d5663.html/

    So it is possible to grab a frame from the stream as a jpeg using the following mplayer.exe command

    I got this info from this guy:
    http://www.infohit.net/blog/post/using-linksys-wvc54gc-webcam-with-linux.html/

    I took this caputing a jpg from the cam one step futher. I wrote a .NET/C# app to execute a batch script (that contains the above command). This bascially creates a event driven web site that can display a still from the cam. This is a very rough app. This app requires framework 2.0.

    This small (and terrible) little app can be downloaded here:
    http://mystyleit.com/downloads\blogs\TerribleAdventureswithWVC54GCIPCam/poll.zip

    Capturing a Video from the stream

    The next thing I wanted to do with this cam was to capture a video at a specific time. This can be done through the Thick Client but I really don't like the included scheduler. I'd prefer to do it with a batch script stuffed into the Windows Scheduler.

     

    Solution

    A command line solution does exist using a open source project called ffmpeg. The ffmpeg project is located here:

    http://www.ffmpeg.org/

     

    Like mplayer this project doesn't come compiled (and not compiled for windows for sure). Luckily somebody else has compiled it and this is located here:
    http://www.videohelp.com/tools/ffmpeg

    Most of this cam from this post:
    http://www.infohit.net/blog/post/using-linksys-wvc54gc-webcam-with-linux.html/

    A asf file should be able to play in Windows Media Player without issue. I suppose you could re-encode the file to a mpeg or something else depending on your requirements.

    Transcoding to Flash

    This is where things go terrible. So what if you want to see the stream in a browser but don't want to install the ActiveX control? Well you can do on the fly transcoding to a different stream type, like flash

    According to this this you should be able to open the asf stream in a embedded media player, but I was never able to make this work.

    I believe this CAN be done through VLC but I have not been able to figure out how, or been able to find any posts about how to do this whatsoever. If anybody knows how please comment on this post or send me a message here. See link below for more information about VLC:
    http://wiki.videolan.org/Flash_Video

    If however you are game, this can be done through ffserver. To the best of my knowledge there is no port of ffserver to Windows. I am unsure if it can be compiled for Windows through Cygwin. I tried but get the same errors as everyone else. Ever post I found did not have a solution. If you are looking for a guide to proceed this is the best I have found:
    http://www.infohit.net/blog/post/motion-capture-using-the-wvc54gc-with-linux.html
    http://ubuntuforums.org/archive/index.php/t-665607.html

    Here is a excellent guide on how to install ffmpeg (and ffserver) on a Ubuntu box:
    http://ubuntuforums.org/showpost.php?p=6963607&postcount=360

    If you can follow all that, if you add the following to your ffserver.conf file, you'll get a swf stream out that you can open in a browser.

    If you put something like the following in a page, you should be able to open the swf stream:

    See the following for more information:
    http://ubuntuforums.org/showthread.php?t=665607

    Again, I think it should be possible to do the transcode through VLC but I have not be able to figure it out. Hopefully somebody can post some tips about this.

    Running FFMPEG using a Script

    The FFMPEG process needs a terminal to run. In addition it seems to crash every 5 to 6 hours. Ideally you would have a cron job to monitor the process but running FFMPEG in a script can be tricky. It can be done using the screen command.

    Here is my cron job script which I have scheduled to run every hour. I kill FFMPEG because I found that sometimes the process was still running but not working. This way I can ensure that I will always get a stream.

     

    Conclusion

    Streaming media is complex. I much prefer web and app servers!

  • Adventures with Tomcat 5.5

    Adventures with Tomcat 5.5

    Tomcat has one main configuration files: server.xml. There is also another very misunderstood file web.xml that I will talk about too.

    server.xml contains all the parameters of the Tomcat instance. The file has the following "big parts":



    NAME FUNCTION CAN CONTAIN
    Server Represents Tomcat itself Service, Listener, GlobalNamingResources
    Service Groups Connectors that share an Engine. One or more Connectors followed by one Engine, Listener
    Engine Handles all requests. Host, Realm, Valve, Listener, Cluster
    Host One "virtual host". Alias, Context, Realm, Valve, Listener, Cluster
         
    Context Configures one "web application" within a host. Loader, Manager, Realm, Resources, ResourceLink, WatchedResource, Environment, Value, Listener

    Now let's talk about the most important/common questions about the file, Connectors and Realms (ie Authentication).

    Minimal server.xml File

    You should use the default server.xml file, this is only presented in order to get familiar with it's layout.

    Connectors

    Tomcat has this idea of Connects, each Connector allows Tomcat to speak a different language, HTTP, or AJP, or HTTPS. The default Connectors are HTTP (on port 8080) and AJP (port 8009). AJP is what IIS or Apache talk to Tomcat on (when you have a web server sitting in front of Tomcat).

    One important trick with the AJP connector is to turn off Tomcat Authentication when you have another web server sitting in front of Tomcat performing the authentication. To do this, add the following to your AJP connector entry:

    SSL Connector

    In order to have an SSL connector, you need to have a keystore that contains a SSL certificate. Here is a link to how to create a keystore, and other keystore tasks (import, export, etc):
    http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html

    Here is a link to a GUI interface to the keystore, requires Java 6 and very handy:
    http://yellowcat1.free.fr/

    So (hopefully) you have a keystore with a key inside (the default self-signed key or something else). Now you need to add the SSL connector. It should go with the other connectors in the Service section and looks something like this:

    In order to require SSL on a specific site, you need to configure a security constrant for that app. You can do this by editing that app's web.xml file (see below). The constrant looks like this: >

    Deploying Web Appls and the web.xml File

    Hopefully the above explains the server.xml enough to grasp what Tomcat is doing. The important thing to realize is that different sections of the file have differents scopes. The futher down you go, the narrower the scope.

    Tomcat, like Apache, has this idea of a Virtual Host. Basically it allows you to run serveral different sites on the same port (either 80 or 8080). This post isn't going to cover all that. Instead, just realize that localhost is the default host.

    In order to deploy a web app that isn't a WAR file (beyond the scope of this document) you need to create a context for it. You can either create the context in the host section in the server.xml (which is bad because it makes the file more complicated) or you can create a seperate xml file in the host folder, under the Engine.

    The default host folder, (under the default engine) is of course:
    \Tomcat 5.5\conf\Catalina\localhost

    You should name the xml file will of the directory in the URL.
    If I created \Tomcat 5.5\conf\Catalina\localhost\myapp.xml the URL for this application http://site/myapp

    A very simple context looks something this:

    For more about contexts see the following:
    http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

    What about the web.xml?

    Every web application is going to have a WEB-INF folder. In the above example, this would be C:\myapp\WEB-INF. Inside the WEB-INF folder is a file, web.xml.

    The web.xml file in the WEB-INF folder of your web app is used to configure that web app. That is it's scope ONLY.

    The web.xml file in Tomcat 5.5\conf is the global web.xml file. It is processed before it reads the WEB-INF\web.xml file in the app's docBase. You can override what is in the Tomcat 5.5\conf\web.xml by setting knew values in the WEB-INF\web.xml.

    So (hopefully you have guessed this) you shouldn't mess about with the Tomcat 5.5\conf\web.xml file. It's way better to mess around with the web.xml in WEB-INF\

    Realms (Tomcat Authentication)

    Unlike IIS, Tomcat has many, different (and complicated) authentication methods. They call them Realms.

    The steps for securing a web app is first to have a Realm setup in the server.xml file. The second is to create a security constrant in the app's web.xml file.

    Going over how to create all the security constraint's is what Google is great for. The important thing to know about Realms are:

    • You make them in the server.xml file
    • Where you put them affects their scope (ie which applications can use the Realm)
    • When in doubt, put them under the Engine, that way every app run by that engine can use them.

    Here is a link that covers all of Tomcat's Realms:
    http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html

    Conclusion

    I love IIS. Unfortunately it doesn't run JSP and Servlets so you need an Application Server.

    Posted Dec 05 2008, 05:03 PM by mike.clarke with no comments
    Filed under:
  • Adventures with x64 IIS

    Adventures with x64 IIS

    Recently I had to deploy 32 bit application on a Windows x64 bit OS. This post raps up some of the things I found along the way.

    ISAPI Filters

    The application supports an ISAPI filter, but the filter is only 32 bit, therefore it doesn't work without modification. If you google this subject you might find this Microsoft KB article:

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true

    This is only a very small part of the entire story. In order make x64 IIS use x32 ISAPI DLLs you need to do the following:

    1. Uninstall ASP.NET x64 (As if you switch x32 this will cause IIS to crash (ie: Service Unavailable Error)
      To uninstall ASP.NET x64 open a command line window and navigate to:
      C:\WINDOWS\microsoft.net\Framework64\v2.0.50727
      Then execute the following command (this will uninstall ASP.NET x64):
      aspnet_regiis -u

    2. Now we will execute Microsoft's command, but you need to make sure you define the location of adsutil.vbs. If you haven't moved/deleted the file, the command should be:
      cscript c:\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32BitAppOnWin64 1

    3. Finally, we will install ASP.NET x32. To install ASP.NET 32 bit open a command line window and navigate to:
      C:\WINDOWS\microsoft.net\Framework\v2.0.50727
      Then execute the following command:
      aspnet_regiis -i

    Okay, that was the first hurdle I had to get over.

    Apache Tomcat Connector

    So the application was deploying also has an Application portion part to it. Therefore I needed to make IIS play nice with Tomcat.

    Here are the useful websites:
    http://tomcat.apache.org/connectors-doc/
    http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

    You will need to use the x32 version of isapi_redirect.dll as we just switched IIS to x32 bit

    You will also need to create the registry entries under Wow6432Node.

    In short, the connector is controlled by two files, workers.properties and uriworkermap.properties.

    workers.properties controlls the worker process. I have never needed anything more then the default/sample configuration:

    # workers.properties.minimal -
    #
    # This file provides minimal jk configuration properties needed to
    # connect to Tomcat.
    #
    # The workers that jk should create and work with
    #

    worker.list=wlb,jkstatus

    #
    # Defining a worker named ajp13w and of type ajp13
    # Note that the name and the type do not have to match.
    #
    worker.ajp13w.type=ajp13
    worker.ajp13w.host=localhost
    worker.ajp13w.port=8009

    #
    # Defining a load balancer
    #

    worker.wlb.type=lb
    worker.wlb.balance_workers=ajp13w

    #
    # Define status worker
    #

    worker.jkstatus.type=status

    The other file, uriworkermap.properties, controlls the mappings, ie what things get forwarded to tomcat. Entries look like this:

    /directory/*.do=wlb

    In this case, everything in http://site/directory ending in do would be forwarded to tomcat.

    Performance

    My site in running under Hyper-V (which is really awesome, blows VMware Server out of Water). I'm not sure if it's because Java doesn't play nice with VMs, or something else. But every time Tomcat loaded my site, the CPU went crazy! I tried different versions on Java, and it still went crazy. The fix was NOT to install the native DLL.

    URL Redirection

    Finally, I needed to make a URL redirector. Nothing fancy, but here it is:

    In order for it to work, you will need to enable the Active Server Pages Web Service Extension.

    Conclusion

    Hope this information helps somebody fix something.

    References

    Posted Nov 13 2008, 05:35 PM by mike.clarke with 5 comment(s)
    Filed under: ,
  • MSCS Roundup

    MSCS Roundup

    This article links to all the useful resources I have found that relate to Microsoft 2003 Failover Clustering.



    MSCS Terminology

    This article defines MSCS terminology:
    http://technet.microsoft.com/en-us/library/cc757640.aspx



    Server 2003 Cluster Models

    There are 3 Cluster Models with Windows Server 2003.


    Model 1: Single Node Cluster


    In short, this Cluster Model would most likely only be used for testing.

    Model 2: Single Quorum Cluster


    Standard, Active/Failover (or Active/Active) Cluster.
    What most people thing about when they think of MSCS Clustering.


    Model 3: Majority Node Set


    Not common
    Most likely used only by software designed for this type of cluster.


    Model 4: [NEW] Majority Node Set (with a Witness)


    See this KB for more information:
    http://support.microsoft.com/kb/921181


    Additional Information

    This article explains the models in greater detail:
    http://technet.microsoft.com/en-us/library/cc739522.aspx


    Server 2008 Cluster Models

    Cluster Models in Server 2008 have changed from Server 2003. A full discussion is beyond the scope of this post, but here is a link that discusses them further:
    http://technet.microsoft.com/en-us/magazine/cc672627.aspx


    Deploying a Single Quorum Cluster

    This is the best guide I have ever found:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=A5BBB021-0760-48F3-A53B-0351FC3337A1&displaylang=en



    Installing SQL Server 2005 into a Failover Cluster

    This article isn't very good, but it is the Authoritative document:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=818234dc-a17b-4f09-b282-c6830fead499&displaylang=en



    Installing IIS into a Failover Cluster

    Here are the best articles I have found:
    http://support.microsoft.com/kb/887417
    http://support.microsoft.com/kb/248025



    Clustering Other Things

    Instructions about how cluster other services:
    http://technet.microsoft.com/en-us/library/cc757729.aspx

    Posted Nov 10 2008, 04:23 PM by mike.clarke with 1 comment(s)
    Filed under:
  • Creating a UNC Alias for a Windows 2003 Server

    Creating a UNC Alias for a Windows 2003 Server

    There are many reasons my you make want to make a CNAME/alias for a Windows 2003 File Server. These might include ensuring old shortcuts work after a server migration, you might have an application with UNC paths embedded that are very difficult, or impossible to change.

    The Problem

    Assuming that you have your DNS CNAME created properly, when you try to open the UNC with you'll be asked to Authenticate, (which shouldn't happen)

    And even when you try to login, it doesn't work.

    The Fix

    In order to allow a Windows File sever respond to a alias you need to disable some security by way of editing the registry. These keys need to be created (or editted):

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]
    "DisableStrictNameChecking"=DWORD:00000001

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
    "DisableLoopbackCheck"=DWORD:00000001

    More Information

    Here are the links to the offical KB articles.

More Posts Next page »