Daily blurbs Apr. 2005

Plans

daily blurbs


23 Apr 2005 (Sat)

10:42:16 # Life I've made a presentation for 'git' version control system for Linux Kernel. I've put the (Japanese) presentation and related links up. I don't think there is much of this kind of resource around; and I'll try to update it from time to time so that I don't forget.

18 Apr 2005 (Mon)

07:45:57 # Life I've sent a patch to Linus about use of libssl in GIT. My patch replaced use of libssl with gcrypt. He didn't like use of gcrypt since he didn't have it installed locally and the interface was ugly.

I've done some reading, and found that gnutls has compatibility interface for some of the hash functions in openssl.h. Just that it doesn't have them for SHA1. It should be trivial to add them though...

07:44:52 # dinstall/dupload I've updated soundtracker, not to use ALSA. ALSA support is segfaulting now, and I had to disable it. Maybe debug it later.

17 Apr 2005 (Sun)

19:13:22 # Life How to replace hash functions from openssl with gcrypt. I wondered how to do it, and hacked around. git source uses ssl, and I wanted that to change. I have written a patch that looks as if it's working, I'm not really sure.

/*
 Code snippet to calculate SHA1sum using openssl libs.
 Copyright 2005 Junichi Uekawa, given to public domain.

$ gcc openssltest.c -lssl
$ ./a.out  < ./a.out
eae8189278303caaa78f2d89e6a6ebeb7d37b554
$ sha1sum ./a.out
eae8189278303caaa78f2d89e6a6ebeb7d37b554  ./a.out
*/

#include <stdio.h>
#include <openssl/sha.h>

main ()
{
  SHA_CTX s;
  int i, size;
  char c[512];
  unsigned char hash[20];
  
  SHA1_Init(&s);
  while ((size=read (0, c, 512)) > 0)
    SHA1_Update(&s, c, size);
  SHA1_Final(hash, &s);
  
  for (i=0; i < 20; i++)
    printf ("%.2x", (int)hash[i]);
  printf ("\n");
}
	

The above code can be replaced with Gcrypt as follows.

/*
 Code snippet to calculate SHA1sum using gcrypt.
 Copyright 2005 Junichi Uekawa, given to public domain.

$ gcc hashtest.c $(libgcrypt-config --cflags --libs)
$ ./a.out < a.out 
46b25183fba09a11c4f71bc5a12804756a362639
$ sha1sum ./a.out 
46b25183fba09a11c4f71bc5a12804756a362639  ./a.out
*/


#include <stdio.h>
#include <gcrypt.h>

main ()
{
  gcry_md_hd_t g;
  int i, size;
  char c[512];
  unsigned char * hash;
  
  gcry_md_open (&g, GCRY_MD_SHA1, 0);
  while ((size=read (0, c, 512)) > 0)
    gcry_md_write(g, c, size);
  gcry_md_final(g);
  hash=gcry_md_read(g, 0);
  for (i=0; i < 20; i++)
    printf ("%.2x", (int)hash[i]);
  printf ("\n");
}

	

20:32:43 # Life Today's desert is Amanatsu, with Green Tea. I'm hungry!

16 Apr 2005 (Sat)

13:40:03 # Life Sat down to make pbuilder work with sponsorship options. I've now sponsoring Iwamatsu-san for tinywm package; and I've felt the urge to get pdebuild working with sponsorship. There were quite a few requests for fix on pdebuild, but zero patches. Finally I've come around to getting it working. Morale of story; a hacker does not get a work done unless it is required. Patches are welcome; without a decent patch; implementations may see delay. pbuilder 0.126 is now in incoming.

10 Apr 2005 (Sun)

14:06:35 # Life 3rd Tokyo area Debian meeting report. It was 3rd Tokyo area Debian meeting yesterday. It was pretty much motivating and enjoyable, and I'd like to do the same next month.

I was pointed out that planet-jp.debian.net I prepared doesn't look good, so I tried to use templates for planet.debian.org. However, something is not working.

8 Apr 2005 (Fri)

08:46:15 # Life updated dsh, since it didn't build on solaris. Not many people seem to be testing it on that platform, and it goes unnoticed.

7 Apr 2005 (Thu)

08:39:36 # Life I noticed that in linux kernel bk2cvs, there has been zero update in the past 24 hours. Is this service also stopped?

4 Apr 2005 (Mon)

08:39:53 # Life Updated d-shlibs by updating the sed script to handle libogg-dev.

1 Apr 2005 (Fri)

08:08:33 # Life Apparently, there's a kernel planet now. It's at http://kernelplanet.org/. There was a topic about what you put in ~/bin/. Here is a little script that I usually use for filing bugs...

#!/bin/bash
# apt-get source helper.
set -e

if [ -n "$1" ] ; then
    echo AGS action "$1"
    mkdir "$1" && cd "$1"
    if apt-get source "$1"; then
        FILENAME=$(echo $1-*)
	cp -a $FILENAME{,-orig}
	(
	    cd $FILENAME
	    echo START SHELL
	    bash
	    echo EXIT SHELL
	)
	cat <<EOF


The following patch should fix the build failure
==================================================
EOF
    diff -ru $FILENAME-orig $FILENAME 2>/dev/null | tee diff-fix
cat <<EOF
==================================================


EOF
    fi
fi	  
	

Junichi Uekawa

$Id: 200504.html.en,v 1.15 2005/04/23 01:43:58 dancer Exp $