How to install and run an AIR application on a headless Linux server?

May 10th, 2010 by matthias

Task

I had to run existing ActionScript code on a headless Linux server and decided to do it by running an AIR application with the Xvfb virtual X server, as reasoned for in my article “How to run ActionScript in headless mode (on Linux without X server)?“.

Problem

I did not think that running an AIR application on a headless server would be that large a problem. Here is why it is:

  • The normal Adobe AIR 1.5 runtime installer is a GUI-based installer, no RPM oder DEB packages are available.
  • The normal process of installing an AIR application is also a GUI-based process, so not apt for a Linux headless server.
  • AIR applications itself are GUI-based, always needing an X server. See more on that in this article already linked above.

Discussion

In theory, installing the AIR 1.5 runtime and the AIR application would be possible via VNC or some Xvfb hacking to enable a remote desktop. In practice, I searched for a better solution.

There are two options; first, the headless installation of Adobe AIR 1.5 Runtime if you grab the version you get after applying to distribute AIR. Second, Adobe AIR 2.0 (in beta as of 2010-05-10) offers installation packages for various Linux systems. You can download Adobe AIR 2 Runtime beta Linux packages from Adobe labs. This enables headless installation with ease. The exception is if you are on a 64bit Linux system, in which case you need to follow along the well-done article “Install Adobe AIR 2 on 64-bit Linux distributions” from Adobe.

However, this approach faces another problem: AIR applications normally come in .air files, and these files cannot be installed on a headless server with a AIR Runtime – normally. The only exception is when using a special installer made available by Adobe after successfully applying for a AIR Runtime redistribution licence [source]. You can apply to distribute AIR (as already linked above). The bad thing is that, at least currently (2010-05-10), a redistribution installer is not available for Linux, and it is not allowed to modify another redistribution installer for that purpose; see the Adobe AIR Runtime distribution FAQ on “Can I distribute the Adobe AIR Runtime on an operating system if a version specific to that OS is not provided?“. So the “Adobe AIR Application Installer -silent file.air” option is not possible on Linux. (If you try that with the standard AIR installer, it says “install failed (see log)”, but even after enabling AIR logging, the log stays empty.)

The solution that I found is to deploy not the .air file but the .swf file and application .xml file that are generated during development in the bin/ output folder. These can be launched with the Adobe debug launcher (the adl command). And adl comes within the Adobe AIR SDK, which is installed by just unpacking, very apt for a headless server. Note: you do not need to install the Flex SDK also if you just want to run an AIR application this way.

By deploying the compiler output directly, we also get around the process of creating the and signing .air installation file. In case you need to do that anyway:

  • First try out the FlexBuilder integrated wizard along the Adobe instructions “Creating your first Flex AIR application in Flash Builder or Flex Builder: Package, sign, and run your AIR application“.
  • If that fails and you are given a strange error code, have a look at the ADT error messages.
  • If that didn’t help either, follow instead the Adobe instructions “Creating your first AIR application with the Flex SDK: Create the AIR installation file“. That finally worked for me.

The last problem is that running an AIR application on a headless server needs an X server in any case. We want to use the Xvfb virtual X server, as already reasoned for in my article “How to run ActionScript in headless mode (on Linux without X server)?“. Brett Adam designed and shared a simple Xvfb wrapper for running an AIR application with Xvfb. It turned out however that the program xvfb-run, coming with Xvfb at least in the Ubuntu 9.10 package, does exactly the same job and offers also more options; so we stick with that.

Solution

Here is a combined list of instructions how to get all this to work, according to the decisions outlined in the discussion section:

  1. Download the Adobe AIR SDK to your server. Download the Adobe AIR SDK manually and upload to your server, or better use:
    wget http://airdownload.adobe.com/air/lin/download/latest/AdobeAIRSDK.tbz2;
  2. Install Xvfb. On Ubuntu systems, install the packages xvfb and xauth for that.
  3. Install the Adobe AIR SDK on your server:
    mkdir /usr/local/share/applications/air-sdk-1.5;
    cd /usr/local/share/applications/air-sdk-1.5;
    tar xjvf AdobeAIRSDK.tbz2;
    ln -s /usr/local/share/applications/adobe-air-sdk-1.5/bin/adl /usr/local/bin/;
    ln -s /usr/local/share/applications/adobe-air-sdk-1.5/bin/adt /usr/local/bin/;
  4. Upload your AIR application to your server (just the .swf and .xml file in you project’s bin/ folder).
  5. Launch you application with xvfb-run:
    xvfb-run -e log.txt --auth-file Xauth --server-num=99 adl Application-app.xml
  6. If you need to run your applications with arguments, do it like this:
    xvfb-run -e log.txt --auth-file Xauth --server-num=99 adl Application-app.xml -- --arg val
  7. If you need to keep Xvfb running (e.g. because you need to start the AIR application many times and want to get rid of the 3s delay to start Xvfb every time to improve performance), here is a technique for that. It is re-using xvfb-run, letting it run a command that never returns, and then lets other applications connect to the started X server:
    xvfb-run -e log.txt --auth-file Xauth --server-num=99 sleep 1000d &;
    DISPLAY=:99 XAUTHORITY=Xauth adl Application-app.xml -- --arg val

Posted in ActionScript, Sprache: Englisch, alle Artikel | No Comments »

What is a typical discharge pattern for a ThinkPad T4x extended accumulator?

November 22nd, 2009 by matthias

The computer was an IBM ThinkPad T41, the accu a 9-cell extended accumulator with originally 78 Wh, slightly used (33 cycles) and somewhat older (manufactured end of 2004, tested here at 2009-11-21).

Accu runtime of that setup: 5h 39min. At screen brightness level 5 of 7, screen always on, Windows running, but no applications running.

After the 5h 39min it showed “3% remaining capacity” (probably just when the voltage went below 10.8V nominal voltage, which you can see in the ThinkVantage accu info dialog) and immediately went into Windows hibernate. Then, when booting into BIOS, it run 2 minutes until the “heavy” beep alarm rang, and another 30s before it went to suspend-to-RAM. Then it was only able to start / resume with the AC adaptor plugged into, and immediately went into suspend-to-RAM again when plugging it out. It remained in suspend-to-RAM (without AC adaptor) for something between 15 and 24 hours (so probably around 20 hours) when it finally switched totally off.

Posted in alle Artikel | No Comments »

What is the meaning of clock time and CPU time in the TPTP framework for Eclipse 3.4?

November 18th, 2009 by matthias

First, let’s create definitions for the different kind of “time” involved in profiling:

  • Wall clock time. The real-world time that passes while a computer executes a certain task. Like using a stop watch to measure that task. This time can be affected by anything that a multi-tasking system does in parallel to running the task under profiling. For single-core CPUs, it is the sum of the task’s CPU time (see below), CPU time of parallel processes, programmed delays and the
    communication channel delay (the delay for network transmission). For programs in parallel execution on multi-core CPUs, CPU time is the sum of the CPU times on each core, while wall clock time is lower than this sum.
  • CPU time. The sum of user CPU time and system CPU time. It is proportional to the CPU cycles used for running the profiled task and anything it requested. Hence, it does not include programmed delays, or waiting for resources (like data from I/O devices, or being scheduled to get the CPU).
  • User CPU time. The amount of time that a CPU (or CPUs) were busy running a user process (so excluding system calls to the kernel like for I/O).
  • System CPU time. The amount of time that a CPU (or CPUs) were busy running system calls (kernel code) that was called from the user code under profiling.

Sources used: question 48455 on serverfault.com, Wikipedia on wall clock time.

Now, in the TPTP framework, “clock time” means wall clock time and “CPU time” means CPU time. However, the CPU time counter is inaccurate and not granular enough: it does not include methods that run less than 1ms, due to JVM limitations. That accounts for the fact that CPU time can be both higher and lower than clock time on single-core machines.

Source for last paragraph: message 5503 on news.eclipse.tptp.

For profiling this means to better not use the CPU time counter, keep the computer “calm” (resp. in comparable conditions) when running the tests to get comparable wall clock time values, and perform multiple iterations of test actions to get more representatiove wall-clock time values by averaging.

Posted in Eclipse, Java, alle Artikel | No Comments »

How best to convert iCal 2.0 to CSV, and how to FreeMind?

November 18th, 2009 by matthias

See also the post “Wie kann ich am besten die Journal-Einträge von korganizer in ein anderes Format konvertieren?”, here in this blog.

The source file is here an iCalendar 2.0 file, created by kaddressbook:

BEGIN:VCALENDAR
PRODID:-//K Desktop Environment//NONSGML KOrganizer 4.2.4//EN
VERSION:2.0

The task is, ultimately, to convert this iCal file to a FreeMind mindmap, using one node per entry, with a special text formatting (task / appointment text prepended with the date and category and the like). This is best done by creating a text file with one task / appointment per line, if you want separated by empty lines, and subtasks indented by two spaces (or four, six etc. for deeper sub-levels). Pasting such a text file by Ctrl+C and Ctrl+V into FreeMind will create a hierarchical node structure.

However, how to create such a file from iCal without too much manual effort?

The following tools come to the mind that could do the conversion job:

  • KOrganizer
  • ical2sqlite (available via the Ubuntu Jaunty package repositories)
  • Evolution
  • Mozilla Sunbird
  • phpicalendar (available via the Ubuntu Jaunty package repositories)
  • ical2html-0.4 (developed by the W3C)
  • iCalcreator 2.2 (but needs programming)

KOrganizer: The only export format is a HTML table for appointments and / or tasks. This is useful already, but would require manual or scripted conversion to the text format. Also, the “done on” timestamps of tasks do not appear in the HTML list.

ical2sqlite: Calling “ical2sqlite file.sql” creates a file Calendar.sqlitedb with table structures, but only data in the Event table, no text data at all (check with “sqlite3 Calendar.sqlitedb”, enter “.dump” there).

Evolution: Copy and paste to a text editor does not work at all, as evolution seems to use its own internal format only. There are no export functions for iCal tasks or appointments. You can print to PDF, but that takes extremely (!) long for many tasks. Better, use the print preview. There you can mark and copy the text, and paste it as a text file with one task per line. The problem is however that only the task names are contained then, no categories, “done at” times, due times etc.. To remove tasks from Evolution after you’re done with it, do “rm ~/.evolution/tasks/local/system/tasks.ics”.

Sunbird: You cannot copy tasks from the task list and paste them into a text editor, as Sunbord uses an internal format. You can use “File -> Export Calendar …” or “File -> Export Selection …” and select “Outlook Comma Separated Values (*.csv)” as the format. But this only exports calendar events, or nothing if you select tasks and call “Export Selection”. There is a function in the task’s context menu to convert them to events (which could then be exported to CSV by Sunbird), but this creates message windows for every tasks, and all at once, so that you can crash X by doing that. Also, Sunbird is really slow when dealing with large iCal files (200 entries or more). In all, it is no solution here.

phpicalendar: It is installed to /usr/share/phpicalendar, so the simplest way to make it running is a symbolic link in you localhost web root directory, pointing to that install directory. I could not get it running with my calendar data (I basically did: enabled the admin page with no authentication in default_configuration.php, made the directory world-writable, and tried to upload a calendar using the admin page). And if it would work, it would only be able to display calendar events, not export them. As it does not use a database, one cannot get the data in table format from there either.

The following finally worked:

Open the iCal file in gedit (or another editor that works well with large text files) and by search&replace convert VTODO entries to VEVENT entries. For that, you have to:

  • replace “BEGIN:VTODO” with “BEGIN:VEVENT”
  • replace “END:VTODO” with “END:VEVENT”
  • remove “DUE” lines (assuming you only deal with completed tasks; else replace “DUE;VALUE=DATE:” with “DTEND;VALUE=DATE:” and omit the conversion of “COMPLETED” below)
  • replace “COMPLETED:” with “DTEND;VALUE=DATE:”
  • remove the time after the original COMPLETED: values, i.e. strings like “T130100Z”
  • remove “RELATED-TO:” lines (this breaks the connection to parent tasks, which is not possible for events)
  • remove “PERCENT-COMPLETED:” lines
  • insert “DTSTART;VALUE=DATE:” lines with the same value as in the DTEND lines; these are needed for VEVENT entries to be correctly parsed, displayed or exported; you can achieve this, e.g. in kate, by a regexp replacement of “DTEND;VALUE=DATE:([0-9]*)” with “DTSTART;VALUE=DATE:\1\nDTEND;VALUE=DATE:\1″; also, it might be enough if events only have a start value, in which case they will be assumed to cover the whole day
  • you do not need to remove resulting empty lines within entries

You can also create a new iCal file that only contains the VTODO entries before you do that conversion above. Use a text editor for this; in a file created by korganizer, VTODO entries come first, then VEVENT, then VJOURNAL, so you can easily separate them. And like with the VTODO entries, do with the VJOURNAL entries if you have them.

So now, your whole iCal file should consist of VEVENT entries only. Open this file in Sunbird and use the “File -> Export Calendar …” feature to export it to a CSV file. Open that CSV file in a spreadsheet application like OpenOffice.org Calc (use your local, non-Unicode encoding). This works perfect, even where the fields contain line breaks within themselves.

However, before you open the CSV files in OpenOffice.org, set its “locale scheme” in the settings to “English (USA)”, or else it will irreversibly apply other date formatting to the imported value (and fail on some, generating a bunch of manual effort here). After the import, you can of course format the date values any way you like.

Then, after you have the data in OOo, use OOo functions (adding and deleting columns, adding text separator columns etc.), export again to CSV (using a space as field separator and no text separator) and fine-tune with a text editor that can replace using regular expressions (like kate). You should do these steps separate with files that are made from events, todos and journals, as you will want different formatting in the end.

Posted in alle Artikel, korganizer | No Comments »

How to get around “too many concurrent SMTP connections from one IP address” errors when mass mailing to web.de customers, with over 15 web.de recipients in the list?

October 28th, 2009 by matthias

The issue is a known problem of web.de servers (still existing in 2009-10) and discussed here. According to that source, the “clean” solution is to restrict the number of concurret SMTP connections to 5 when sending to web.de. However, when at a shared hosting provider, you do not have access to the sendmail etc. configuration, and there should be a solution that does not involve asking the support.

When sending mails from your mail client, you can duplicate the mail, sending each copy to no more than 15 web.de recipients plus others. This is however tedious, if you have to send many mails this way.

The problem also happens when using mailman for example, a group mailing list, and available on HostGator servers. It is not possible to throttle it on HostGator servers, so that they do not recommend it. Which of course also means that you cannot make it send mails to web.de at a slower rate. To throttle mailman, one needs access to the mail transfer agent (sendmail, postfix or other) [source]; which is not possible in shared hosting.

It’s better to set up a mailing list that allows throttling, and configure it to send mails out not too fast. This is possible for example when using PHPList and changing only this one setting to differ from the default: change

define('MAILQUEUE_THROTTLE',0);

to

define('MAILQUEUE_THROTTLE',8);

This will send one e-mail in 8 seconds, and this should never get in conflict with web.de’s restriction on the number of concurrent SMTP connections.

The above setting is also a way to meet your hosting providers restrictions on how many e-mails you can send out in one hour (a widespread restriction with shared hosting providers). See these links, referring to HostGator:

Hostgators mass mailing restrictions are detailed on their mail policy page.

Hostgator offers Phplist as a one-click installation via fantastico.

Now PHPList is a one-way announcement mailing list, no group mailing ist (source). Also, it does not offer posting to the list by e-mailing it. As the well-known group mailing lists do not support throttling themselves (applies to ecartis, ezmlm, ezmlm-idx, mlmmj, Sympa), they cannot be used here however. So we need to hack PHPList for this purpose. (For ezmlm, there seems to be a throttling hack however.)

Hacking PHPList to allow for moderated e-mail based submissions. Preferred solution.

  • Get the Mail2List PHPList plugin to work, using its wiki page and the corresponding forum thread.
  • Automate the “Process new mails” task of the plugin by a cron job, by changing PHPList so that its reglarly run cron job will do this (before runnung the “process queue” task). This task should be changed so that it creates “draft” state messages from the mails, and at the same time e-mail some moderators that there are new mails to be moderated.
  • Set up all list recipients to be allowed to post to the mail-in e-mail address.
  • After somebody mails in a message, the moderators will get informed, and a moderator will log in and finally send the stored message, or delete it.

Hacking PHPList to allow for moderated form-based submissions.

  • One would write a little script that provides a form to submit a message.
  • The message is then entered as “draft” into the PHPList database, and also forwarded to moderators. The moderators are listed in that script, and have access to the PHPList admin interface where they can send or deleted queued messages, and write messages themselves.
  • The script can be integrated with a CMS like WordPress; there are multiple plugins (also for WordPress) that could be used as a template or extended for that purpose; see on integrating PHPList with other packages. By adding a special list to the recipients of a message, the moderators could also do mail-in publishing in a CMS (WordPress, for example, has this feature).

Posted in alle Artikel | No Comments »

How best to create a board shape with holes with Away3D?

October 26th, 2009 by matthias

The task is to create a 3D shape of a board-like object, but it must be possible to have triangular and rectangular shapes removed from the corners, and to have round holes “drilled” through the object. It must also be possible to have textures on the object, and they can be different for the board’s edges and faces. There are many approaches for something like this. Here is a discussion of their pros and cons, using the Away3D 2.4 which is currently the latest version for Flash 9.

The best alternative, chosen from the ones presented below, seems currently “Multiple SkinExtrude meshes”.

  1. Multiple SkinExtrude meshes. Here, one uses class away3d.extrusions.SkinExtrude to create separate meshes for the outer edge and the top and bottom surface. A cylinder primitive without top and bottom and with inverted faces is used for each hole. To create the circle lines for the hole boundaries, cylinders with zero height and without top and bottom can be used to evaluate the coordinates. The textures are applied by using the SkinExtrude.material property on the individual meshes. The faces of the hole meshes have to be inverted, to be visible from the inside only. In the end, all meshes are grouped in one ObjectContainer3D. With more than one round hole in the board this variant is difficult, but possible by zero-width hole connections, or better by combining multiple rectangular plane shapes for the top and bottom surfaces, each with only one hole.
  2. One SkinExtrude mesh. Here, one uses SkinExtrude to create the board shape in one operation. SkinExtrude expects a two-dimensional array, where the contained arrays each become a “line” of connected vertexes, and in addition each point is connected to the corresponding point of the previous and next line so that a grid is created. This allows to create the object in one SkinExtrusion, by giving it the following “line” arrays, in this order: circle on top
    face, outer shape of top face, outer shape of bottom face, circle on
    bottom face. This alternative has the difficulty how to apply different materials to the triangular faces of the mesh; this is possible in principle, as the API docs on SkinExtrude.material say: “Individual material settings on faces, segments and billboards will override this setting.”. However, getting the right faces is the problem.
  3. Elevation class. Using the Elevation class, letting it work on a dynamically created black and white bitmap and removing the zero-height triangles after the elevation is created. Problem: it has only a fixed raster for creating vertexes, so one would need a dense raster, i.e. many polygons, for getting the circle hole round enough. Which is a huge performance problem.
  4. ElevationModifier or NormalUVModifier class. This is better than using the Elevation class because it is not necessary to remove any zero-height triangles afterwards. But the problem is the same: this needs a very fine raster (many polygons) to allow for round holes.
  5. Creating from triangles. It is possible to create the object as a self-built Mesh, made from triangle Face objects and perhaps combined using classes Merge and Weld. This is however the alternative that needs the most own calculations, it does not profit at all from Away3D extrusions or primitives. Especially creating the triangles on the top and bottom surfaces is a problem. It could be solved by using a new type of primitive that looks like an inverted cylinder, without top and bottom, but with a square attached to each side, comparable to how its done with an U.S. doctorate hat, but with holes.
  6. Moving an “inverted cylinder” in a pre-built object. Possible, but only with one hole. The object could be created using a 3D modeling tool.
  7. Using TextExtrude on Flash-generated vector graphics. Using the wumedia.parsers.vector.VectorShapes class from the swfvector library included in Away3D 2.4 it should be possible to add Flash 2D objects to the scene. This would be done in analogy to how the VectorText class is used in TextField3D. These shapes would represent the top and bottom surfaces. Then, the edges could be created by SkinExtrude on a path, or by applying TextExtrude to this shape. However, the VectorShapes objects are “irregular” shapes, not made up from triangles [source] and therefore not (yet) closely integrated with the rest of the library. For example, it’s currently impossible to add texture materials to such objects [source], but this is needed here.

Posted in Away3D, alle Artikel | No Comments »

Some hints on using floating for HTML layouts?

October 16th, 2009 by matthias

Layout means, using the “float:” attribute to position whole columns and large elements that will contain text etc..

First rule: use the “clear: both;” CSS attribute only after all content in the HTML source. Because it affects not just the floating happening in the current div, but enforces positioning below all elements that have a “float:” CSS attribute (i.e. below the one reaching most into the document). If no text follows, this is no harm, and is used to extend the height of the floating divs to the height of the ones with the “float:” attribute.

As you cannot use any “clear:” attribute within the document, you need another means to stop positioning elements from left to right and again position them below each other. The good thing is, this is done automatically: block level elements like divs that contain no explicit width setting (other than 100%) use up 100% of the available space, not allowing other elements to be to their left of right. Only if giving them also a “float:” attribute, their width is just as wide as their content. So in the following example, you have two columns:

<div style="float:left; height: 100px;">column 1 (as wide as its content)</div>
<div>column 2 (as wide as space is available)</div>
<div>also in column 2, not a column 3</div>

Now how do you position more than two elements next to each other? By setting the “float:” attribute on them also. A “float:” attribute only means to allow one other block-level elements on either the right side (for “float:left;”) or the left side (for “float:right;”). If that floating block-level elements does not consume all the available space, the “float:” attribute setting does not (!) cause to fill the remaining space with other block-level elements. For that to happen, for one more block level element on the side, the floating elements must allow to be floated, too, by repeating the “float:” attribute setting. So you can create three columns like this:

<div style="float:left; height: 100px;">column 1 (as wide as its content)</div>
<div style="float:left;">column 2 (as wide as its content)</div>
<div>column 3 (as wide as possible)</div>

But not like this:

<div style="float:left; height: 100px;">column 1 (as wide as its content)</div>
<div width="100px;">column 2 (as wide as its content)</div>
<div>column 3 (as wide as possible)</div>

Because float elements are out of the normal element flow, a “height:100%” setting does not make them as heigh as their parent. If you want to achieve that effect anyway (e.g. to extend the background of side columns to the height of the content column), you need to use the “nested divs” layout of CSS Zen Garden, which goes like this (for three columns):

<div id="level1_leftrightcenter">
  <div id="level2_left" style="float:left;">left column content</div>
    <div id="level2_rightcenter">
      <div id="level3_right" style="float:right;">right column content</div>
      <div id="level3_center">
        <div id="level4_center">center column content</div>
      </div>

      <br style="clear:both;" />
    </div>

    <br style="clear:both;" />
 </div>

Note that the content column is the only one without a “float:” setting. This is to ensure that its width is as wide as possible (resulting in a variable width layout), instead of being as wide as its content (as when applying the “float:” attribute). Note also that all content of the center column is in another “level4_center” div; if there would be direct text content or more than one block element in the “level3_center” div, text could appear below the “level3_right” div due to floating, but this way it will always be to its left, as the “level4_center” div starts left of the “level3_right” div and, as a block level element, has a rectangular shape.

Also note that the values of the “float:” and “clear:” attributes are badly named:

  • “float:left;” actually means “this element is on the left side, allowing to be floated on the right side”, which is counterintuitive
  • “float:right;” for “allow to be floated on the right side” would be better.
  • “clear:left;” means: “clear the effect of any float:left setting for this and following elements”. It would have been better to name this “floating:right;” (to allow only to be a floating element on the right side) resp. “floating:none;” (the equivalent of “clear:both;”).

Also, it would be better to have the “clear:” attribute only apply to floating within the containing block, not to the whole document.

Posted in HTML, Sprache: Englisch, alle Artikel | No Comments »

How to print package labels using Deutsche Post INTERNETMARKE or DHL Online-Frankierung and Ubuntu Linux 9.04 (Jaunty)?

September 17th, 2009 by matthias

In a nutshell: printing to PDF

Be sure that your cups-pdf pseudo printer is set up correctly. No guarantees!

  1. Choose to print with Java (“Paketmarken mit Java”).
  2. Choose the printer “PDF” in the top left.
  3. If you want, do a test print.
  4. Click to print the postage (“Portodruck”).
  5. Open and print the generated PDF file from ~/PDF/.

In a nutshell: printing to a physical printer

Be sure that your physical printer is set up correctly. No guarantees!

  1. Choose to print with Java (“Paketmarken mit Java”).
  2. Choose your physical prnter in the top left.
  3. If you want, do a test print.
  4. Click to print the postage (“Portodruck”).

In more detail

Basically, when createing postage labels for packages, the INTERNETMARKE website redirects you to https://internetmarke.deutschepost.de/internetmarke/print.do and offers two options how to print them:

  1. Printing with Adobe Reader, after downloading a PDF.
  2. A web-startable Java application.

Note that the “Print” (German: “Drucken”) link at the very bottom
right of the Java app’s window just sets prints the
window itself, not the PDF document for the package label. So it’s no option here.

In more detail: printing with Adobe Reader

First of all, you need an active Internet connection, and JavaScript enabled in Adobe Reader to use this solution.

With Adobe Reader, there is the problem that it’s impossible to choose the printer. When pressing “test print”, a print is issued on one of the system’s printers, but without showing a print dialog, a method to choose the printer, or giving a hint what way the target printer is determined. The target printer is neither the system’s standard printer (also restarting Adobe Reader does not help to make it accept a changed standard printer) nor the printer last used in the Adobe Reader print dialog.

So it might be possible to hit the correct printer for printing the postage label, but because you cannot choose a printer yourself, it seems to be impossible to redirect the print output to a file. Because, you neither get a “redirect to file” option in a print dialog, nor can you choose the cups-pdf pseudo printer.

In more details: printing with the Java application

Using the Java application requires an active Internet connection.

Clicking to do a test print (“Testdruck”) in the Java application opens a print dialog, lets you choose a printer (also a cups-pdf pseudo printer and a redirect to file option), and prints fine.

Clicking to do the real print (“Portodruck”) however does not open any print dialog. Instead, it prints to the printer that is currently selected in the Java application’s combo box. If that printer is not set up correctly, the label will be counted as printed, but not be actually outputted. In that case, it is not possible to print it again. The design idea behind this “feature” is probably to programmatically disable the “redirect to file” printing option, to reduce the risk of multiple copies being made.

In more detail: printing to PDF with the Java application

To be able to send package stamps via e-mail (for others to send a
package to you, for example), you need to be able to create a file from
the package stamp print. The working options are:

  1. Print directly to a working file
    pseudo printer (cups-pdf).
  2. Print to a physical printer, and then reprint the job to a working file pseudo printer. This has the advantage that it is secured against the case that the pseudo printer does not work.

If you want to use the first alternative, you need to make sure that your pseudo printer is set up correctly, at least once before doing the first package stamp print. If it is not set up correctly, it might fail printing, and even the CUPS “print again” feature might not work; your stamp is lost, then.

To check if it is set up correctly: In the Java application, do a test print (to
the cups-pdf printer, which is named “PDF”, and without “redirect to file”). Then see if a PDF
appears in ~/PDF/. Rename the test print, as the real print would
else overwrite it. Then you can do the real print, having selected the cups-pdf
printer in the select box of the Java app.

If you want to use the second alternative: You can also use the CUPS management interface at http://localhost:631/jobs/
for re-printing failed jobs. With that, you can only move active jobs
from one printer to another. So, restart the job (so that
it gets active again) and then move it. You can of course re-print several times until you hit a working pseudo printer setup.

In more detail: securing against failed package label prints

Start the tool system-config-printer, go to “Server -> Settings … -> Advanced …” and activate “Preserve job files (allow reprinting)”. This should make it possible to reprint the package stamps in case the print failed. You can then re-print the failed job by showing the printer queue in system-config-printer, enabling “View -> Show finished jobs”, right-clicking a job and select “print again”.

However, note that only printer jobs appear in this list where you did not select “redirect to file” in the printer dialog. So in case you want to repeat printing to file, you need a file pseudo-printer like cups-pdf, instead of a redirection.

Posted in Sprache: Englisch, StampIt, alle Artikel | No Comments »

How to burn DVDs with limited speed, using wodim under Linux?

September 4th, 2009 by matthias

The command is the same as when burning CDs with limited speed, just that you need to use DVD speed factors instead of CD speed factors. Not all factors work; you can see what will work in the line “Starting to write CD/DVD at speed   4.0 in dummy SAO mode for single session.” shown just before starting to burn in dummy mode.

With the Panasonic DVR-K05 burner for example, speeds 2 and 4 do work, and 4 is the maximum supported. If you specify an unsupported speed factor, it is corrected to its nearest lower working equivalent.
To specify your desired speed, use commands like:

  • wodim speed=2 -v -dao /path/to/image.iso;
  • wodim speed=4 -v -dao /path/to/image.iso;

If you do so, wodim will burn with that speed right from the start. But it might be that, when specifying speed=4, wodim will start buring with speed=2 and accelerate later, just as it does when not specifying any speed value.

Posted in Sprache: Englisch, alle Artikel | No Comments »

How to install and run the mobile.de offline vehicle management tool on Linux?

September 4th, 2009 by matthias

The tool is called “”vehicleclient”, “dealertool” and “mobile.de Fahrzeugverwaltung”.

The install package you download is called “vehicleclient.exe”, size is 60 MB.
vehicleclient.exe fails to install via “wine vehicleclient.exe”, complaing that you need at least 600MB of space on your disk, while there is much more than this on both the home and root partition.

  1. Therefore, install at Windows (probably in a VirtualBox virtual machine). Do not start the program after the installation – it does not hurt, but does not help either.
  2. Then, copy all the files it installed into some c:\Program Files\ subdir to a directory on your Linux machine, say, /opt/MobileVehicleClient/.
  3. Go into that directory and first start the program (necessary only once) with:
    HOMEDRIVE=/home/<username> java -jar dealertool-updater.jar
  4. After 1-2 minutes, the program will hang and use all CPU load. Close it, it does not hurt anymore now.
  5. Then, here is how to start the program regularly. Go into your installation directory and call:
    HOMEDRIVE=/home/<username> java -jar dealertool.jar
    This will (on KDE 4.3) even create a task bar icon.

The version of Java used was 1.6:

  • Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
  • Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

Posted in Programme, Sprache: Englisch, alle Artikel | No Comments »