Monday, November 30, 2009

Copenhague: L'Ultimatum Climatique

Le lien pour signer la petition:

http://www.copenhague-2009.com/

LC_NUMERIC

I was recently involved in a thread on ITK mailing list, where it was discussed the use of LC_NUMERIC. In DICOM it is very important to write floating point number in C-style format.

At first I thought I could test using:

http://groups.google.com/group/comp.lang.c++/browse_thread/thread/a881d87a65b260b7

well in fact it is much more complex:

http://gdcm.svn.sf.net/viewvc/gdcm/trunk/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestLCNumeric.cxx?view=markup

Now I can setup test to check whether GDCM is LC_NUMERIC independant or not !

Bastille

I was looking for documentation on how to secure a debian server and found out those links:

* http://todeathwithasmile.blogspot.com/2009/06/bastille-and-debian-5-aka-lenny.html

Which leads to :

* http://www.linode.com/forums/viewtopic.php?p=20446

So on my debian 5.0 system, I had to install the testing for bastille:

$ sudo apt-get install -t testing bastille

which leads to:

$ apt-cache policy bastille
bastille:
Installed: 1:3.0.9-12
Candidate: 1:3.0.9-12
Version table:
*** 1:3.0.9-12 0
200 http://ftp.fr.debian.org testing/main Packages
100 http://ftp.fr.debian.org unstable/main Packages
100 /var/lib/dpkg/status
1:2.1.1-19 0
500 http://ftp.fr.debian.org lenny/main Packages


Now to get is working with X interface, you have to:

$ sudo su -
$ InteractiveBastille

If you get an error for Tk.pm you stimply need to:

$ apt-get install perl-tk

Cheers !

Sunday, November 29, 2009

vimdiff DICOM files

autocmd BufReadPre *.dcm set ro
autocmd BufReadPre *.dcm set hlsearch!
autocmd BufReadPost *.dcm silent %!dcmdump "%" -

error: Unable to find hp-toolbox on PATH.

Ok, I am giving up. I cannot get hplip to work from unstable.

Let's hope reverting to testing is ok.

Boot Debian from an USB device

I have been struggling for the past days to prepare a USB Key for booting up debian. I was reading:

http://d-i.alioth.debian.org/manual/en.i386/ch04s03.html#ftn.id318505

Well the important part is :

# zcat boot.img.gz > /dev/sdX

This is completely different from:

# zcat boot.img.gz > /dev/sdX1

One is writing to the disk (create the partition at the time), while the other one is simply copying to the 1st partition.

BTW, there is also a good link that never showed up on my google search:

http://www.debian-administration.org/articles/446

Friday, November 27, 2009

password-stores = keychain on MacOSX

On your MacOSX., have a setup such that:

$ cat .subversion/config
password-stores = keychain

$ cat .subversion/servers
store-passwords = yes
store-plaintext-passwords = no


If you have any svn.simple directory make sure to delete it first. You should be all set.

See my post at:
http://svn.haxx.se/users/archive-2009-11/0677.shtml

Wednesday, November 25, 2009




You want the best from GDCM, but are you are using Activiz ? Well take the best from both.
You can now use GDCM directly from C# using the Activiz framework !

This image was a screenshot of:

$ mono ./bin/HelloActiviz3.exe ~/Creatis/gdcmData/012345.002.050.dcm

Enjoy.

There are no availible options for this view.

Since a few days the viewvc software installed on sf.net is displaying this funky message:

"There are no availible options for this view. "

Eg:

http://gdcm.svn.sourceforge.net/viewvc/gdcm/trunk/CMakeLists.txt?r1=6312&r2=6313

Patching nvidia-graphics-drivers

I finally took the time to work on the issue that has been killing me from the begining. I could not switch away from my DisplayPort otherwise my monitor would enter in Power Save mode.

See my post:

http://www.mail-archive.com/debian-user@lists.debian.org/msg551758.html
http://www.mail-archive.com/debian-user@lists.debian.org/msg560095.html

Yesterday I finally found this post:

http://www.nvnews.net/vbulletin/showthread.php?t=135751

And today I decide to get my hand at patching the nvidia-graphics-drivers debian package. See my patch at:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557913

I simply had to dpkg -i install the kernel source, then I followed my own instructions:

http://malatsblog.blogspot.com/2009/11/nvidia-on-debian.html

I did the module-assistant dance ... it worked out nicely !

I can finally switch to my mac mini on DVI and then back to my debian station on DisplayPort.

Cheers

Tuesday, November 24, 2009

Doing UTF-16 on Win system

Conventional wisdom is retarded, aka What the @#%&* is _O_U16TEXT?

http://blogs.msdn.com/michkap/archive/2008/03/18/8306597.aspx

Educate to Innovate

From the white house:

http://www.whitehouse.gov/the-press-office/remarks-president-education-innovate-campaign

Monday, November 23, 2009

Installing CMake on MacOSX from the command line

I did not want to following instructions from:

http://www.boost.org/doc/libs/1_40_0/doc/html/quickbook/install.html

as it painful from an admin point of view. Instead using macports this was a no-brainer:

$ sudo /opt/local/bin/port -v selfupdate
---> Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
receiving file list ... done

sent 36 bytes received 417227 bytes 119218.00 bytes/sec
total size is 29398873 speedup is 70.46
---> Updating MacPorts base sources using rsync
receiving file list ... done

sent 36 bytes received 6869 bytes 2762.00 bytes/sec
total size is 4021380 speedup is 582.39
MacPorts base version 1.8.1 installed,
MacPorts base version 1.8.1 downloaded.
---> MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
port upgrade outdated



$ sudo /opt/local/bin/port install boost
---> Computing dependencies for boost
---> Fetching boost-jam
---> Attempting to fetch boost-jam-3.1.17.tgz from http://mesh.dl.sourceforge.net/boost
---> Verifying checksum(s) for boost-jam
---> Extracting boost-jam
---> Applying patches to boost-jam
---> Configuring boost-jam
---> Building boost-jam
---> Staging boost-jam into destroot
---> Installing boost-jam @3.1.17_0
---> Activating boost-jam @3.1.17_0
---> Cleaning boost-jam
---> Fetching bzip2
---> Attempting to fetch bzip2-1.0.5.tar.gz from http://www.bzip.org/1.0.5
---> Verifying checksum(s) for bzip2
---> Extracting bzip2
---> Applying patches to bzip2
---> Configuring bzip2
---> Building bzip2
---> Staging bzip2 into destroot
---> Installing bzip2 @1.0.5_3+darwin
---> Activating bzip2 @1.0.5_3+darwin
---> Cleaning bzip2
---> Fetching zlib
---> Attempting to fetch zlib-1.2.3.tar.bz2 from http://www.gzip.org/zlib/
---> Verifying checksum(s) for zlib
---> Extracting zlib
---> Applying patches to zlib
---> Configuring zlib
---> Building zlib
---> Staging zlib into destroot
---> Installing zlib @1.2.3_3
---> Activating zlib @1.2.3_3
---> Cleaning zlib
---> Fetching boost
---> Attempting to fetch boost_1_41_0.tar.bz2 from http://mesh.dl.sourceforge.net/boost
---> Verifying checksum(s) for boost
---> Extracting boost
---> Applying patches to boost
---> Configuring boost
---> Building boost
---> Staging boost into destroot
---> Installing boost @1.41.0_0
---> Activating boost @1.41.0_0
---> Cleaning boost
Installing macport

http://www.macports.org/install.php#pkg

$ curl -O http://distfiles.macports.org/MacPorts/MacPorts-1.8.1-10.6-SnowLeopard.dmg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 431k 100 431k 0 0 148k 0 0:00:02 0:00:02 --:--:-- 209k
dhcp-67-178:Software mathieu$ hdiutil attach ./MacPorts-1.8.1-10.6-SnowLeopard.dmg
Checksumming Protective Master Boot Record (MBR : 0)…
Protective Master Boot Record (MBR :: verified CRC32 $3A3AE94A
Checksumming GPT Header (Primary GPT Header : 1)…
GPT Header (Primary GPT Header : 1): verified CRC32 $CA2CC8A2
Checksumming GPT Partition Data (Primary GPT Table : 2)…
GPT Partition Data (Primary GPT Tabl: verified CRC32 $395B8734
Checksumming (Apple_Free : 3)…
(Apple_Free : 3): verified CRC32 $00000000
Checksumming disk image (Apple_HFS : 4)…
............................................................................................................................................................................................................................................................................
disk image (Apple_HFS : 4): verified CRC32 $260D55ED
Checksumming (Apple_Free : 5)…
(Apple_Free : 5): verified CRC32 $00000000
Checksumming GPT Partition Data (Backup GPT Table : 6)…
GPT Partition Data (Backup GPT Table: verified CRC32 $395B8734
Checksumming GPT Header (Backup GPT Header : 7)…
GPT Header (Backup GPT Header : 7): verified CRC32 $E963A641
verified CRC32 $1EEE11CE
/dev/disk4 GUID_partition_scheme
/dev/disk4s1 Apple_HFS /Volumes/MacPorts-1.8.1


$ cd /Volumes/MacPorts-1.8.1

$ sudo installer -pkg MacPorts-1.8.1.pkg -target /
installer: Package name is MacPorts-1.8.1
installer: Installing at base path /
installer: The install was successful.

$ sudo port -v selfupdate
sudo: port: command not found

Hum looks like my .profile was not copied as expected (*)

(*) http://guide.macports.org/#installing.shell

SVN and clear password

I could just not setup a regular cmake/ctest environment on a dashboard machine as our svn server had no anonymous user. I could not just use my username+password everywhere either.

It looks like now this is possible on Win32, MacOSX and finally most UNIX system:

http://blogs.open.collab.net/svn/2009/07/subversion-16-security-improvements.html

Yeah !

Installing CMake on MacOSX from the command line

I thought I could just :

curl -O http://www.cmake.org/files/v2.8/cmake-2.8.0-Darwin-universal.dmg

hdiutil attach cmake-2.8.0-Darwin-universal.dmg

cd /Volumes/cmake-2.8.0-Darwin-universal

sudo installer -pkg cmake-2.8.0-Darwin-universal.pkg -target /

Oh well ... it still starts up a message box, where you have to click, yes I want the /usr/bin cmake symlink.

D'oh !

Saturday, November 21, 2009

nVidia on debian

First thing first:

$ vim /etc/apt/sources.list

deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

$ sudo apt-get update

$ sudo apt-get install module-assistant

$ sudo m-a prepare

$ sudo m-a update

$ sudo m-a a-i nvidia

By now something should have gone wrong (*), so now fix it by using the nvidia driver from unstable:

$ sudo apt-get install -t unstable nvidia-kernel-source

Don't forget to remove old stuff

$ sudo apt-get remove nvidia-glx

Yeah for some reason driver for kernel 2.6.26-2-686 was pulled while uname returned: 2.6.30-bpo.1-686

So again clean it up:

$ sudo apt-get remove nvidia-kernel-2.6.26-2-686

Remove any old compilation binaries:

$ sudo m-a clean nvidia

Same player:

$ sudo m-a a-i nvidia

You should be all set now !

Now you can install

$ sudo apt-get install -t unstable nvidia-glx-dev

Cheers

Thursday, November 12, 2009

Uploading file to sf.net is broken

I am following the instructions from:

http://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download

So this give:

$ rsync -e ssh GDCM-2.0.14-Linux-x86_64.tar.bz2 GDCM-2.0.14-Linux-x86_64.tar.gz gdcm-2.0.14.tar.bz2 gdcm-2.0.14.tar.gz "malat,gdcm@frs.sourceforge.net:/home/frs/project/g/gd/gdcm/gdcm 2.x/GDCM 2.0.14"
ERROR: destination must be a directory when copying more than 1 file
rsync error: errors selecting input/output files, dirs (code 3) at main.c(600) [receiver=3.1.0dev]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

this is not working, I had to do:

$ sftp malat,gdcm@frs.sourceforge.net
sftp> put GDCM-2.0.14-Linux-x86_64.tar.bz2
Uploading GDCM-2.0.14-Linux-x86_64.tar.bz2 to /home/pfs/project/g/gd/gdcm/gdcm 2.x/GDCM 2.0.14/GDCM-2.0.14-Linux-x86_64.tar.bz2
GDCM-2.0.14-Linux-x86_64.tar.bz2 100% 2876KB 1.4MB/s 00:02
sftp> put GDCM-2.0.14-Linux-x86_64.tar.gz
Uploading GDCM-2.0.14-Linux-x86_64.tar.gz to /home/pfs/project/g/gd/gdcm/gdcm 2.x/GDCM 2.0.14/GDCM-2.0.14-Linux-x86_64.tar.gz
GDCM-2.0.14-Linux-x86_64.tar.gz 100% 3215KB 1.6MB/s 00:02
sftp> put gdcm-2.0.14.tar.bz2
Uploading gdcm-2.0.14.tar.bz2 to /home/pfs/project/g/gd/gdcm/gdcm 2.x/GDCM 2.0.14/gdcm-2.0.14.tar.bz2
gdcm-2.0.14.tar.bz2 100% 2537KB 1.2MB/s 00:02
sftp> put gdcm-2.0.14.tar.gz
Uploading gdcm-2.0.14.tar.gz to /home/pfs/project/g/gd/gdcm/gdcm 2.x/GDCM 2.0.14/gdcm-2.0.14.tar.gz
gdcm-2.0.14.tar.gz 100% 3319KB 1.6MB/s 00:02
sftp> ^D


Sigh, this is an admin worse nightmare...

Private DICOM dictionary

Looking at the private dictionary for pydicom:

http://code.google.com/p/pydicom/

It says:

http://code.google.com/p/pydicom/source/browse/source/generate_dict/make_private_dict.py

...
# Generates output from a file from the MDCM project (http://code.google.com/p/mdcm),
...

The only issue is that mdcm is LGPL, while pydicom claims to be MIT... There is a clear conflict of license here.

So I filled in a bug report:

http://code.google.com/p/pydicom/issues/detail?id=61&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Difficulty

I cannot believe they prefered to used the dictionary from mdcm, instead of using the easy-to-parse XML dictionary from GDCM

http://gdcm.svn.sf.net/viewvc/gdcm/trunk/Source/DataDictionary/privatedicts.xml?view=markup

oh well...

Sunday, November 8, 2009

2012: la fin du monde ?

Pas si sur, ca serait plutot 2220, d'apres cet article:

http://science.slashdot.org/story/09/10/26/1517242/2012-a-Miscalculation-Actual-Calendar-Ends-2220

-> http://www.natutech.nl/00/nt/nl/47/artikel/26050/Balen:_%272012%27_is_pas_over_twee_eeuwen.html

Postfix Gmail SMTP Relay

I was trying to setup postfix to relay email to my gmail account and found out:

http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/

which is working, compared to a skrewed solution like:

http://bookmarks.honewatson.com/2008/04/20/postfix-gmail-smtp-relay/#comment-1154


Cheers

HAL Keymap Quirks

Today trying to start the wifi I discover things were not working as expected. Check this thread:

http://groups.google.com/group/linux.debian.user/browse_thread/thread/a35291009da3f16d

So searching on the net for:

[ 446.068109] atkbd.c: Unknown key pressed (translated set 2, code 0x88 on isa0060/serio0).
[ 446.068117] atkbd.c: Use 'setkeycodes e008 ' to make it known.


reveal this bug report on debian:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=475851

Which lead to this page:

http://people.freedesktop.org/~hughsient/quirk/quirk-keymap-index.html

Bad luck, this is not working anymore and there is no redirect. Using web.archive I found this page:

http://web.archive.org/web/20080224232936/http://people.freedesktop.org/~hughsient/quirk/quirk-keymap-index.html

Searching for keywords on this page, reveal that this page has moved to:

http://hal.freedesktop.org/quirk/quirk-keymap-index.html

Pheeww.... that was hard !

Tuesday, November 3, 2009

a.vim : Alternate Files quickly

There is a very cool vim script a.vim:

http://vim.sourceforge.net/scripts/script.php?script_id=31

However this script is really poorly documented, so I spend half an hour just to figure out how to add a special extension.

Easy:

let g:alternateExtensions_txx = "hxx,h,hh"


Well now how about t++ -> h++ ? Look easy, try it yourself !

Answer:

:so $HOME/.vim/plugin/a.vim
let g:alternateExtensionsDict['t++'] = "h++"