« October 2003 | Main | December 2003 »

November 24, 2003

Mail.app and ssh tunnels

I believe originally I had mentioned this bug, but in any case a quick recap of it. Under Panther using Mail.app over an ssh tunnel to send outgoing email no longer works. Not sure why it really matters to the mail client, but it seems very obvious that Mail.app won't even send the HELO command to the tunneled sendmail server. This, is a problem for me.

For those of you interested in the status of this bug, Apple has "forwarded this information on to the appropriate engineering team" as bug 3111206. Enjoy.

Posted by Dan at 11:38 AM | Comments (0)

November 13, 2003

Panther ODBC

One bit of good did come out of the whole fiasco I've been fumbling through today with the loss of data. I was finally able to get a working ODBC connection to PostgreSQL again.

Steps taken went like so:
1) Download the latest pgODBC system, build and compile it. I compiled these into a temporary directory that I could blow away easily if I screwed things up. But it seems safe enough to just put this directly into your PostgreSQL share directory, as they contain nothing that dangerous. Oddly enough using the drivers found with the PostgreSQL 7.3.2 install on Apple's OS X software page does not seem to work at all.

2) Add the driver via ODBC Administrator. Find the shared library or static library you just built and add it as a driver to the system in the Driver file area. Give it a description of whatever you want. As for the Setup file I pointed that to the psqlodbc.la file (when used with shared libraries) and this seemed to be the magic trick here.

3) Configure your UserDSN. I followed most of the same as my earlier post, but in this case I cut down a lot of the useless data from before. You'll find a copy of it in the Extended Body for reference if you're curious. Remember to correct (by hand) the generated odbc.ini file before moving to the next step.

4) Test connection with odbctest. After a few email conversations with people, I realize I may have misled some in the notation. The proper notation (as I understand it) is to state something like DSN=pgtest where pgtest is the name of the DSN you wish to connect to. If everything goes successfully, you'll find yourself at a SQL prompt awaiting your every command.

Enjoy.

--------- begin odbc.ini ----------
[pgtest]
Driver = /Users/dank/lib/psqlodbc.so
Description = the new PGSQL ODBC driver
Database = dank
Servername = localhost
ReadOnly = 0
Username = dank
Port = 5432
------- end odbc.ini -------

Posted by Dan at 09:07 PM | Comments (0)

Panther Woes

My Software Updater last night noticed the 10.3.1 upgrade, and I proceeded to install it. After it was done, I chose to shut down the machine as I wasn't really using it, and was about to goto sleep. Waking up this morning I discovered to my great joy, that this was more than an upgrade. It was, in fact, a great many steps backwards! I can only begin to believe this was because I've had FileValut enabled on my system, but I can't be certain.

It seems every PDF found on my desktop somehow became no longer a valid PDF format file, requiring me to re-download them. Almost every preference for Applications I've had is now gone (Safari cache, Kung Log prefs, Safari prefs, iChat prefs, etc), and more importantly my entire iCal is now empty (it knows the calendars, but contains no events for each). Not a good start to the morning, but thankfully I've backed up all of this stuff recently when I upgraded to Panther initially. I'll just make up the difference in data loss somehow. This proves to be no good. Replacing the Library with the backup library doesn't provide any difference in operation. Marko has suggested that somehow the system is looking for my Library in another location, and I'm starting to believe him. But where?

I've now spent a lot of time disabling the FileVault feature in hopes that things will begin to clear up again. Now if only I could figure out how to get everything back to operational status..

So now I'm left with a completely bogus setup. Again. Thanks Apple.

[UPDATE: After talking with Eric for a bit, we discovered that apparently the 10.3.1 updater has a known bug if you try to run it with the FileVault option enabled. My question now is, why did the updater, or even the installer allow this to happen? Shouldn't there have been a check within the Installer at least to stop the process if FileVault had been enabled?

After disabling FileVault, I was able to slowly restore the backup copies of my Preferences. It took awhile, but at least it's back to only a week out of date.]

Posted by Dan at 07:09 AM | Comments (0)

November 09, 2003

Interview questions

I had the first phone interview on Friday for a potential employer. Beyond the fact that I was under the impression that the interviewer was not paying attention to anything I said (at one point I asked him a question and his response was "yeah, thats great"), but it became painfully obvious how HR oriented he was vs development. One of his questions was about the total lines of code I've written within a project. Now this is a misleading question for many reasons, but mainly for two big ones.

First, the functionality of a piece of code can always be written in a notation that makes it difficult to follow, or it can be made easy to follow. Short or longer. Reusable or not. But typically, this isn't something developers often concern themselves with! I don't make it a habit to write an application with no less/more than N lines of code. Nor do I sit down and count them later.

Second, lines of code is a misleading concept. In my mind a line of code can and should be followed by a through explanation in comments of what each section is doing. Are the lines of comments counted or disregarded in the counting process?

When I brought these points to his attention his comment was "Well just take a guess if you can." This leads me to guessing properly or improperly. Trying to stay honest in the interview, I'm not sure I'll remember the number being given. I still don't understand the point of this question.

Posted by Dan at 10:47 AM | Comments (2)

November 06, 2003

Panther Mail bug

Under the old Jaguar system I had originally started sending email using my local copy of sendmail. This worked fine until the anti-spam sites started including DHCP'd address blocks in their list of bulk-mail. The solution was to create an ssh tunnel from my laptop to that of my static IP based mail server.

/usr/bin/ssh -L2525:dirty.deadmime.org:25 dirty.deadmime.org -N &

That line had worked fine, by setting up a localhost port 2525 that mapped to my static mail server just fine for a long time. I would have preferred if I could get Mail.app to actually initiate the connection, but as it stood I had no problem running a script to start and stop any such process. And this worked.

Under Panther, the Mail.app no longer seems to support this. To prove this initiate an SSH port forwarding session such as the one above (to your own mail server please) and set up your Mail.app use localhost and the selected port for sending email. Watch your static mailserver logs and you can see a message stating why this connection is being rejected (Ethereal will show it as well):

Mail.app is NEVER sending a HELO command.

When you send it will look like the application didn't even try to send the message. If you setup the local postfix, Mail.app works just fine. It can even connect to other mail servers I have access to without a problem. It seems to be just going through an SSH port forwarded session.

Posted by Dan at 10:20 AM | Comments (0)

Panther ODBC Administrator

When I upgraded to Panther, I forgot to backup some things. I understand that this was my fault, and not one of anyone else. One of the big things I forgot to backup were my odbc.ini files, used for debugging many PHP based applications. This should be fine, as they aren't terribly difficult to recreate. I proceeded to download PostgreSQL and it's ODBC attachments.

First the good news:
Apple has finally updated the ODBC Administrator interface to being something more on a useful scale. They still don't have any explanation whatsoever of how to use it or what these mysterious "values" to be added are, but at least it looks something like the Microsoft ODBC Administrator now.

Now the bad news:
How does this work? I configured a new DSN via the ODBC Administrator, but unfortunately there is no way to test the DSN within the application. This requires running the odbctest application from the command line. Fair enough. Running the odbctest application shows that NONE of your DSNs have been entered into the user-space odbc.ini file. Huh? Opening ODBCAdmin will show the DSNs still listed, so it's not that they aren't created. Opening the odbc.ini in vim one discovers that for some reason the odbctest application cannot find the DSNs because the [ODBC Data Sources] line is not the first in the odbc.ini file.

Moving that section to the top finally enables one to test, only to have a connection results in the statement:
[iODBC][Driver Manager]Dialog failed, SQLSTATE=IM008

Great. Turning on logging proved to be completely useless as well. Why? Well it seems the log file never gets written to. Why? I haven't figured it out yet, but changing paths hasn't helped either.

In an effort to debug this further, I downloaded the OpenLink Software driver manager and administrator. This quickly picked up the DSNs found in my odbc.ini file, and provided me with an in menu means of testing, almost. Unfortunately the OpenLink ODBC Administrator cannot seem to edit any entries, giving me an error stating:
An error occurred when trying to configure the DSN: Could not load the driver or translator setup library.
The catch is, OpenLink ODBC Admin can complete the test, AND write to a SQL log file! This would lead one to believe that it works, but unfortunately that is not the case.

Building PHP results in an application which still cannot find any valid DSN connections mechanisms. I'm now at a loss. I have exhausted my knowledge, and cannot seem to figure out why this won't work. Anyone with suggestions are welcome to comment. You'll find the ODBC.ini attached in the extended along with some SQL.Log comments

[EDIT: grammatical corrections]

---- begin odbc.ini -----

Driver = /Users/dank/lib/psqlodbc.so
Description = Sample PostgreSQL DSN
DSN = pgsample
Servername = localhost
Username = dank
Database = dank
ReadOnly = No
Servertype = postgres
Port = 5432
FetchBufferSize = 99
ServerOptions =
ConnectOptions =
Options =
ReadOnly = no
Trace = 1
TraceFile = /Users/dank/odbc.trace
Debug = 1
DebugFile = /Users/dank/odbc.debug
CommLog = 1

----- end odbc.ini entry ---


--- odbc.trace -----

OpenLink ODBC A A000A1EC EXIT SQLDriverConnectW with return code 0 (SQL_SUCCESS)
SQLHDBC 0x3742d0
SQLPOINTER 0x336650
SQLWCHAR * 0xbfff58a0
SQLSMALLINT -3 (SQL_NTS)
SQLWCHAR * 0xbfff98a0
| DSN=pgsample;DATABASE=dank;SERVER=localh |
| ost;PORT=5432;UID=dank;PWD=;ReadOnly=No; |
| Protocol=6.4;FakeOidIndex=0;ShowOidColum |
| n=0;RowVersioning=0;ShowSystemTables=0;C |
| onnSettings=;Fetch=100;Socket=4096;Unkno |
| wnSizes=0;MaxVarcharSize=254;MaxLongVarc |
| harSize=8190;Debug=1;CommLog=1;Optimizer |
| =1;Ksqo=1;UseDeclareFetch=0;TextAsLongVa |
| rchar=1;UnknownsAsLongVarchar=0;BoolsAsC |
| har=1;Parse=0;CancelAsFreeStmt=0;ExtraSy |
| sTablePrefixes=dd_;;LFConversion=0;Updat |
| ableCursors=1;DisallowPremature=0;TrueIs |
| Minus1=0;BI=0;ByteaAsLongVarBinary=0;Use |
| ServerSidePrepare=0 |
SQLSMALLINT 4096
SQLSMALLINT * 0xbfffd8b8 (539)
SQLUSMALLINT 2 (SQL_DRIVER_PROMPT)

OpenLink ODBC A A000A1EC ENTER SQLDisconnect
SQLHDBC 0x3742d0

OpenLink ODBC A A000A1EC EXIT SQLDisconnect with return code 0 (SQL_SUCCESS)
SQLHDBC 0x3742d0

OpenLink ODBC A A000A1EC ENTER SQLFreeHandle
SQLSMALLINT 2 (SQL_HANDLE_DBC)
SQLHDBC 0x3742d0

------ end odbc.trace ------

Posted by Dan at 07:19 AM | Comments (5)

November 03, 2003

Humor

So a bit of humor that requires some shockwave time:
http://home.tiscali.nl/multicom/DaSchop/endofworld.swf

Oddly enough, Safari wouldn't play it, but Firebird would. Go figure. laugh a little bit.

Posted by Dan at 08:06 PM | Comments (0)

November 02, 2003

Panther

Well, I spent my Sunday and did it, upgrading from Jaguar to Panther. Probably not the brightest move I've ever made, but one I'm sure to repeat many times over. Initial impressions are very good. The new finder is noticably faster on my now aging PowerBook. The return to some of the older style Mac windows is nice, but I really just don't dig the brushed metal look all that much. Still can't stand the column view but at least many of the bugs have been fixed with it.

Now my gripes. The install went horribly, and as such I've lost a bit of data. Not because I didn't backup, but because I didn't backup enough. I can't seem to find it either, but there is a nice little hack to re-enable vim's syntax coloring, which is almost essential for me to work. If anyone has this, I'd love to see it.

Other complaints, the move from tcsh to bash. Now it's not a big one as I'm fairly shell independent, but it's just annoying to have to update your shell scripts again. Ugh.

Mail.app still sucks. It's most annoying feature: not stopping when you click stop. I mis-configured it so the IMAP server just started to download everything in my home directory and put it into an IMAP accessible folder. Stopping this malfunction took a force quit and numerous hacks of the directories it uses. Furthermore it now no longer seems to be updating or seeing some folders that are explicitly stated to being there. Ugh.

I forgot to backup my NetNewsWire blog list too. My fault, but still annoying.

Posted by Dan at 08:39 PM | Comments (2)