Archive for December, 2005

Published by Niels on 03 Dec 2005

Learning all the time

As mentioned in an earlier post I was looking for a mechanism to get remote information and take actions based on that information without having to give my password multiple times. Recently I found at that apparently I am a SSH newbie, because it is very easy to setup SSH in such a way that you never have to provide a password ever again when working from a machine that is known to the remote system.

On your local system do the following:

mkdir -p $HOME/.ssh

chmod 0700 $HOME/.ssh

ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''

Now copy the resulting file $HOME/.ssh/id_dsa.pub to the remote server you want password-less access to and log in to the remote system (using SSH of course). On the remote system take the following actions:

mkdir -p $HOME/.ssh

chmod 0700 $HOME/.ssh

cat id_dsa.pub >> $HOME/.ssh/authorized_keys2

chmod 0600 $HOME/.ssh/authorized_keys2

rm -f id_dsa.pub

If you want access from multiple machines to the remote system just repeat the ssh-keygen, cat and rm commands from the system you want use to connect to the remote server.

Published by Niels on 02 Dec 2005

Upgrade woes

I asked for it: never, ever upgrade something without really testing it. As mentioned before I upgraded from RC1 to RC3, but I have never taken the time to make sure that the customized plugins I use are also known to the new version. In my case this concerned the fortune and the Google plugin.

So now I have created a personal plugin directory as part of the website generated by NanoBlogger and adjusted my local blog.conf so that NanoBlogger sees this directory.

Published by Niels on 01 Dec 2005

Upgrading (just for fun)

I noticed that there was an update to NanoBlogger. So as my last act for today I have upgraded the site to NanoBlogger 3.3 RC3 from RC1. Completely missed about the RC2 version that had a critical bug fix. Oops. I am glad that it didn’t bite me.

Published by Niels on 01 Dec 2005

That wasn’t what I expected at all

Okay, I admit. I have a bit of a weak spot for all movies that Johnny Depp plays in. It is not that they are always great movies. Because they are not. But he always seems to make something special of the part he plays.

So last weekend we rented Charlie and the Chocolate Factory and I enjoyed the movie so much, especially the character of Willy Wonka, that I stopped comparing this version
to the one with Gene Wilder within a couple of minutes after Depp made his first entrance as Willy Wonka (okay, so I like Gene Wilder too, sue me!).

So if you have not seen it yet, go see it! I can really promise you that you will smile at least once or twice, ‘kay!

Published by Niels on 01 Dec 2005

What to do

So I made this script to help me maintain my site. But it only helps me when I upload the site to the remote host. Suppose I want to work on the site from different machines. How can I then keep everything synchronized? The simple answer would be: assume that the remote site is the original and find out what the changes are compared
to the local copy of the site. The workflow would then become:

  1. Retrieve the MD5 checksums and directory list from the remote server a using sftp.
  2. Compare these with the current files and directories.
  3. Get the files that need to be added using sftp.
  4. Delete the files that are no longer needed.
  5. Delete and create local directories as needed.

My problem with this approach is that I need two separate sftp sessions, which means providing the system with at least my password twice. Since I want to
be as efficient as possible (read: I am Lazy :) ) I would rather give it once.

As I currently see it I have the following options:

  1. Find some clever bash-trickery to make sure that I can keep one sftp-session open. But so far that does not seem promising.
  2. Use expect. Very good solution, but the urge to make the program rely on Bash and sftp is very big.
  3. Use something like Perl and Net::SSH. See 2.
  4. Learn more about sftp and ssh2 to see if there is a possibility to keep session information for at least long enough to do all the work.

Decisions, decisions. If anybody out there has some good suggestions, feel free to contact me….

« Prev