Archive for 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….

Published by Niels on 26 Nov 2005

First release of sl (0.0.1)

Suppose you have a website using NanoBlogger and you want to upload the changes to your provider. Then you can use something like rsync. But if that functionality is not supported by your provider you can either:

  • Upload the changes manually
  • Upload the entire site again, which can be costly and time consuming once your site gets large
  • Write something to keep track of the differences and uploads only those differences to the host

I choose the latter and the prototype seems to be working fairly well for me. It keeps track of the MD5 sums and the names of the current directories in the
website’s local directory. If any changes are made the the new files’ MD5 checksums and directory structure are compared to the stored one. A list of changes to the remote site will then be made in commands understood by sftp. These commands are executed and presto: an updated site!

Its usage is very simple:

sl [OPTION] source destination

In the example below only the script only performs a dry-run so you can see the possible changes without affecting your website.

sl -t websitedir user@remoteserver.domain.com

The script can be downloaded here.

If there are any suggestions or comments feel free to contact me.

Published by Niels on 21 Nov 2005

First Post!

If you are reading this: Welcome!

A lot has happened the last week. First the domain heirbaut.nl is now hosted by BHosted.nl. They offer a very complete hosting package for a very reasonable price.

I also moved away from Blosxom as my CMS. NanoBlogger fits my needs better. To me it is easier to use, setup and maintain. So instead of tinkering I can finally get some blogging done. To make my life even easier I decided to use Markdown, which even takes away the hassle of inserting HTML code in my weblog entries.

The site will be maturing (again :) ) the coming weeks. A small project, that sprang into existence because of this site, will become available very soon.
And I am hoping to be able to publish some documentation on the long term personal project that I am working on.

Time to go now, have fun and if you want to contact me, the address is on the left in the navigation section.

« Prev