Archive for December, 2002

SSH Authentication on Mac OS X

Tuesday, December 31st, 2002

One of the nicest things about SSH is the ssh-agent which serves up the authentication codes for SSH sessions so that you don't have to keep typing in your password to establish secure connections to all the different machines.

On most Linux distributions, the ssh-agent is invoked at login and all you really need to do is to establish your private keys and then do an ssh-add to load up those keys. On Mac OS X it's a little different and I have to say that I'm a little surprised that there's not a preferences setting that starts this at login. But it's not that hard to do if you get a reasonably nice script written that restarts ssh-agent for you.

Here's what I came up with to restart ssh-agent and update the file that holds the environment variables for subsequent shells:

#!/bin/tcsh
##
# Start SSH Key Agent
##
if (`where ssh-agent` != "") then
	#
	# See if there's already a running copy of ssh-agent
	#
	if (`ps -aux | grep 'ssh-agent' | grep -v grep | wc -l` -eq 1) then
		kill `ps -aux | grep 'ssh-agent' | grep -v grep | awk { print $2 }`
	endif
	#
	# ...and make sure to unset the variable for the PID of the agent
	#
	if ($?SSH_AGENT_PID) then
		unsetenv SSH_AGENT_PID
	endif
	#
	# Now see if we have the socket connection already defined as well
	#
	if ($?SSH_AUTH_SOCK) then
		if (! -S "${SSH_AUTH_SOCK}") then
			unsetenv SSH_AUTH_SOCK
		endif
	endif
	#
	# This is the file location that will hold the environment-setting
	# commands for all subsequent shells based on the results of running
	# ssh-agent for the first time.
	#
	setenv SSH_AGENT_STATE "/tmp/.ssh-agent-state.${user}"
	#
	# If it's still there, it's got old data and needs to be wiped out
	#
	if (-f "${SSH_AGENT_STATE}") then
		rm -f "${SSH_AGENT_STATE}"
	endif
	#
	# If we're all clean, then we need to start up a new instance, and
	# save the environment settings in the proper file for later
	# invocation by other shells.
	#
	if (! $?SSH_AGENT_PID && ! $?SSH_AUTH_SOCK && ! -f "${SSH_AGENT_STATE}") then
		ssh-agent | grep -v '^echo ' >"${SSH_AGENT_STATE}"
		source "${SSH_AGENT_STATE}"
	endif
endif

I call it sshAgent and then in my .login file I have the following lines:

#
# Now get the SSH-Agent up and working on this box so I can get into
# the machines at home where the keys are set up to match.
#
${HOME}/bin/sshAgent
source /tmp/.ssh-agent-state.${user}

Then it's just a matter of generating the keys and getting them to the right hosts for authentication purposes. To generate keys for both SSH v1 and v2 you can simply do this:

ssh-keygen -t rsa1
ssh-keygen -t rsa
ssh-keygen -t dsa

And when each command is executed enter the same pass-phrase so that one pass-phrase activates all key sets. You should have several files in ${HOME}/.ssh and you need to copy most of these to the other hosts you want to make SSH connections to. Specifically, copy:

id_dsa
id_dsa.pub
id_rsa
id_rsa.pub
identity
identity.pub

And make sure to have the non-.pub files read/write only by you, the user.

You're almost done. Now, on these other machines execute the following commands to copy the public keys to the authorized key lists:

cd ${HOME}/.ssh
cp id_dsa.pub authorized_keys2
cat identity.pub id_dsa.pub id_rsa.pub > authorized_keys

Then, on your Mac OS X box, run the sshAgent script and then run ssh-add and enter your pass-phrase - you should see it adding the three keys - DSA, RSA, and RSA1. Now you can simply ssh to the machines that have those copied keys. It's all done.

Excellent!

Yule-Time Thoughts

Friday, December 27th, 2002

It's been another really fun Christmas for the kids. They have really enjoyed the surprises and I got more shirts and a shop-vac. It's tiring because the kids are up so darn early and are so excited when they go downstairs to the tree... well... that's what being a kid is all about, right?

But it leaves me wondering about the end of this year, my birthday, turning 40, and what's coming in the New Year. I'm not really giving the number 40 much weight, but it does mean that I'm no longer young no matter how young I feel. But that's not bad... youth wasn't my best time anyway. I'm spending more time focusing on my personal situation and the passing of time.

Several years ago, when I was at Port-to-Port, Damon, my partner at the time, and I went to Corporate Counseling to try and iron out some of our differences that were really hurting the company, and it's plans for the future. Damon and I had been best friends for more than 15 years - he was the Best Man at my wedding, and I was the Best Man at his. Yet when we tried to run a business, there were a lot of problems that came up due to our vastly different personal styles and backgrounds.

While in this counseling, I learned all about co-dependency, what damage it does, how to try and avoid it, etc. And ended up learning a lot about myself, my relationship with Damon, and several other relationships I have had. In the end I was much more mentally healthy, but not without a cost.

You see, if I am really 100% mentally healthy, and not suffering from any form of co-dependence, then I really don't care if you've had a bad day. I mean I can be sorry that it happened, but it won't effect me at all. Your bad day is just that - Your bad day. Yet is that really the kind of friend you want to have around? One that isn't really interested in sharing your pain? At least a little?

When I dealt with Liza, I'm sure I seemed very uncompassionate, very aloof, very uncaring, because I simply was cutting all the ties that bind us, and in the end, cutting those from her as well. This is not something you want to see in your spouse, I'd wager, so it wasn't all good news.

So I came to a decision about mental heath - it's a good thing, in moderation. Which sounds like another good mental health axiom - maintain a proper balance. So while I still understand the problems of co-dependency, and how to avoid it, I think it's good if I'm a little co-dependent on my family. Just a little. I want to try and feel my son's pain when he has a bad day... tell him that when I was a kid I wet my pants too when I didn't make it to the bathroom in time. These are good things to share. Because after all, we are here to share in the experience, as we are, as humans, very social creatures.

So I'm purposefully not as mentally healthy as I could be, but I'm a lot happier for it. And I think I'm a much better person for it as well.

Which brings me to my concern about my current state of uncomfort. For many years I have been looking for something outside of me to give me a pick-me-up. In grad school all it took was going to the Bookstore and getting a new pad of paper. I loved the feel of it. The unlimited possibilities that those pages could hold. It would keep me happy for a day or two at the least. When I got out of grad school I was teaching at Auburn and I started to decorate my office in the most incredible way imaginable. I had trees in my office, a Basketball goal, a 30-gallon salt water tank, Lego castles, a nice stereo... in general, more than should have fit into that office, and more than I should have needed to feel comfortable.

But I'd just risen the bar a bit... Now instead of the pack of paper, I wanted to get a new Lego castle, or a new fish, or a new CD, or two, or three. It was nothing more than a distraction from the problem that I had that I could not seem to find happiness and contentment within myself. When I got a new thing I was distracted from the problems I had until the newness wore off and I had to deal with just myself again.

So here I sit... today I want a new computer - two in fact. A new desktop that's a screamer, and a new notebook that's the best money can buy. Yet I know these are distractions. But the desire is just as real. But taking a page from my past, I'm wondering if I really want to solve this particular mental illness.

What I mean to say is this: I am concerned that whatever qualities I have now that keep my ego, my greed, my arrogance in check need to stay there. I'm not silly enough to think that I don't have these. I do. And in large measure. But they are kept in check by something that I'm not really sure of. But I want them to remain in check, because I think I would be an absolutely detestible person if I lost those checks.

One of the things I was asked to do in the Counseling was to write down my list of the 10 people I liked most in the world. When my list was done, Carol (the counselor) asked me why my name wasn't on the list. It's a very interesting question. My concern is now, what kind of person would I be if I was #1 on my list?

Would I sacrifice my personal time for my kids? Their time with me is limited to the first 18 years, and after that, they are one their own with whatever skills and tools I've managed to impart to them. If I put them in front of me, at least for the time they're with me, then they'll have a much better start. It's the real cost of having kids, isn't it? The same goes for many things... so in the end, would I really be a better person if I took more time for myself?

Clearly, the answer lies in the balance. No time for me, no diversions, no toys, and I would become a very unhappy person and that's not good for anyone. Too much, and other things in my life suffer. So it's got to be a balance that's struck. The problem is it's very hard to balance things like diversions and toys... I mean really, who doesn't enjoy having fun? I know I do. So it's hard to say "OK... enough fun..." but that's what has to happen.

In the end, it's the balance that's important, and for that I need to have a lot better understanding of myself than I do right now. I guess the older you get, the more there still is to learn about yourself. Well... at least I've got that going for me - I shouldn't be bored for the rest of my days.

What a Wonderful Christmas

Thursday, December 26th, 2002

It's been a wild and wonderful Christmas this year. It's amazing that all this has worked out so well. It's been one heck if a great Christmas. I got a few really nice things from the kids - visegrips, a tool belt, and some knee pads... and they got boatloads of goodies. I love this season!

It's always amazing and fun to spend some time off. I've had a lot of fun these past few days at home. I've been able to see lots of Trading Spaces on TLC on Christmas Day, and I've had a chance to look on the web for a nice plotting package for sherman on Mac OS X. I found pro Fit that looks to be a pretty good package for a reasonable price. I'm going to work with the trial version for a while and if it pans out I'll probably get it. It looks like a nice package with capabilities for both imported data and direct math functions. Could be really nice if I get a chance to port some of the simulations that I'd like to get ported. Looks very nice indeed.

It's been a really nice getting a break from the bloodbath at work. I've gotten word that management has come around after the bodies have been carried away and asked what they could offer us to make it a nicer place for us to work. They want us to know that they think we're important to them and their plans this year. Ummm... Duh! I'm glad that I don't have to be in there this week.

I've chatted with a few folks this week and it's incredibly empty there, and if you have to be there, at least it's a good time to do it as there's almost no chance that something will go bad. Then again, when I go back at the first of the year I'm sure they'll be thinking that things are all settled down and will be ready to get to work right away. So be it... that's then. But today, I'm enjoying the Season. Enjoying the well-deserved time-off. Tomorrow will come in the morning.

Almost Vacation Time

Friday, December 20th, 2002

Well... today's been a good day so far, and I'm going to work hard to keep it that way. I upgraded sherman to Mac OS X 10.2.3 and was very happy to see that Apple had fixed the SMTP over SSL so that I can send emails from anywhere my iBook is connected to the net. This is a very nice addition as I now don't really need to get the .Mac account to be able to send email from work. Not a major problem, but very nice to have.

I also upgraded to 0.32a of Fire the ICQ/MSN/AOL/Yahoo IM client that I run on sherman to chat with friends and family and got a few nice things there, but wasn't really needing any of them. Still, nice to see that it's still actively being developed.

Finally, today is the last day before I take off a week and a half for Christmas Vacation. I won't be back in the office until Jan 2, 2003. I really need this week and a half (with two holiday days in there). Today is, after all, the last day for all those that were given the news on Red Tuesday. I'm going to miss the Team a whole lot. It's going to be a big change not to see them daily. Sad times.

But I'm going to try and stay up-beat today because I physically feel bad enough with a bad chest cold coming on strong and feeling very very tired. I don't need to let this all get to me mentally too.

Complex Things

Tuesday, December 17th, 2002

I've never been one to think that I had a really great grasp on life - Oh, sure, I've felt that I had a reasonably good grasp of parts of life from time to time, but then days like today happen and I'm left wondering if I ever really had even the slightest clue of what was going on.

One of the greatest guys I've ever worked with was right-sized in the bloodbath that was Red Tuesday, and will be moving to another division tomorrow. He thought it would be today, but it was postponed until tomorrow. It's just amazing the effect people have on all of us - those of us that choose to entangle ourselves with other's lives. I'm really going to miss this guy. Pretty depressing.

At the same time I'm trying to keep busy with his work, another (right-sized) guy's work, and mine. Thankfully, I understand all the work and it's not too bad - certainly when I have to wait for others to get other things done before I can do anything. It's amazing how long some folks take to add a column to a database.

I know that when I get nervous, or upset, what helps is to have something interesting to do - something to occupy my mind. I'm trying to keep that in mind and keep busy. I've got a few things to do, but for the most part it's a waiting game. More a fireman than a developer right now.

Running Some Tests

Monday, December 16th, 2002

I had a little time today and decided to try to get a few performance numbers for barney by Indigo2. I've got shark my Ph.D. thesis simulator in g77/gcc and also have numbers for several different machines in my office. I was a little surprised to see what the numbers came out to be.

For the Weak Inversion - Triode Operation simulation I have the following total run times:

Machine CPU(s) Speed RAM Time
sparky 2 x SM61 60 MHz 320MB 3:22
sparky 4 x Ross 125 125 MHz 320MB 1:53
mao i686 266 MHz 160MB 1:03
barney R10000 195 MHz 384MB 0:38
tux 4 x Xeon 500 MHz 2.25GB 0:33
sherman G5 2000 MHz 2GB 0:03
peabody Core2Duo 2330 MHz 3GB 0:02

This puts barney at the top end. About what I expected. Again, there's a lot more to total system throughput than the CPU's MHz rating.I'm planning on doing a little development on barney and was just a little curious about the relative performance of him to the other boxes in the office.

UPDATE: When I ran the same tests on my iMac (sherman) it was clear that the new hardware really spanks the old guard - as nice as they were at the time.

Getting Personal

Monday, December 16th, 2002

There's something that's comforting about having a good personal relationship with the people you work with. It makes work not seem like work, but more like a collection of friends working on a goal like helping a friend move, or painting a house. Not that it'll ever be fun, but it'll be a lot more fun when you're doing it with those you like.

I've written and talked about this fact for years now, and it's as true today as ever. However, there's an interesting wrinkle that I hadn't really considered but is just as impacting.

I'm sure that there's a Dilbert on the PHB, or some manager thinking themselves your best buddy and want to share your life with you. That's obnoxious.
Given the cuts we've had, and the state of the business, it's important to stay employed, but it's exceptionally distasteful to have to pretend to want to share with a guy that just whacked 2/3rds of the group. I don't like this guy, and I don't really feel like talking to him about my
weekend, what I did, where I went, but as soon as I say "I'm not really comfortable discussing this right now." I'll be labeled by this clown as a troublemaker and certainly not a 'Team Player'.

So it's all about games... play this game with management to allow them to think that you're their buddy, that you want to listen to their horrible little stories, and then get out of the room and shake it off. It's really amazing how we try to do our best at compromising between what we really want - nice job versus good home-life... lack of politics versus working for a tyrant. Lots of little things that we have to balance.

This is just particularly distasteful now given the cuts are still bleeding, as it were. After the first of the year we'll at least be done with the 'Good Byes', and what we have left is what we have for the year. I sure hope things pick up and I'm not expected to 'share' too much too often.

So Many Changes

Friday, December 13th, 2002

Lots of things are changing these days - work, mostly, but there's plenty of things going on at home as well. Hey, it's the season of change and renewal, right?

I got jikes source code for barney by SGI box and sherman by iBook. Both are a little disappointing in the java compilation speed department. It's interesting that sherman is a 600MHz G3 and barney is a 195MHz R10000, but their compile speeds are quite comperable. Just goes to show that MHz isn't the real determining factor in system performance.

Anyway, jikes is a Java bytecode compiler that's a lot faster than javac - like taking a 30 sec. compile to 5 sec. - it's really impressive. Anyway, I've been using it in my development on Linux for a while and it's given me good bytecode so there's no reason not to take advantage of it on my other platforms. Now I've got a lot zippier compiles on my other development machines. Nice.

Work is difficult in that the layoffs are starting to 'happen' - meaning that work is piling up and the management isn't really yet showing any interest in selecting projects for 'mothballing' due to the cuts. What it seems like is what I feared most about the cuts - that it was assumed that everyone that got cut contributed nothing or next to nothing, and so their absence will not be missed. This is, of course, sheer maddness, and as a result, the work environment is getting more and more detached from the management, and less productive.

It's kind of funny, these cuts... it's done two things that I'm guessing the management didn't want to do - make the place less productive as a whole, and cause there to be a significant gap between the workers and management. I know they expected for things to slow down with only half of the people (overall) remaining, but I'm guessing they didn't plan for the toll on those of us that stayed that the increasing workload represents. It's a demoralizing level of work, and clearly cannot realistically be done by any human being. So without some 'relief' in the way of mothball projects, each of us is left to wonder about the relative priorities of all the jobs we've just taken on.

Added to that the fact that the "Dilbert Gap" that's developing in the ranks, and you have a group of people who are far less interested in making the managers look good, feel good, and since there's clearly no money for bonuses and raises, there's even less motivation to work hard. It's a circle that feeds in on itself - more disconnection and work lead to a "who cares" attitude, which leads to more disconnection... It's a very bad scene.

So it's fair to say that depression is a constant companion these days for about everyone I've talked to - both those going and staying. I talked to two guys today in the elevator - one going and the other staying. We talked about how things are going, in general. It was depressing, but also at little bit comical. I mentioned that I thought those that were going had a larger short-term pain than those staying, but the long-term pain for those staying was far greater. It just depends on the job market. I'm betting that if the job market were better - regardless of the profit/loss of this place, there'd be a lot more people leaving because the short-term pain of a mover would be next to nothing.

I've talked to others that are staying and they are actively avoiding management because they don't have any motivation to do the work that they have been saddled with, and rather than have a confrontation, they simply avoid them. What a place!

I know that this is not like having a terminal disease. It's not even like having a real problem like a bad back or even a really bad sinus headache. But it is demoralizing. It eats away at the soul and argueably causes more damage to a person than all but the cancer. There really isn't a way to remain in this situation and not be effected. Maybe, with time, the place will get better, but I'm not overly optimistic on that. I'm trying to stay optimistic, but it's hard.

Recovering in Baby Steps

Monday, December 9th, 2002

It's been a heck of a week - and weekend. There hasn't been a lot of time to regroup, but now that I'm back at work with friends (for at least a little bit), it's not so bad. Sure... the problems I'm going to be facing with supporting this entire suite of server products are really quite scarey, and I'm not sure if I should even attempt to understand everything in the process, but for now - focusing on today, things are OK.

I guess that's the thing that I needed to focus on most - not the future, which can appear to be as bright or as dim as I want, but the here and now. I'm typically not a live-for-the-moment kind-fo-guy, and I don't have any real expectations that I'm going to turn into that guy anytime soon, but there's a lot to be said in these times of great stress and change to focus on the smallest piece of time possible. Thinking about right now - not later today, or this evening - but right now means that you don't have a lot to think about really. There's doing nothing or doing something. If the latter, then there's really only a few possibilities and picking from those is a lot easier than all the problems and possibilities that exist out there in the future.

This is very much the head-in-the-sand philosophy, and nothing gets solved when everyone thinks this way. But for me, for now, it's helpful. I tend to think too much and too far out anyway, so in a way this is just a kind of thinking vacation that allows me to rest from the stress and grief that I typically have, and make as small a decision as possible.

I'm going to try and keep this close at hand for a few days. I certainly need it.

Aftershocks and Compression

Thursday, December 5th, 2002

The aftershocks of the massive layoffs are still being felt. Certainly by me. Today I took over another project from a really nice guy that is moving to another division of the Bank. He didn't want to go and I didn't want to see him go, but that's what management wanted to happen, and that's all they really care about.

Now I'm doing my regular job as well as this guy's - plus the new web page development because they aren't fast enough, and then next week I'll be taking over another guy's project. Of course, my manager says that people know that the service level is going to be lower, but I had to remind him today that his requests of me needed to be put on the list due to all the work I have now. That doesn't bode well for him explaining this to any of the users.

I have to take tomorrow off for a lot of reasons. Liza wanted to get some Christmas shopping done and my Mom is going to come up and sit with the kids while we get that done - but most importantly, I could not be there tomorrow for the entire day knowing that it's Pete's last day here. I'm just not that strong these days.

So today was the last day for me, and it's just enough different that I didn't loose it too much, but I still had enough times today where I had to stop thinking about the state of affairs and dry my eyes. It's just that sad to me.

Next week will be even harder as my friend Matt will be moving on. That's going to be really really tough. But I'll have to find a way to get through it. And because life goes on, I guess I will, but it's not like I'm looking forward to it - that's for sure.

It looks like what I have to look forward to these next months is a lot more work, a lot less understanding, a lot less time to get things done, and the expectation from management that I should be cheerful because I'm still One of The Team. Yeah RIGHT!

I'm going to have to do a lot of expectation management myself. I'm going to have to let the management know that I'm not a machine. That I'm not going to work like they think I should, but like a real human being works. If that's not fast enough, then maybe they shouldn't have let so many folks go. But I'm sure that's not even possibly concerned them. They saw a number they needed to hit, and hit it. The consequences of that mark never even occurred to them.

I'm not enjoying this any more.