Archive for the ‘Sys Admin’ Category

iSync and MS Exchange

Thursday, January 15th, 2004

Remember how I was complaining about what a pain it is to keep my address books synchronized? At work I have my Microsoft Exchange contact list that I use with my dell laptop and Compaq iPaq handheld. At home I have my Apple Powerbook which connects with my t68i cell phone via bluetooth. In other words, I’ve basically been trying to keep 2 address books synchronized, by hand. My method was to use my Exchange account as the master and occasionally export it to a file, wipe out all the contacts on my powerbook and phone, import the file I created from exchange into my “Address Book” on my Powerbook and then sync it to my phone. A few problems I’ve run into with this approach:

  1. I can’t update anything in my phone or on my Powerbook because it’ll eventually get wiped out and replaced with what’s on the Exchange server.
  2. My Powerbook and phone are often out of date because I only do an import every month or two. The out of date Powerbook I could live with, but the phones become a real deal breaker.

Those are basically the only two issues, but they’re big ones. Well, tonight I was thinking it was about time to do another import and I was looking around in “Address Book” on the Powerbook and noticed a setting in the preferences that says “Synchronize with Exchange”. WHY WHY WHY did I not find this sooner? I punched in my Exchange server connection settings, opened iSync, clicked “Sync” and voila. Everything synchronized, the Exchange server, Address Book, cell phone, EVERYTHING! Everything stored in one central location, ya can’t beat it. Well, actually you can, it only works with Address Book, not iCal. I can live with that, I’ve never been concerned about having my calendar on my Powerbook but it would be nice.

P.S. Is it sad that I get excited about things like this? Yeah, it probably is.

Coldfusion MX 6.1 Upgrade Continued

Sunday, December 28th, 2003

I’ve been procrastinating finishing my upgrade entry because one of the problems I ran into was a little troublesome to fix. If I was smart I would have made the upgrade entry immediatlely after I fixed it, while the problem and solution was fresh in my mind. Now that a few weeks have passed I can’t recall all the details so you’re going to get a watered down explanation of what I did.

Basically, after the upgrade, all credit card processing on our site went down. Fortunately it’s not something we use a lot on our site but it was still important to have fixed. I isolated the problem to the COM object we were calling to do the processing. Basically we just initialize the object with the server name, port number, credit card information, etc and the object connects to the credit card server and takes care of the rest. After the upgrade, the code that set the port number was throwing a mysterious error. Something like “VT_22 unsupported” or something along those lines. I discovered that MX seems to have a problem with passing integer arguments to COM objects. Passing something like: MyObject.ServerName(”someserver.somedomain.com”); would work fine. However, MyObject.ServerPort(5555); would throw the error. I checked around the Macromedia forums and only found a few vague references to the problem but no solutions. Finally I came across a page that described a way to create a Java stub for a COM object. Basically creating a java class that will interface with the COM object. So instead of calling the COM object directly within the code you call the Java object. Information on how do this can be found here.

The original code looked something like this:

<cfobject type=”com” action=”create” class=”MyComObject.Foo” name=”MyComObject”>

using the java stub it looked something like this:

<cfobject type=”java” action=”create” class=”MyComObject.Foo” name=”MyComObject”>

Fortunately the credit card processing was contained in a custom tag so I only had to modify the one line in the custom tag, after I created the java stub of course, to have everything working. Incidentally the next day I came across a “” that from reading the description appears to solve the problem. However, the hotfix was released the day before I created my java stub and I didn’t find it until after the problem was resolved. I haven’t applied the hotfix or tested it to see if the COM objects work with integers. However, if you’re having this problem I would definitely try the hotfix first before creating the stub since you shouldn’t have to modify your code and it’s probably much simpler than creating the stub.

The last nagging problem we’ve had with the upgrade is mysterious “null null” errors. Quite a descriptive error isn’t it? We’ve isolated a few of the causes to improperly used date functions (such as creating a date with 0 for the month, apparently this worked in 5.0 but now causes a null null error in MX). However, we’re getting the error seemingly at random in a few pages that don’t use any date functions. I suspect it has something to do with cookies since clearing the cookies on the client has solved SOME of the errors. I still haven’t been able to erradicate the error completely. It’s difficult since the error isn’t descriptive at all, null null gives me no clues about what’s causing the problems. The line number the error is reported on is also wrong (a few null null errors have been reported on blank lines or lines that are only comments). Debugging the error is truly like searching for a needle in a hay stack.

Even with the problems I had with the upgrade I’m still impressed with a few of the additions to MX. I wrote my first application the other day using a a cfc. Being able to remove the business logic from the display code made for a much cleaner implementation which I expect will utlimately make it easier to maintain and scale. Now if I can get the rest of my team to use it correctly we’ll be in good shape.

ColdFusion MX 6.1 Upgrade

Monday, December 15th, 2003

As I mentioned earlier I upgraded our server at work to ColdFusion MX a few weeks ago. It went alright, not exactly a painless process but for the most part I think we’ve resolved the problems that occurred as a result of the upgrade.

Before I did the upgrade I documented all the ColdFusion Administrator settings. This came in very handy because the passwords for all the datasources were dropped. I had to go in and enter passwords for all the datasources, not a big deal but it could’ve of been if I had upgraded and didn’t know what one of them was. For some reason I’m still having problems with the datasource passwords but it’s more of an inconvenience so I haven’t researched it. Basically anytime I change a datasource I have to reenter the password. For instance, say I want to add “insert” capability to a datasource. I click on the datasource in the Administrator, check the “insert” box and click “Submit” and suddenly I have a datasource that won’t verify. I go back in, type in the password, click submit and all is well. I’m not sure why it updates the password when I haven’t modified it but that seems to be what it’s doing; updating it to the wrong password of all things. Like I said, more of an annoyance than a real problem.

Also with the datasources I had to change all of our MySQL ODBC datasources to JDBC. I’m not sure why but the ODBC datasources were returing empty query results. I copied a few of the queries into a MySQL terminal and got results. The datasources verified fine so I was sure it wasn’t a connection issue. Rather than try and figure out why this was happening I just upgraded to the JDBC driver that comes with MX, that seemed to solve the problem.

One pesky little problem (feature?) I discovered a while after the upgrade was the change of the “encoding” to UTF-8. In 5.0 I believe the default encoding was IS0-8859-1, in MX it’s UTF-8. The problem is UTF-8 is much more limited than IS0-8859-1. So any page that included directed quotes, m dashes and similar characters appeared with question marks where the characters were. There’s a few portions of our site where the content is entered by the communications staff which means they basically copy what they’ve typed in Microsoft Word and paste it into a form which is submitted to the database. Word uses the ISO-8859-1 character set so you can end up with quite a few question marks scattered in the content. I figured the easiest thing to do was change MX to use ISO-8859-1 as the default encoding. Not as simple as you might think. Initially I just looked for the setting in the Administrator, but didn’t find anything. Eventually I found a tip that indicated including -Dfile.encoding=iso_8859_1 in the JVM Arguments in the Administrator under the “Server Settings > Java and JVM” page would solve the problem, it didn’t (although I didn’t notice it corrected the problem on a few pages). I found another tip that said to modify the %MX_Root%/lib/neo-runtime.xml file and add:
<var name=”defaultCharset”>
     <string>ISO-8859-1</string>
</var>
within the <struct type=”coldfusion.server.ConfigMap”>
tag. That seemed to solve almost all of the problems except for a few. The few remaining were on pages that pulled content from the database. Long story short, you need to add this: useUnicode=true&characterEncoding=iso-8859-1 to your JDBC connection string for your datasource if you plan to use ISO-8859-1 with the datasource. That’s quite a few changes just to get back to the default encoding that was used by ColdFusion 5.0.

There’s still a few other problems (more serious) we had but this entry is getting to be a little lengthy so I’ll save them for another time (actually I’m tired and I just want to go to bed).

UPDATE: To read about the rest of the upgrade go here.

Mozilla vs IE and Safari (tip: Using System Default Mail Program with Mozilla)

Tuesday, December 2nd, 2003

When I got my powerbook I switched from using Internet Explorer to Safari solely because Safari had tabs and IE didn’t. I was happy with Safari but then heard rumors it suffers from a memory leak. I decided to continue using Safari, once again, solely because of the tabs. At about this time I got my new x86 laptop at work with Windows XP which means I was back to IE (at work anyway). Honestly it drove me nuts opening a new window for every page I wanted to view. Not too mention when you open 3 or 4 windows of the same program in XP they scrunch together as one on the task bar, making it cumbersome to navigate between them.

A guy I work with recommended Mozilla and when I realized it had tabs I was sold. I installed it on both my Powerbook and Dell D600 and have never gone back or felt the need to try anything else. The only thing that’s been annoying me is when I click on mailto links, it tries to open the Mozilla mail program (composer). I’ve searched the “Preferences” window repeatedly for a setting to “Use the system default mail program”. Tonight I finally decided to search Mozilla’s site, figuring at least a few other people have found this annoying. Sure enough I found the solution. Now my web browsing world is perfect.

Mozilla also comes with a built-in Javascript Debugger, very nice for a web developer. Also, since I’ve started doing full time web development I’ve gained a greater loathing for IE. The behaviour amazes and disgust me at times.

For example, today I was tweaking a page for a new site I was working on. Basically I copied a template from another of our sites and proceeded to change the graphics, menus, etc. On the top of the page there was a logo graphic 90 pixels tall, to the right was another graphic that was 70 pixels tall and another below it 20 pixels tall (all with borders=”0″). It looked fine in Mozilla, but when I checked it in IE I was stunned when I loaded the page and noticed the logo graphic had a gap on the top and bottom. I checked the other two graphics closely and they appeared to stretch from top to bottom with no gaps. I double and triple checked the graphic dimensions and img tags with no luck. I loaded the site I took the code from and everything appeared fine. I switched the graphics with those from the site that was working and the gap was still there. The code was almost exactly the same except for one thing. The site that was working used javascript for the top right image (70 pixel one) to automatically select a random picture when the page was loaded. The code looked something like this:

<script language=”JavaScript” type=”text/javascript”>

var random = Math.round(Math.random()*(4-1))+1;
document.write(’<img src=”/images/top_images/image’ + random + ‘.jpg” width=”469″ height=”70″ border=”0″/>’);

</script>

However on the new site I only had a single graphic so there was no need to use the javascript I just replaced it with:

<img src=”/images/top_image.jpg” width=”469″ height=”70″ border=”0″/>

No problem right? Not with IE. Since that was the only code difference I could see, I replaced the img tag with the following javascript:

<script language=”JavaScript” type=”text/javascript”>

document.write(’<img src=”/images/top_image.jpg” width=”469″ height=”70″ border=”0″/>’);

</script>

Reloaded the page, and suddenly the gap disappears, all is well with IE again. Strange and utterly annoying. How much time did I waste trying to figure out what was going on? TOO MUCH!!

Mysterious Reboot

Sunday, November 16th, 2003

My server mysteriously rebooted a few days ago. I’ve checked the logs and I can’t figure out what caused it. It’s possible someone pressed the power button and put the system in a shutdown mode, I did have some nieces and nephews over that night. Still…the system wasn’t that accessible, the power button had tape blocking it which didn’t appear to be disturbed. Plus if the power button was pressed why did the system start back up. I dunno…I’m confused. A few days before the power went off for about 45 minutes and the UPS kept the server and DSL running fine. Then the next day my uptime gets put all the way back to 0 from this, oh well.

Secure FTP

Wednesday, September 24th, 2003

Transmit SFTP ClientI’ve been hosting a few other sites on my server, for some friends, for quite a while. Up until now the sites have just contained weblogs so I haven’t had to worry about securing file transfers and such. For my own site development I created a nice little applescript applet that uses rsync over ssh to synchronize a local directory on my powerbook with my public html directory on the server. The applet has a text box to view the rsync output and two buttons, “synchronize” and “quit”. It’s worked well so when one of my friends called me and indicated they wanted to add some things to their site I contemplated just modifying the applet for them to use (he’s on OS X also). Then I started thinking about the larger picture; what if one of my other friends who doesn’t use OS X wants to have access to their public html folder? My first thought was to just enable FTP. Despite its utter lack of security it still seems to be widely used by web hosting services. However I just can’t get over the security issue. The idea of clear text usernames and passwords flowing across the internet to my server makes is just too much.

I wondered if any WYSIWYG clients supported more secure methods of file transfer, so I checked out Macromedia’s Dreamweaver site. I was pleased to see that yes, Dreamweaver MX 2004 now supports secure FTP. That’s good but restricting all my users to using a particular client didn’t seem like a good solution either. That’s when it hit me, if Dreamweaver has a secure FTP client built into it, surely there are some freely available, plain, secure FTP clients around. I checked into this a year or two ago but at the time I couldn’t find a client I liked, one that’s simple and easy for anyone to use. I was hoping things have changed since then and sure enough, I went to Apple’s OS X downloads site and immediately came across “Transmit“, a nice secure FTP client for OS X, that anyone can use. I haven’t bothered to check for windows clients, but I’m sure they’re out there. So, not only will I be able to keep server access relatively secure, I don’t have to change a thing on the server (since ssh is all secure FTP needs). I love it when things work out like this.

Email Virus Notifications

Wednesday, August 27th, 2003

Over the past week I’ve come to the conclusion that I really don’t like those “friendly” virus notifications some admins have setup on their SMTP servers. You know the ones that show up in your inbox with “A virus was sent from your email address myaddressxy@mydomainxy.com to addressxy@anotherdomainxy.com. Notify your system admin blah blah blah.” Since spoofing the from address in an email is trivial to say the least, I really don’t see the value in these notifications. Assuming they’re kind enough to forward the original message back it takes all of 30 seconds to look at the original header and determine it wasn’t sent from any of my users.

So I end up with calls from panicked users who’ve received these notifications. Most are skeptical when I tell them nothings wrong with their computer, since they continue to receive the notifications. Like I said, I really don’t see any value in these. They just make a bad problem worse. Email worms create enough bandwidth/storage problems, why add to it with worthless, ineffective notifications?

Some Cleaning

Monday, August 25th, 2003

I’m finally rid of the kdebase package I couldn’t seem to get off my server. At first I thought the kernel panic was possibly caused by the multiprocessor kernel. From the searching I did on kernel panics, a lot seem to deal with the smp kernel. I booted into the kernel without smp support and tried to remove the package again, still ended up with a kernel panic. Next I wondered if it could be caused by some file system corruption so I booted to a prompt and ran fsck which uncovered a bunch of errors, one of which dealt with a kde file. I initiated a repair, rebooted and tried the remove again only this time everything seemed to work.

Oh yeah, I also upgraded the kernel. Now I just need to get the UPS system hooked up and I’ll be in good shape.