Author: Goneri

  • Finally, a 4096 GnuPG key


    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I finally generated a 4096 key ( 0x049ED9B94765572E ) which is signed
    by my old key 0x37D9412C. I will revoke this old key in the coming months.

    The old 1024bit key:
    pub 1024D/37D9412C 2004-08-18
    Key fingerprint = D3BC 65BB 48B1 1DA8 BC8A 5C88 B0A4 C5A4 37D9 412C
    uid Gonéri Le Bouder
    uid Gonéri Le Bouder
    uid Gonéri Le Bouder
    uid Gonéri Le Bouder
    uid [jpeg image of size 7650]
    uid Gonéri Le Bouder (Professional address)
    uid [jpeg image of size 4672]
    sub 1024g/E47802B2 2004-08-18
    sub 2048R/F89D348A 2013-06-01

    The new key:
    pub 4096R/4765572E 2013-06-18 [expires: 2023-07-15]
    Key fingerprint = 1FF3 68E8 0199 1373 1705 B8AF 049E D9B9 4765 572E
    uid Gonéri Le Bouder
    uid Gonéri Le Bouder
    uid Gonéri Le Bouder
    uid [jpeg image of size 7650]
    uid Gonéri Le Bouder
    sub 4096R/E496738B 2013-06-18

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.15 (GNU/Linux)

    iEYEARECAAYFAlJlJjsACgkQsKTFpDfZQSxwzwCeLDuJoMOwJ4H2fbQionyejDck
    GX8Anjp0V+rZHJ5fLlLv3yXWbsBt9K5m
    =RHzK
    -----END PGP SIGNATURE-----

  • Avahi / Bonjour on Windows

    How to resolve .local Avahi/Bonjour name on Windows http://support.apple.com/kb/DL999

  • ext4 with barrier=1 and performance

    The use of nobarrier provides a great performance gain on my laptop. I thinki I will continue like that even if my hard drive has got not battery unit.

    With ext4 (rw,noatime,errors=remount-ro,data=ordered)


    #fs_mark -t 4 -s 10240 -n 1000 -d /home/goneri/tmp/test
    # Version 3.3, 4 thread(s) starting at Mon Feb 4 10:35:47 2013
    # Sync method: INBAND FSYNC: fsync() per file in write loop.
    # Directories: no subdirectories used
    # File names: 40 bytes long, (16 initial bytes of time stamp with 24 random bytes at end of name)
    # Files info: size 10240 bytes, written with an IO size of 16384 bytes per write
    # App overhead is time in microseconds spent in the test not doing file writing related system calls.

    FSUse% Count Size Files/sec App Overhead
    o 84 4000 10240 35.2 113031

    ext4 (rw,noatime,nobarrier,errors=remount-ro,commit=15,data=ordered)


    tosh-r630:/tmp$ fs_mark -t 4 -s 10240 -n 1000 -d ~/tmp/test

    # fs_mark -t 4 -s 10240 -n 1000 -d /home/goneri/tmp/test
    # Version 3.3, 4 thread(s) starting at Mon Feb 4 10:40:06 2013
    # Sync method: INBAND FSYNC: fsync() per file in write loop.
    # Directories: no subdirectories used
    # File names: 40 bytes long, (16 initial bytes of time stamp with 24 random bytes at end of name)
    # Files info: size 10240 bytes, written with an IO size of 16384 bytes per write
    # App overhead is time in microseconds spent in the test not doing file writing related system calls.

    FSUse% Count Size Files/sec App Overhead
    84 4000 10240 839.9 99672

  • Debian Wheezy and cfengine

    How to bootstrap a cfengine node with Debian Wheezy Cfengine.

    # cp /usr/share/doc/cfengine3/example_config/* /etc/cfengine3/
    # sed -i 's,"/var/lib/cfengine3/inputs","/etc/cfengine3",' /etc/cfengine3/update.cf
    # sed -i 's,RUN_CFEXECD=0,RUN_CFEXECD=1,' /etc/default/cfengine3
    # /etc/init.d/cfengine3 restart
    # cf-agent --bootstrap --policy-server 2a01:e35:242d:e930:250:XXXX:XXXX:XXXXX

  • prefetch apt packages

    I use this command to speed up deb packages download. It will do parallel download of the require .deb files with puf.

    For example with otrs:

    cd /var/cache/apt/archives/ && apt-get -y --print-uris install otrs|awk '{print $1}'|grep "'http" | xargs puf

  • git gc –prune a on complet directory structure

    To run “git gc –prune” on a structure of subdirectory of git repositories, like for example a /git directory on a server:


    find /git -type d -execdir sh -c '[ -f "description" ] && sudo git gc --prune' \;

  • git gc and bup

    To avoid the OOM killer (…) after a git gc call on a bup repository:

    $git config –global pack.windowMemory 512m
    $git config –global pack.threads 10

  • backup LVM LV with bup

    Bup is a backup software that use git for the storage. Bup import chunks of file to deduplicate large files.

    tosh-r630:~/backup$cat /dev/mapper/virtualmachines-sarge | bup split -n virtualmachines-sarges
    bloom: adding 1 file (10967 objects).
    tosh-r630:~/backup$bup join virtualmachines-sarges > /tmp/sarges.img
    tosh-r630:~/backup$file /tmp/sarges.img
    /tmp/sarges.img: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, stage2 address 0x2000, stage2 segment 0x200, GRUB version 0.94; partition 1: ID=0x83, active, starthead 1, startsector 63, 9976302 sectors; partition 2: ID=0x5, starthead 0, startsector 9976365, 498015 sectors, code offset 0x48

  • Wininetd 0.7

    Just a remainder, this is the command line needed to build WinInetd with gcc:

    gcc service.c wininetd.c -lws2_32 -lm

  • OpenSSL1.0.0e+Net::SSLeay on Windows

    I managed to get Net::SSLeay to work with the last OpenSSL release. Here just some not for myself.

    OpenSSL test-suite build will fail but the .a and the openssl.exe file are ok.

    ; LIBPATH=`echo $LIBPATH | sed -e ‘s/ /:/g’`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=ideatest.exe} ideatest.o ${LIBDEPS} )
    make[2]: Leaving directory `/cygdrive/c/strawberry/openssl-1.0.0e/test’
    gcc -I.. -I../include -DOPENSSL_THREADS -D_MT -DDSO_WIN32 -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM -c -o md2test.o md2test.c
    md2test.c:1: error: expected identifier or ‘(‘ before ‘!’ token
    md2test.c:1: error: stray ‘\377’ in program
    md2test.c:1: error: stray ‘\376′ in program
    md2test.c:1:14: warning: null character(s) ignored
    md2test.c:1:16: warning: null character(s) ignored
    md2test.c:1:18: warning: null character(s) ignored
    md2test.c:1:20: warning: null character(s) ignored
    md2test.c:1:22: warning: null character(s) ignored
    md2test.c:1:24: warning: null character(s) ignored
    md2test.c:1:26: warning: null character(s) ignored
    md2test.c:1:28: warning: null character(s) ignored
    md2test.c:1:30: warning: null character(s) ignored
    md2test.c:1:32: warning: null character(s) ignored
    md2test.c:1:34: warning: null character(s) ignored
    : recipe for target `md2test.o’ failed
    make[1]: *** [md2test.o] Error 1
    make[1]: Leaving directory `/cygdrive/c/strawberry/openssl-1.0.0e/test’
    Makefile:255: recipe for target `build_tests’ failed
    make: *** [build_tests] Error 1

    Administrator@ordi-de-gon▒ri /cygdrive/c/strawberry/openssl-1.0.0e

    The openssl.exe binary is in apps/ on Windows, not bin. Net::SSleay Makefile.PL file to find the OpenSSL distribution because of that.

    (…)
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x251a): undefined reference to `_imp__CertOpenStore@20′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x255f): undefined reference to `imp__CertFreeCertificateContext@4′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x2576): undefined reference to `_imp__CertCloseStore@8′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x25d5): undefined reference to `_imp__CertEnumCertificatesInStore@8′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x2e1a): undefined reference to `_imp__CertOpenStore@20′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x2e4d): undefined reference to `_imp__CertEnumCertificatesInStore@8′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x2f28): undefined reference to `_imp__CertDuplicateCertificateContext@4′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x2fb1): undefined reference to `_imp__CertCloseStore@8′
    c:\strawberry\openssl-1.0.0e\libcrypto.a(e_capi.o):e_capi.c:(.text+0x30e6): undefined reference to `_imp__CertFreeCertificateContext@4′
    collect2: ld returned 1 exit status
    dmake: Error code 129, while making ‘blib\arch\auto\Net\SSLeay\SSLeay.dll’

    The patch applied to get Net::SSLeay to build.

    — Net-SSLeay-1.42.orig/inc/Module/Install/PRIVATE/Net/SSLeay.pm 2011-10-03 08:23:34.000000000 +0200
    +++ Net-SSLeay-1.42/inc/Module/Install/PRIVATE/Net/SSLeay.pm 2011-12-03 02:22:28.286660290 +0100
    @@ -90,7 +90,7 @@ EOM
    # libeay32 and ssleay32.
    # This construction will not complain as long as it find at least one
    # libssl32.a is made by openssl onWin21 with the ms/minw32.bat builder
    – push @{ $opts->{lib_links} }, qw( libeay32MD ssleay32MD libeay32 ssleay32 libssl32);
    + push @{ $opts->{lib_links} }, qw( libssl libcrypto Crypt32 );
    } else {
    $opts->{optimize} = ‘-O2 -g’;
    push @{ $opts->{lib_links} },
    @@ -172,9 +172,10 @@ sub find_openssl_exec {
    my ($self, $prefix) = @_;

    my $exe_path;
    – for my $subdir (qw( bin sbin out32dll )) {
    + for my $subdir (qw( apps bin sbin out32dll )) {
    my $path = File::Spec->catfile($prefix, $subdir, “openssl$Config{_exe}”);
    – if ( -x $path ) {
    +
    + if ( -e $path ) {
    return $path;
    }
    }