Sunday, September 6, 2009

3D to 2D Rendering, OpenGL and MATLAB

Short notes on OpenGL rendering and attempted integration with MATLAB.

Vertex Buffer Objects (VBO)

  • Allows you to give vertex, vertexnoms, face array locations directly for openGL to render (as opposed to drawing triangles one by one)
Frame Buffer Objects (FBO)
  • Allows you to draw to a buffer/texture (without directly to the screen)
Ref: http://hacksoflife.blogspot.com/2006/10/vbos-pbos-and-fbos.html

MEX and OpenGL
  • Use mex -v -lGL -lglut -lGLU cfile.c
  • Problems with glutinit() when calling mex file (MATLAB crashes when mex file is caleld again - cant do repeated rendering/calculations)
  • Probably not possible?
  • http://www.mathworks.com/matlabcentral/newsreader/view_thread/166039
  • http://mathforum.org/kb/message.jspa?messageID=6145127&tstart=15

Thursday, August 27, 2009

Multi hop ssh tunnelling

localhost ----linkA----> gatewayhost ----linkB-----> remotehost

localport <========ssh============>remoteport

Requirement
:
  1. Need to access remote service in remotehost (on remoteport) from localport in localhost (this quite be a database service to anhttp proxy service -- not much difference here)
  2. Both links A and B allow only SSH traffic (other ports are blocked)

Solution 1:

A simple

$ ssh -L localport:remotehost:remortport -N -f remoteuser@remotehost

would create an ssh tunnel on link A but not on link B . As both links allow only ssh traffic this will not work.

One solution is to use the ssh proxycommand option like this:

$ ssh -oproxycommand="ssh -qaxT gwuser@gatewayhost nc %h %p" -L 3128:localhost:9998 -p9999 remoteuser@remotehost -N -f


Monday, August 17, 2009

Publickey (no password) ssh/scp in Ubuntu (9.04 and maybe other)

As per launchpad

https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/201786

There is a bug that prevents public key ssh/scp from working when configured according to 'man ssh'. (Due to the way ssh-agent / seahorse is setup )

The trick is to run 'ssh-add' after the normal procedure as per 'man ssh'.

So the entire procedure would be something like this.
  1. Generate keys on the local machine ($ ssh-keygen -t rsa -b 4096 #press enter twice, I'm using 4096 instead of the usual 2048 bit key)
  2. Copy the public key using ssh-copy ($ ssh-copy-id -i ~/.ssh/id_rsa.pub remoteuser@remotehost #assuming keys are in the standard location)
  3. Now make sure we run ssh-add ($ ssh-add )
That should do the trick!

Friday, July 17, 2009

Skype on Ubuntu 9.04 with mic and headset problems

This was tested on Ubuntu 9.04 running on a Dell OptiPlex 960.

A simple handset was used with the mic and earphone jacks connected to the sockets in the front (above the USB slots).


A picture speaks a thousand words.. so its all in the screenshots.

Step 1: Change volumes settings as follows.






Step 2: Change skype options as follows




This might also help:
http://funwithlinux.wordpress.com/2009/04/20/fixing-skype-audio-problem-on-ubuntu-904/#comment-50

Tuesday, March 31, 2009

Friday, March 6, 2009

Web services for ISO8583 Messaging using MultiXTpm ISO 8583 Server

MultiXTpm ISO 8583 Server exposes a web service to receive ISO8583 messages.

ISO 8583
Messages are used for financial transaction messaging including Credit Card / POS transaction messages.

MultiXTpm ISO 8583 Server comes bundled with the MultiXTpm Application Server developed by Moshe Shitrit, who is also extremely helpful by the way :).

This document explains how to deploy MultiXTpm ISO 8583 Server (and in effect MultiXTpmApplicationServer-4.0.8a) on a Ubuntu 8.04. It is intended to be quick guide for newbies as well as a reference for me as I may not remember these steps next week !


1) First Install MultiXTpmApplicationServer

The basic installation was done by following Igor Custodio's excellent posting on A How-to compile MultiXTpm in Ubuntu 8.04.

However, the following modifications had to be done in addition to the instructions given in A How-to compile MultiXTpm in Ubuntu 8.04.


The LD_LIBRARY_PATH and PATH variables needed to include the current directory (.) to run the mentioned .sh scripts. Therefore the export statements in Step 6, were modified as follows.

export MultiXTpm="/home/srimal/MXTPM/MultiXTpmApplicationServer"
export PATH=.:$PATH:"${MultiXTpm}"/runtime
export TMAKEPATH="/usr/share/tmake/linux-g++/"
export LD_LIBRARY_PATH=.:"${LD_LIBRARY_PATH}":"${MultiXTpm}"/runtime
export CPATH="/home/srimalj/MXTPM/gsoap-2.7/gsoap:/home/srimalj/MXTPM/gsoap-2.7/gsoap/extras"
export CPLUS_INCLUDE_PATH=/usr/include/mysql++/:/usr/include/mysql/

These exports were added to the end of my /etc/bash.bashrc for convenience.
(I have installed in my home directory /home/srimal -- change as appropriate)

Also install the following packages if you already don't have them.

$ sudo apt-get install libmysql++-dev

Plus any other libraries that you do not have already but are mentioned in the above export statements. (Hint: Missing header files are usually in xxx-dev package for package xxx)

2) Next Install
MultiXTpm ISO 8583 Server

To do this, change in to the ISO8583Server directory .

$ cd ${MultiXTpm}/ISO8583Server

The next few steps require the environment variables exported before. (Its a good idea to add it to /etc/bash.bashrc and start with a new terminal -- or do a . /etc/bash.bashrc if you prefer to use the same terminal window)

Next we Build everything.

$ ./LinuxBuildAll.sh

Then Make the runtime environment.

$./MakeRuntime.sh
(Don't worry if it says the runtime exists)

Now change to the runtime directory

$ cd runtime

and run MultiXTpm

$ MultiXTpm


This should start up the MultiXTpm process which will in turn spawn the four processes needed for ISO 8583 Server:
  • MultiXTpm – Application Server, Router, load balancer.
  • ISO 8583 Issuer Gateway FE – Listener and communications handler, receivng requests from Remote Acquirer Gateways or POS terminal.
  • ISO 8583 Issuer Gateway WS FE – Listener and communications handler, receivng requests from Remote Acquirer Gateways or POS terminal that use SOAP/XML Web Services client software.
  • ISO 8583 Back End and/or ISO 8583 Authorizer – The Business Logic handler. Acts locally on POS terminals requests or forwards requests to the next Issuer Gateway in the chain.
  • ISO 8583 Acquirer Gateway FE – Connection initiator and communications handler. Handles all data transfers to remote Issuer Gateways.

This is what my console looks like.

.
Based on the default TpmConfig.xml the Web Service will be accepting connections on port 38583. So my connection end point looks like "http://localhost:38583/" .



Thursday, February 19, 2009

GUI Database Designer for MySQL

MySQL Workbench

http://dev.mysql.com/downloads/gui-tools/5.0.html

has Linux support

and generates lovely ERD's off MySQL schemas :)