Nick's Tech Blog

Pages

Thursday, May 31, 2012

Tibco > MimeParts are incorrectly parsed by the HTTP Receiver

Problem

The TIBCO ActiveMatrix BusinessWorks Administration document explains it best (last seen here)
In previous releases, when the content-type of an incoming message was "multipart/*", the first part of the message was presented as the POSTDATA. This is incorrect according to MIME specification.
Solution 
The bw.plugin.http.handleAllMimePartsAsAttachment property fixes this problem.

If this property is set to true and the top-level content-type of the incoming HTTP message is "multipart/*", then an HTTP Receiver will present all the MIME parts as attachments and the POSTDATA field will be empty. If this property is set to false (the default value), backward compatibility is maintained and the first MIME part is presented as the POSTDATA.

N.B. Do not check the Parse Post Method Data field on the HTTP Receiver process starter when this property is set to true. This causes an error to be thrown.
Development
  1. Simply add the following line to your <designer_home>/<version%gt;/properties.cfg file (create it, if it doesn't already exist).
    1. bw.plugin.http.handleAllMimePartsAsAttachment=true
  2. Restart Designer
Runtime (N.B. I haven't tested this yet, feedback warmly welcomed!)
  1. At run time, append it to the deployed .tra file.
See also:
https://www.tibcocommunity.com/thread/13797?tstart=1425

Thursday, September 29, 2011

Ubuntu > Display notifications over the screensaver

I'm currently playing around with notifications, and I'm trying to "keep" notifications displayed above the screensaver, so that I can see if I've got new mail or an IM from afar, without having to unlock my pc.

Basically the opposite problem to these:
http://www.jwz.org/xscreensaver/faq.html#popup-windows
http://www.google.com/search?q=notifications+over+screensaver+ubuntu

I'm using a command similar to the following, to display messages with an infinite timeout:
Code:

$ notify-send -t 0 -i info "You've got mail" "mailbox (123)"

Currently notifications get displayed temporarily "above" the xscreensaver, but eventually xscreensaver will "raise" itself above the notification (e.g. after a minute or two).

Here are my options, as I see it currently:

1) Download the xscreensaver's source code, modify it to prevent it raising itself above the notifications, build and install it (painful... I've managed to build it from the source, but I don't know what I should be modifying.)

2) Write my own custom screensaver (not really path I want to take, when I already have a notification and screensaver framework).

Are there any other (easier) options I've missed? Can anyone help?

(There's an argument that nothing should be displayed over the top of screensavers... )

Some context:
Ubuntu 11.04
Unity
notification-daemon/natty uptodate 0.5.0-2ubuntu1 (better functionality than notify-osd - i.e. click to close, vertical stacking, customisation...)
xscreensaver/natty uptodate 5.12-0ubuntu3 (more customisable than gnome-screensaver).

See also:

The same question, posted on the ubuntu forums:
http://ubuntuforums.org/showthread.php?p=11292893#post11292893

Traceback to a thread, on customising notify-osd notifications:
http://www.webupd8.org/2011/05/configurable-notifyosd-bubbles-for.html#dsq-comment-199829486

Another alternative to notification-daemon and notify-osd is avant-window-navigator 
http://maketecheasier.com/2-ways-to-make-ubuntu-notification-more-user-friendly/2011/05/21

Unfortunately, this is the closest solution I've found to notifications whilst the screensaver is running (checkGmail lights up the scroll lock key on the keyboard).
http://ubuntuforums.org/showthread.php?t=1564412

Wednesday, September 28, 2011

Ubuntu > Compiling package/s from source

Just putting together a quick "cheatsheet" for compiling and installing a package from it's source code.

Start here: (it's all here and it's very simple...)
https://help.ubuntu.com/community/CompilingSoftware
https://help.ubuntu.com/community/CompilingEasyHowTo

Pre-requisites:
sudo apt-get install build-essential checkinstall

Optional - to assist in retrieving the source code:
sudo apt-get install cvs subversion git-core mercurial

By convention, put source code under here (extract the source if it's in a zip, tar.gz, etc):
/usr/local/src

From the root of the source code:
./configure

Resolve any missing dependencies:
sudo apt-get build-dep <package>
apt-file search <your-missing-file.h>


Build the code:
sudo make

Package the code into a *.deb:
sudo checkinstall

Install the code directly:
sudo make install

Clean up:
sudo make clean
sudo make distclean


Thats it, nothing ground breaking. Please let me know if there's anything else I've missed.

See also:
http://www.gnu.org/software/make/manual/make.html#Complex-Makefile

Monday, September 26, 2011

Fedora > libfontconfig.so.1: cannot open shared object file: No such file or directory

Problem

Received the following exceptions (seperately) when attempting to run a java program on Fedora 15 amd64.

/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
...
libstdc++.so.5: cannot open shared object file: No such file or directory
...
Exception in thread "main" java.lang.UnsatisfiedLinkError: /some/directory/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory
...
libfontconfig.so.1: cannot open shared object file: No such file or directory


and so on.

Solution

Obviously a couple of dependencies were missing. To find out which package/s you need to install to fix a missing dependency, use "yum provides <missing_file>".
e.g.
# yum provides libfontconfig.so.1
fedora/metalink |  21 kB     00:00    
jenkins |  951 B     00:00    
updates/metalink |  12 kB     00:00    
fontconfig-2.8.0-3.fc15.i686 : Font configuration and customization library
Repo        : fedora
Matched from:
Other       : libfontconfig.so.1

Then install the packages...
e.g.
# yum install fontconfig

Repeat for all missing files.

CFEngine > Scalar item in package_list_command => { ls } in rvalue is out of bounds (value should match pattern "?(/.*))


Problem

Whilst validating a cf-promises file, I received the following output.
$ cf-promises -f ./promises.cf
cf3> ./packages.cf:23,28: Scalar item in package_list_command => { ls } in rvalue is out of bounds (value should match pattern "?(/.*)), near token 'ls"'


The associated line is:
package_list_command => "ls -1 /your/directory"

Solution

Basically, the error is trying to tell us that the "ls" command must be fully qualified.

The associated line should read:
package_list_command => "/bin/ls -1 /your/directory"

Thursday, September 22, 2011

Fedora > java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

Problem 

The following exception was encountered when running a java program on Fedora:
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

Assumptions: you know what an xserver is.

Solution

Basically, the java program is trying to access the xserver, and can't.

If it should be accessing the xserver, make sure the xserver is started/running:
  • e.g. ps -ef | grep Xvfb
If it shouldn't be accessing an xserver, make sure the "DISPLAY" environment variable is unset:
  • unset DISPLAY

See also:
Fedora > install Xvfb as a service

Ubuntu > Filter directory /usr/lib/cups/filter for printer "<yourprinter>" is not owned by root.

Problem

You receive the following error status message for a printer, once it is installed (e.g. in the "Print" window).

Filter directory /usr/lib/cups/filter for printer "" is not owned by root. 

You may also see "cups-insecure-filter". 

Solution

Execute the following commands, to change ownership back to root. 

  1. sudo chown -hR root:root /usr/lib/cups/filter/* 
  2. sudo chown -hR root:root /usr/lib/cups/backend/* 
  3. service cups restart 

Your printer should now no longer display the message. (May require closing and reopening the "Print" window). 

See also:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/436544