<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?>

<feed xmlns="http://purl.org/atom/ns#" version="0.3" xml:lang="en-US">
<link href="https://www.blogger.com/atom/15227981" rel="service.post" title="G-Man's Software Engineering Blog" type="application/atom+xml"/>
<link href="https://www.blogger.com/atom/15227981" rel="service.feed" title="G-Man's Software Engineering Blog" type="application/atom+xml"/>
<title mode="escaped" type="text/html">G-Man's Software Engineering Blog</title>
<tagline mode="escaped" type="text/html"></tagline>
<link href="http://www.eichberger.de/g-man.html" rel="alternate" title="G-Man's Software Engineering Blog" type="text/html"/>
<id>tag:blogger.com,1999:blog-15227981</id>
<modified>2005-08-12T05:30:31Z</modified>
<generator url="http://www.blogger.com/" version="5.15">Blogger</generator>
<info mode="xml" type="text/html">
<div xmlns="http://www.w3.org/1999/xhtml">This is an Atom formatted XML site feed. It is intended to be viewed in a Newsreader or syndicated to another site. Please visit the <a href="http://help.blogger.com/bin/answer.py?answer=697">Blogger Help</a> for more info.</div>
</info>
<convertLineBreaks xmlns="http://www.blogger.com/atom/ns#">true</convertLineBreaks>
<entry xmlns="http://purl.org/atom/ns#">
<link href="https://www.blogger.com/atom/15227981/112378369444836493" rel="service.edit" title="VTK Java Installation on RH 9 and Debian" type="application/atom+xml"/>
<author>
<name>German</name>
</author>
<issued>2005-08-11T10:45:00-07:00</issued>
<modified>2005-08-12T05:30:31Z</modified>
<created>2005-08-11T18:08:14Z</created>
<link href="http://www.eichberger.de/2005/08/vtk-java-installation-on-rh-9-and.html" rel="alternate" title="VTK Java Installation on RH 9 and Debian" type="text/html"/>
<id>tag:blogger.com,1999:blog-15227981.post-112378369444836493</id>
<title mode="escaped" type="text/html">VTK Java Installation on RH 9 and Debian</title>
<content type="application/xhtml+xml" xml:base="http://www.eichberger.de/g-man.html" xml:space="preserve">
<div xmlns="http://www.w3.org/1999/xhtml">So at home I am using Debian and at work we are using Redhat. Both systems are completely different and coming from Debian Redhat looks pretty weird.<br/>
<br/>First of all both systems don't come with a decent Java installation. RH seems to put per default the gcj-stuff on I could rant about for hours. Anyway you will have to download the JDK from SUN and install it. On Debian I used the tar.gz version which did a fabulous job -- on RH I used the .rpm version which just threw the whole installation in /usr/java and left the gcj stuff intact, e.g. /usr/bin/java links to gcj...<br/>
<br/>Then you download <a href="http://public.kitware.com/VTK/">VTK</a> (Version 4.4) and <a href="http://www.cmake.org/HTML/Index.html">Cmake</a>, follow the <a href="http://www.duke.edu/~iwd/howto/VTK-Linux-Java_HOWTO.html">instructions</a>, enter <tt>ccmake .</tt> and then use "t" to change some things in the expert mode (especially RH tends to put in the gcj stuff so be sure to do that and also make <tt>ln -sf /usr/java/j2sdk&lt;your favorite version&gt; /usr/local/java</tt>)<br/>
<br/>Java-Settings (Debian):<br/>
<tt>JAVACOMMAND                      /usr/local/java/bin/java<br/> JAVA_ARCHIVE                     /usr/local/java/bin/jar<br/> JAVA_AWT_INCLUDE_PATH            /usr/local/lib/java/include<br/> JAVA_AWT_LIBRARY                 /usr/local/lib/java/jre/lib/i386/libjawt.so<br/> JAVA_COMPILE                     /usr/local/java/bin/javac<br/> JAVA_INCLUDE_PATH                /usr/local/lib/java/include<br/> JAVA_INCLUDE_PATH2               /usr/local/lib/java/include/linux<br/> JAVA_RUNTIME                     /usr/local/java/bin/java<br/>
</tt>
<br/>
<br/>Normal Settings (no "t")<br/>
<tt>
<br/> BUILD_EXAMPLES                   ON<br/> BUILD_SHARED_LIBS                ON<br/> CMAKE_BACKWARDS_COMPATIBILITY    2.2<br/> CMAKE_BUILD_TYPE<br/> CMAKE_INSTALL_PREFIX             /usr/local<br/> VTK_DATA_ROOT                    ../VTKData-release-4-2<br/> VTK_USE_HYBRID                   ON<br/> VTK_USE_PARALLEL                 OFF<br/> VTK_USE_PATENTED                 ON<br/> VTK_USE_RENDERING                ON<br/> VTK_WRAP_JAVA                    ON<br/> VTK_WRAP_PYTHON                  OFF<br/> VTK_WRAP_TCL                     OFF<br/>
</tt>
<br/>
<br/>After a couple of <b>c</b>onfigures you can finally hit <b>g</b>enerate and the system will generate the makefiles. Run make and a long coffee break later you should  have something compiled.<br/>
<br/>Adjust the <tt>LD_LIBRARY_PATH</tt> to include &lt;Your favorite VTK installation path&gt;/bin and off you go for your first test ride. Well, you might want to add the <a href="http://ij-plugins.sourceforge.net/vtk-examples/">VTK Java Examples</a> and then you will have to do the following additional steps:<br/>
<br/>
<tt>
<br/>mkdir classes/<br/>cp ~/VTK/Wrapping/Java/vtk/* ~/VTK/java/vtk/<br/>cp ~/VTK-Examples/Wrapping/Java/vtk/* ~/VTK/java/vtk/<br/>cd ~/VTK/java/vtk<br/>mv vtkSettings.java.in vtkSettings.java<br/>cd ..<br/>/usr/local/java/bin/javac -d classes/ vtk/*.java<br/>/usr/local/java/bin/javac -d classes/ vtk/util/*.java<br/>cd classes/<br/>/usr/local/java/bin/jar cvf vtk.jar vtk/<br/>/usr/local/java/bin/jar i vtk.jar<br/>cp vtk.jar ../../bin/<br/>
</tt>
<br/>
<br/>This allow you to just import vtk.jar as an external jar in eclipse to use all the things in <a href="http://ij-plugins.sourceforge.net/vtk-examples/api/index.html">vtk.util</a>.<br/>
<br/>Hopefully that works out for you. Let me know if you have any trouble and I might follow up in this blog.</div>
</content>
<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
</entry>
<entry xmlns="http://purl.org/atom/ns#">
<link href="https://www.blogger.com/atom/15227981/112361340819502967" rel="service.edit" title="libgmail adjustments and database backup" type="application/atom+xml"/>
<author>
<name>German</name>
</author>
<issued>2005-08-09T11:37:00-07:00</issued>
<modified>2005-08-09T19:28:38Z</modified>
<created>2005-08-09T18:50:08Z</created>
<link href="http://www.eichberger.de/2005/08/libgmail-adjustments-and-database.html" rel="alternate" title="libgmail adjustments and database backup" type="text/html"/>
<id>tag:blogger.com,1999:blog-15227981.post-112361340819502967</id>
<title mode="escaped" type="text/html">libgmail adjustments and database backup</title>
<content type="application/xhtml+xml" xml:base="http://www.eichberger.de/g-man.html" xml:space="preserve">
<div xmlns="http://www.w3.org/1999/xhtml">So today I want to share my little adjustments to <a href="http://libgmail.sourceforge.net/">libgmail</a>, Python's binding to access gmail. libgmail comes with lots of excellent little programs. Most notably is gcp which copies a file from the local filesystem to gmail. Hence it's the ideal system to perfrom for instance nightly backups of a database to gmail.<br/>
<br/>Unfortunately gcp asks you every time for the password/login so it can't really run as a cron job -- at leat not that easy. That's why I chnaged some lines and dubbed the new program gecp:<br/>
<br/>-----------------------------------------------------------------------------------<br/>
<tt>#!/usr/bin/python2.3<br/>#<br/># gcp.py -- Demo to copy a file to Gmail using libgmail<br/>#<br/># $Revision: 1.1 $ ($Date: 2004/10/17 13:34:04 $)<br/>#<br/># Author: follower@myrealbox.com<br/>#<br/># License: GPL 2.0<br/>#<br/>import os<br/>import sys<br/>import logging<br/>
<br/># Allow us to run using installed `libgmail` or the one in parent directory.<br/>try:<br/>import libgmail<br/>logging.warn("Note: Using currently installed `libgmail` version.")<br/>except ImportError:<br/># Urghhh...<br/>sys.path.insert(1,<br/>              os.path.realpath(os.path.join(os.path.dirname(__file__),<br/>                                            os.path.pardir)))<br/>import libgmail<br/>
<br/>
<br/>if __name__ == "__main__":<br/>import sys<br/>from getpass import getpass<br/>
<br/># TODO: Allow copy from account.<br/>
<br/>try:<br/>  filename = sys.argv[1]<br/>  destination = sys.argv[2]<br/>  pw = sys.argv[3]<br/>except IndexError:<br/>  print "Usage: %s <filename> <account>:[<label>/]i pw" % sys.argv[0]<br/>  raise SystemExit<br/>
<br/>name, label = destination.split(":", 1)<br/>
<br/>if label.endswith("/"):<br/>  label = label[:-1]<br/>
<br/>if not label:<br/>label = None<br/>
<br/>
<br/>ga = libgmail.GmailAccount(name, pw)<br/>
<br/>print "\nPlease wait, logging in..."<br/>
<br/>try:<br/>  ga.login()<br/>except libgmail.GmailLoginFailure:<br/>  print "\nLogin failed. (Wrong username/password?)"<br/>else:<br/>  print "Log in successful.\n"<br/>
<br/>  if ga.storeFile(filename, label=label):<br/>      print "File `%s` stored successfully in `%s`." % (filename, label)<br/>  else:<br/>      print "Could not store file."<br/>
<br/>  print "Done."</label>
</account>
</filename>
</tt>
<br/>---------------------------------------------------------------------------------<br/>
<br/>You can use <tt>gecp &lt;filename&gt; &lt;gmail-account&gt;[:label] &lt;password&gt;</tt> to copy a file to your gamil account. Be careful: GMail limits the filesize to 10MB so you have to split longer files accordingly. (To reassemble them again juts use cat file1 file2 file3 &gt; targetfile;-)<br/>
<br/>I am using the following little script in a cronjob to backup the content of a MySQL database:<br/>
<br/>---------------------------------------------------------------------------------<br/>
<tt>#!/bin/bash<br/>
<br/>cd ~german/backup/<br/>#remove all files<br/>rm -f ~german/backup/survey-*<br/>rm -f ~german/backup/xsurvey-*<br/>
<br/>#dump database<br/>date=`date -I`<br/>mysqldump  --opt -u admin --password="MyDBPassword" MyDatabaseName | bzip2 -c &gt; ~german/backup/survey-$date.sql.bz2<br/>
<br/>#split<br/>split -b10m survey-$date.sql.bz2 xsurvey-$date<br/>
<br/>#copy to gmail<br/>for file in  xsurvey-*;do  python ~/libgmail/demos/gecp.py $file MyGMailAccount:Backup MyPassword; done</tt>
<br/>-------------------------------------------------------------------------------------<br/>
<br/>I hope this is of some use for somebody;-)</div>
</content>
<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
</entry>
<entry xmlns="http://purl.org/atom/ns#">
<link href="https://www.blogger.com/atom/15227981/112352581998342049" rel="service.edit" title="Hello" type="application/atom+xml"/>
<author>
<name>German</name>
</author>
<issued>2005-08-08T11:22:00-07:00</issued>
<modified>2005-08-11T18:13:03Z</modified>
<created>2005-08-08T18:30:19Z</created>
<link href="http://www.eichberger.de/2005/08/hello.html" rel="alternate" title="Hello" type="text/html"/>
<id>tag:blogger.com,1999:blog-15227981.post-112352581998342049</id>
<title mode="escaped" type="text/html">Hello</title>
<content type="application/xhtml+xml" xml:base="http://www.eichberger.de/g-man.html" xml:space="preserve">
<div xmlns="http://www.w3.org/1999/xhtml">Hi,<br/>
<br/>my name is German but to not confuse me with my natinality people in the US call me G-Man; hence the name for my Blog. This is a somewhat commercial endeavour since we will have ads benefitting my company <a href="http://www.e-nnovate.com">e-nnovate Technologies Inc.</a> <br/>
<br/>Topics I like to cover are FreeNX, VTK, ITK, etc. It doesn't matter if you don't understand the acronyms yet I will explain them later...<br/>
<br/>I work a couple of jobs: lot's of consulting - <a href="http://www.e-nnovate.com">e-nnovate</a>, <a href="http://www.illuminategroup.com/">ICG</a>. <a href="http://www.digitalfishlibrary.org/">DFL</a>, <a href="http://www.sdmesa.edu/">Adjunct Faculty @ Mesa College</a> and of course a real one - <a href="http://extension.ucsd.edu/IT">UCSD Extension IT courses</a>
<br/>
<br/>I will write about a couple of things in the next few days...</div>
</content>
<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
</entry>
</feed>
