Thursday 24 February 2011

Adding a "Copy Notes:// Link" button to Lotus Notes

To add a button to the Notes  toolbar which copies a notes:// style link to the current document to the clipboard

  • Go to File -> Preferences -> Toolbar -> Customise
  • Click New -> Button...
  • Set fields as follows:
Caption text - "Notes: Link"
Popup help "Copy  'notes:' link to clipboard"
Formula:

serverNameAbb := @Name([Abbreviate];@Subset(@DbName;1));
serverNameCommon := @Name([CN];@Subset(@DbName;1));
serverDNSName := @DbLookup(""; "":"names.nsf"; "Connections"; serverNameAbb; "OptionalNetworkAddress"; [FailSilent]);

REM {For server names that contain spaces, always use the DNS name instead, because notes:// links do not work when the server name contains spaces.};
serverNameCommon := @If( @Contains(serverNameCommon;" "); serverDNSName; serverNameCommon );

REM {Database, View and Document url links.};

serverNameCommonEncoded := @URLEncode("Domino";@LowerCase(serverNameCommon));
urlDatabase := @LowerCase( "notes://" + @URLEncode("Domino";serverNameCommon) + "/" + @WebDbName );
urlView := @LowerCase( urlDatabase + "/" + @URLEncode("Domino";@Subset(@ViewTitle;-1)) );
urlDocument := @LowerCase( urlDatabase + "/0/" + @Text(@DocumentUniqueID) );

urlDatabaseDNS := @ReplaceSubstring(urlDatabase; serverNameCommonEncoded; serverDNSName);
urlViewDNS := @ReplaceSubstring(urlView; serverNameCommonEncoded; serverDNSName);
urlDocumentDNS := @ReplaceSubstring(urlDocument; serverNameCommonEncoded;serverDNSName);

REM {Additional text to appear in the dialog box.};
databaseTitle := @Subset(@DbTitle;1);
documentTitle := @If( Title != ""; Title; Subject != ""; Subject; databaseTitle);
REM {Dialog Box messages};
dialogTitle := "Lotus Notes URL";
dialogMessage := "Press Ctrl-C to copy this URL.";
REM {Choices to appear in Dialog Box};
dialogChoices :=
@Unique(@Trim(
@If( Form=""; ""; ("(doc) " + documentTitle + " - " + urlDocument) ) :
("(db) " + databaseTitle + " - " + urlDatabase) :
("(view) " + databaseTitle + " - " + urlView)
));

REM {Display the Dialog Box};

@Prompt([OkCancelEditCombo]; dialogTitle; dialogMessage; @Subset(dialogChoices;1); dialogChoices)
  • Change the icon to something appropriate, I usethis one:
  • Finally, add the button to a toolbar which is widely used (e.g. Universal).
Thanks to Alex Lepofsky for this.

    Monday 21 February 2011

    Setting up Tesco Mobile on Android for Omnia 2

     Haven't quite got this working yet for the beta build of Android on my Omnia 2 (Feb 2011), but these look like they should be the correct settings based on other web comments
    •  Tap New APN
    • Tap Name then tap the text box and enter tesco then tap OK
    • Tap APN then tap the text box and enter prepay.tesco-mobile.com then tap OK
    • Tap Proxy then tap the text box and enter 193.113.200.195 then tap OK
    • Tap Port then tap the text box and enter 8080 then tap OK
    • Tap Username then tap the text box and enter tescowap then tap OK
    • Tap Password then tap the text box and enter password then tap OK
    • Skip past Server as this is preset as Not set
    • Tap MMSC then tap the text box and enter http://mmsc.mms.o2.co.uk:8002 then tap OK
    • Tap MMS proxy then tap the text box and enter 193.113.200.195 then tap OK
    • Tap MMS port then tap the text box and enter 8080 then tap OK
    • Tap MCC then tap the text box and enter 234 then tap OK
    • Tap MNC then tap the text box and enter 10 then tap OK
    • Authentication type: PAP / None
    • APN Type: default,supl,mms 
    • Press the Menu key
    • Tap Save
    • Tap your new account so a green dot appears next to it

    To set up SMS 
    Type *#*#4636#*#* into phone

    Choose phone information  and enter +447802092035 in the SMSC box (close to the end of the list).

    http://android.modaco.com/content/zte-blade-blade-modaco-com/319547/tesco-prepay-mobile-mms-problems/

    Wednesday 5 January 2011

    Essential Firefox Plugins

    Have experimented with Chrome and like it - particularly the amount of screen real-estate it renders - but am running into a number of sites without Chrome support, so it's back to Firefox, plus plugins to give a Chrome-like experience.

    The essential Firefox plugins for me are: 

    Adblock Plus - obviously :-)

    Tab Utils Lite - Adds tab duplication

    Easy DragToGo  - opens tabs by dragging links

    Pimpoflage - Hides top bars and status bars (also the menu bar can be hidden from standard Firefox toolbar customisation and displayed with the Alt key)  Mini-UI is a simple alternative which hides / reveals using rhe Ctrl key.

    LastPass - Password manager that syncs passwords across browsers


    Other invaluable add-ons: 

    Gmail manager - Shows number of messages for multiple gmail accounts (check here for latest fixes)

    Forecastfox weather -  Brilliant weather icons in the status bar


    Delicious Bookmarks - Social bookmarking at its best

    QuickProxy - Easily turn on/off proxy settings

    Kaboodle - Sharing shopping lists


    IBM add-ons:
    Foxear - IBM internal delicious equivalent
    IBM CCK - Internal search engines and password management

    Tuesday 14 December 2010

    Install an MQ API exit on Windows

    ...from the command line with the following commands:

    endmqm -i {YOURQMGR}
    amqmdain reg {YOURQMGR} -c add -s ApiExitLocal\apptrace -v Name=apptrace
    amqmdain reg {YOURQMGR} -c add -s ApiExitLocal\apptrace -v Function=EntryPoint
    amqmdain reg {YOURQMGR} -c add -s ApiExitLocal\apptrace -v Module="C:\Program Files\IBM\Websphere mq\exits\mh05_exit.dll"
    amqmdain reg {YOURQMGR} -c add -s ApiExitLocal\apptrace -v Sequence=1
    amqmdain reg {YOURQMGR} -c add -s ApiExitLocal\apptrace -v Data="C:\mqm\exits\acttrace.ini"
    strmqm {YOURQMGR}

    WebSphere MQ suspend dialog

    Command to get rid of the "MQ has received a suspend request" dialogue box  on Windows (without using WMQ explorer):

      amqmdain reg *  -c add -s ACPI -v DoDialog=No

    ...and to check the value:  

      amqmdain reg *  -c display -s ACPI -v *


    See: http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa15570_.htm

    Friday 2 October 2009

    Install WebSphere MQ on Ubuntu

    Strictly speaking, WMQ v7 is only supported on RedHat and SUSE linux, but it runs nicely on Ubuntu once you've got it installed.

    WMQ packages are formatted as rpm packages, instead of the more common .deb package format on Debian based releases, and this causes some problems with MQ's installation scripts. It is possible to convert .rpm packages to .deb packages using the 'alien' tool, but it's actually quicker and easier to just install rpm package utility on Ubuntu with the command: sudo apt-get install rpm

    If you've already got rpm installed then you can check which packages you've installed with the command
    rpm -qa and delete unwanted packages with rpm -e (for instance this is necessary if you've been running a beta version of MQ)

    Download the electronic WMQ image (for WMQ v7.0.1 this is CZ4VRML.tar.gz) then follow the instructions in the Linux Quick Beginnings, starting with setting up the user Id and kernel parameters, then accepting the license with
    sudo ./mqlicense.sh -text_only

    The first problem we hit in using rpm, is that MQ's install scripts have a dependency on the /bin/sh rpm package which is not installed on Ubuntu, so we need to use the rpm --nodeps to disable dependency checking. The commands to install the product are:

    Core system
    $ sudo rpm --nodeps -ivh MQSeriesClient-7.0.1-0.i386.rpm MQSeriesRuntime-7.0.1-0.i386.rpm MQSeriesSamples-7.0.1-0.i386.rpm MQSeriesSDK-7.0.1-0.i386.rpm MQSeriesServer-7.0.1-0.i386.rpm

    SSL, Java, and Eclipse
    $ sudo rpm --nodeps -ivh MQSeriesJava-7.0.1-0.i386.rpm MQSeriesConfig-7.0.1-0.i386.rpm MQSeriesEclipseSDK33-7.0.1-0.i386.rpm MQSeriesKeyMan-7.0.1-0.i386.rpm MQSeriesMan-7.0.1-0.i386.rpm MQSeriesJRE-7.0.1-0.i386.rpm

    So far so good, it should be possible to create queue managers and run MQ Explorer, but you may see weird error messages when using MQ admin commands, for instance:
    $ dspmq
    AMQ7047: WebSphere MQ was unable to open a message catalog to display an error
    message for message id hexadecimal 20007047, with inserts 0, 0, , , and .
    The following command, issued on a system that does not have message catalog
    difficulties, may provide more information about that message: mqrc AMQ7047
    AMQ7047

    This is because the MQ Message catalogue (
    amq.cat) has not installed properly. On my machine I have 3 links to amq.cat in
    $ locate amq.cat
    /usr/share/locale/en/LC_MESSAGES/amq.cat
    /usr/share/locale/en_GB/LC_MESSAGES/amq.cat
    /usr/share/locale/en_US/LC_MESSAGES/amq.cat

    ...but
    the ultimate target of these links: /usr/share/locale/C/LC_MESSAGES/amq.cat is missing. A quick poke around the MQ runtime package (with sudo rpm -ql -p MQSeriesRuntime-7.0.1-0.i386.rpm |grep amq) shows that the catalogue is there and should have been installed in /usr/share/locale/C/LC_MESSAGES/amq.cat

    To get MQ fully working, we need to extract this file from the package and copy it to the correct place. There is a utility which can extract files from rpm packages (rpmcpio) but file-roller - the pre-packaged graphical archive tool - can also read rpm's, so the easiest thing to do is to run the file-roller GUI, extract the file, and then copy it to the correct location like so:

    $ file-roller
    MQSeriesRuntime-7.0.1-0.i386.rpm
    [extract amq.cat]
    $ sudo cp
    amq.cat /usr/share/locale/C/LC_MESSAGES/amq.cat
    $ sudo chown mqm:mqm /usr/share/locale/C/LC_MESSAGES/amq.cat

    This fixes the admin commands and allows MQ to display messages like so:

    $ dspmq
    QMNAME(mp1) STATUS(Running)
    QMNAME(qm1) STATUS(Ended immediately)

    That should be it - you can now enjoy MQ on your chosen Linux Distro.

    Wednesday 12 August 2009

    Sending Google talk messages using Python

    Google Talk uses the Jabber (XMPP) protocol, and I wanted to use it to send myself notifications from my home weather station and CurrentCost electricity meter.

    I found a python module xmpp which looked like it should do the trick, and got it working as follows...

    Installed the python xmpp egg by doing:
    • sudo python ./ez_setup.py
    • sudo easy_install xmpppy
    (NB: sudo apt-get install python-xmpp works just as well for Linux Debian releases)

    Tried the code in the article and comments here: http://www.larsen-b.com/Article/214.html but kept getting authentication errors.

    Failed SASL authentification:

    This article led me to try turning off SASL with the following line:

    client.auth(user='myuser', password='password', sasl=0)

    Which dumped some more helpful errors, and eventually made me realise that (for my gmail address) the domain expected in the xmpp.Client is not 'gmail.com' but 'googlemail.com'

    I fixed up the paraemters passed to the xmpp.Client constructor, and the following code worked:

    import xmpp
    client = xmpp.Client('googlemail.com')
    client.connect(server=('talk.google.com',5222))
    client.auth(user='myuser', password='password')
    client.send( xmpp.Message('markrp@gmail.com', 'Hello World'))

    Now I have proper push notification to my IM client (Pidgin)