Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Friday, 29 March 2019

My Seemless Linux Desktop using VirtualBox, Vagrant, MobaXterm and TotalCommander

Years ago I played around with VMWare Unity Mode in VMWare player or VirtualBox's Seemless mode. In those modes you start an application on your virtual machine, but the windows appear as running on your host system. Back in the days I ran OpenSuse on my laptop, and had Windows XP or 7 on a Virtual Machine for those cases I had to run PowerPoint.

I wasn't too enthousiastic about those modes. Of the two I found that VMWare implemented it the most transparent. But it was quite hard to work with multiple screens, and to start the applications using the embedded menu. Now, I didn't use this in a long time, so it might have been improved. But, lately I work with my VM's (mostly Oracle Linux)  using Vagrant most of the time. And I use MobaXterm to connect with them and shortly, I use it to start my Oracle tools from MobaXterm.

With the XWindows Server in MobaXterm, working with either SQLDeveloper or JDeveloper is very convenient. And it will allow me to cleanup even my local installments of SQLDeveloper or JDeveloper.

So, I have been looking for automating some startup and working on the most convenient setup for me. And I found it (for now) in the combination of:
  • VirtualBox
  • Vagrant
  • MobaXTerm 
  • And my All time favorite cockpit: TotalCommander

Let's go through them.

VirtualBox

It must have been around 2003 that I got introduced into VMWare Workstation by my former colleague Robert. It was an eyeopener to see that you could run multiple PCs on your laptop, separating different versions of Oracle Products that could even 'talk' to eachother!
Since all is saved in a folder of files, I could do one install and share it with colleagues.

Since Oracle acquired VirtualBox, and because of several direction-changes at VMWare (introduction and revocation of VMWare Server, VMWare player that couldn't create VMs and then it could, and then it couldn't anymore,...), after a while it made sense to me to switch to VirtualBox completely. There was a period of time that I had both on my laptop.

So, for me it is only VirtualBox now and we have come to version 6.0.4 at time of writing. Downloadable from the VirtualBox Download Page. Choose the download for your platform. Installing follows the familiar NNF-Pattern (Next-Next-Finish). And don't forget to download and install the Platform independent Extension Pack. I guess this is piece of cake for you followers.

Vagrant

This is quite new for me, since a bit over a year now. I transferred my main installations in a Vagrant project and it's still work in progress.

I already wrote a bit about my Vagrant solutions. Last few years I worked on scripting my installations of Oracle Products. Vagrant allows me to automate the creation and provisioning of my VM's. Relieving me from the need to keep multiple VMs up to date. Sharing can be both simpler but also harder. Simpler, because I could share my vagrant project and scripts. But also harder, because the provision scripts should be placed in the proper order. I should implement it in a VCS repo. And also the install-binaries should be placed with the proper name in the proper place.

I now have a Software Stage Repository on my second laptop disk, and  separate Vagrant projects. But they all have copies of provision scripts for several products. So, database, java, SOA/BPM QuickStart, Weblogic is duplicated per particular Vagrant Project. I want to split it up in a common provision folder and a Choose&Select approach in my Vagrant Projects in a way that I have a simple Vagrant provisioning in where I can refer to the provisioning of particular products.

Anyway,  starting up and eventual provisioning of a box is simple: just issue the vagrant up command in the folder with the vagrant file is all you have to do. Suspending  a box is done using vagrant suspend.

My respected con-colleague Maarten Smeets wrote quite a bit about Vagrant and lately about a few good tips.

Vagrant has reached version 2.2.4 recently and can be downloaded here. It  also follows the famous NNF-pattern. But although it allows you to choose the install directory, it is very devoted to be installed in the c:\HashiCorp\Vagrant\. I quit trying to force it elsewhere.

MobaXterm

Many of my even respected coworkers stick with their all-time favorite Putty. Putty stays ubiquitous. It is simple, but I always have found it a bit archaic. I thought I once noticed that the support was  terminated. However, just now they just released the stunning version number of 0.71. I don't mean to be sarcastic, and Putty has it's own right of existence. But give MobaXterm a try. It's loaded with nice features, including an SCP client that can follow your SSH session. And as said, also an XWindows Server. So, connect with ssh to your Linux server and run jmc, visualVM, Oracle Universal Installer, Weblogic Configurator, JDeveloper, SQLDeveloper, etc. etc. and the UI will pop-up on your desktop. Also MobaXterm includes cygwin so you're able to run a terminal session on Windows. It even allows you to do ps -ef to show your running windows apps!

I also discovered that really easy way to implement a tunnel with MobaXterm!

You can download it here, in a portable and an installer version. I choose the portable. The free edition includes games (why?) and  a limit number of sessions, macros and tunnels. But the professional edition only costs a few bucks/euros.

TotalCommander

Ever since the introduction of Windows '95, I disliked the Windows Explorer. Luckily I soon discovered Windows Commander, under pressure of Microsoft, renamed to Total Commander. And it's even  a better name, because it's about the second tool I install on a new Windows Desktop. Just after Firefox, to be able to close IE/Edge...

It's my cockpit, allows me to navigate to hot folders quickly, introspect files, navigate through archives, edit them or unpack them, multi-rename files, compare files, etc., etc. I just don't make coffee with it. One of the nice features is the button bar, where you can launch applications. And this is the thing I use for this blog.

Tie it all together

I realize that I overloaded you with sales talk about my favorite tools.

After installing all the tools and having your Vagrant project in place all can be tied together.

I have a project that provisions a VM with an Oracle Database, SQLDeveloper, SOASuite, and BPM QuickStart.

My TotalCommander Toolbar looks like:

You can right-click anywhere in the toolbar to edit it, create new buttons. A 'button' that is left empty (no command) is presented as a separation bar.

Startup & suspend the VM


Let's take a look at the Vagrant SOA Start button:

It's simple: the command is vagrant up and important here is that it should be executed in the folder where the vagrant file resides. I provide a tool tip, and I created an icon file from the Vagrant Logo using my favorite image app IrfanView.

Clicking the button will fire up the VM and potentially provision it. I copied the button to create a button to suspend the VM. The command there is vagrant suspend. But for the rest it is exactly the same.

MobaXterm local terminal

When you start MobaXterm you'll get to:
When you click on the 'Start local terminal' button, you get a shell window running in the user home folder that is presented by the tool:

You can ssh to a remote server from this terminal. Of course you can create a session to a remote server. Doing so for the first time, logging on to the particular user, allows you to save the password for that user. I've already done that, and then I can do a ssh oracle without the need to provide a password.

Start Database


On my remote server that is started already (using the TotalCommander Button), I have a script that starts the database.

When the VM is started with vagrant, by default it fires up an ssh deamon on port 2222. The command to start my database on the remote server is:
ssh oracle@localhost -p 2222  /home/oracle/bin/startDB.sh

And as you can see in the screendump: I put that in a script in the home folder.

MobaXterm provides several commandline options, that allows you to run  a script command at startup of MobaXterm. That is what I used to create a StartDatabase Button:
The command is just MobaXterm (I should put MobaXterm in a version-less folder name, with a version-less executable, or create a script for that).
As parameters I provided -newtab ./startDB.sh. This is to ensure that the script is started on a new tab in MobaXterm, in a new potential session. Little side affect is that it creates a tab on the MobaXterm every button click. So, I might end up closing a few tabs...

Start SQLDeveloper and JDeveloper (BPM QuickStart)

To start SQLDeveloper I have a sqldev.sh script with the following content:
nohup ssh oracle@localhost -p 2222  /home/oracle/bin/sqldev.sh  > sqldev.out 2>&1 &

And the button looks like:

Similarly, I have a button to start JDeveloper. And it all ends up in the following desktop:

It might need some tweeking. But for now I love it and it works like a charm.



Friday, 9 February 2018

How to install the Notepad++ 64-bit plugin manager

I'm a Notepad++ fan for years. And as soon as a 64-bit version arose I adopted it.
But since a few months I have a new laptop, and I apparently didn't get the plugin manager with the latest new install.  And only now I took the opportunity to sort it out and write about it.

I found that the plugin manager is available since April 2017 on GitHub, version 1.49. I downloaded the zip from the mentioned location, I choose the _x64 version:
Then unzipped it into my Notepad++ folder:

Then started Notepad++ and the plugin manager appears:

So now I can format my XML files again...

Update 2018-07-03: latest release can be found directly here.

Tuesday, 13 December 2011

SoapUI Tip 3

It was a little searching using the javadocs of SoapUI, but if you want to log the result of the script of a mockService or mockResponse step in a testCase, then that can be done using:
log.info("Response: "+mockResponse.getMockResult().getResponseContent())
Another nice tip I found at another blog: "SoapUI limitations and workarounds : mock response test step"
If you want to use mockServices in your testcase or testsuite, but don't want to implement mockResponse steps for them, you can create (of course) mockServices for them. They can handle multple responses and use xpath expressions to choose the right response for a particular request. But running the testcase you'll need to start the mockServices that you need in the test. this can be done by in the "Setup Script" of the testCase:
def project = testCase.getTestSuite().getProject();
def mockService = project.getMockServiceByName("Name of the MockService");
mockService.start();
After running the testcase/testsuite the mockservices should be stopped neatly. This can be done in the "TearDown Script":
def project = testCase.getTestSuite().getProject();
def mockService = project.getMockServiceByName("Name of the MockService");
def mockRunner = mockService.getMockRunner();
mockRunner.stop();

Monday, 12 December 2011

SoapUI: Properties from test Suite

In my previous post I showed how to get a file from a script in SoapUI. One of the parts on building the filepath of the file to load was a property from the mockService. The same thing is possible from a test suite. There are several places at which you can define properties. Amongst them is the TestSuite.

To get the properties from a test suite, you have to "get" it. To get the test suite on which you defined the properties goes as follows:

def project = mockResponse.mockOperation.mockService.project
def testSuite = project.testSuites["TestSupport"]

The property can then be fetched with:

def filePath = testSuite.getPropertyValue( "responseFilePath")


Test cases are part of the testSuite and they can be fetched from an string-based array in the same manner as getting the testSuite:

def testCase = project.testSuites["TestSuite 1"].testCases["TestCase 1"]

Expanding SoapUI possibilities...

Thursday, 8 December 2011

Load Response Message File System in SoapUI

Today I figured out how to get a response from filesystem in SoapUI. I found that I could not dynamically select from multiple responses in a mockResponse-TestStep in a TestSuite. But loading from a file within a Groovy script should do the job. Advantage is also that you can have as many response files as you like. You just put a value in the filename, that you select using xpath from the request message. The folder in which you store the message can be put in a property on the mockService. I don't have the time to explain the whole lot. But the response in the mockService should be like:
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:header>
      <darwinheader xmlns="http://www.darwin-it.nl/XMLHeader/10">
         <headerversion>${headerVersion}</headerversion>
         <messageid>${messageId}</messageid>
         <servicerequestordomain>${serviceRequestorDomain}</servicerequestordomain>
         <servicerequestorid>${serviceRequestorId}</servicerequestorid>
         <serviceproviderdomain>${serviceProviderDomain}</serviceproviderdomain>
         <serviceid>${serviceId}</serviceid>
         <serviceversion≶${serviceVersion}</serviceversion>
         <faultindication>${faultIndication}</faultindication>
         <messagetimestamp>${messageTimestamp}</messagetimestamp>
      </darwinheader>
   </soapenv:header>
   <soapenv:body>${responseBody}</soapenv:body>
</soapenv:envelope>
Here you see that the Soapenvelope with the header is given, but the diffent values are properties, as well as the responseBody. The script to get these from the request is as follows:
def method = "ChangeServiceRequest.Response 1.Script"
log.info("Start "+method)

log.info(mockRequest.requestContent)

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
// Set Namespaces
def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)
holder.namespaces["soapenv"] = "http://schemas.xmlsoap.org/soap/envelope/"
holder.namespaces["ns"] = "http://www.darwin-it.nl/XMLHeader/10"
holder.namespaces["rpy"] = "http://www.darwin-it.nl/ChangeServiceRequest/2/Rpy"


log.info("Get Header Properties")
context.messageId=Math.random()
log.info("messageId: "+context.messageId)
context.headerVersion= holder.getNodeValue("//ns:DarwinHeader/ns:HeaderVersion")
log.info("headerVersion: "+context.headerVersion)
context.serviceRequestorDomain= holder.getNodeValue("//ns:DarwinHeader/ns:ServiceRequestorDomain")
log.info("ServiceRequestorDomain: "+context.serviceRequestorDomain)
context.serviceRequestorId= holder.getNodeValue("//ns:DarwinHeader/ns:ServiceRequestorId")
log.info("serviceRequestorId: "+context.serviceRequestorId)
context.serviceProviderDomain= holder.getNodeValue("//ns:DarwinHeader/ns:ServiceProviderDomain")
log.info("serviceProviderDomain: "+context.serviceProviderDomain)
context.serviceId= holder.getNodeValue("//ns:DarwinHeader/ns:ServiceId")
log.info("serviceId: "+context.serviceId)
context.serviceVersion= holder.getNodeValue("//ns:DarwinHeader/ns:ServiceVersion")
log.info("serviceVersion: "+context.serviceVersion)
context.faultIndication= holder.getNodeValue("//ns:DarwinHeader/ns:FaultIndication")
log.info("faultIndication: "+context.faultIndication)
context.messageTimestamp= holder.getNodeValue("//ns:DarwinHeader/ns:MessageTimestamp")
log.info("messageTimestamp: "+context.messageTimestamp)

def serviceRequestNr= holder.getNodeValue("//req:ChangeServiceRequest_Req/req:ServiceRequestData/req:ServiceRequestNumber")
log.info("ServiceRequestNr: "+serviceRequestNr)

def mockRunner = context.getMockRunner()
def mockService = mockRunner.mockService
def filePath = mockService.getPropertyValue( "responseFilePath")+"/FT01_ChangeServiceRequest_"+serviceRequestNr+".xml"
log.info("FileName: "+ filePath)
def File file = new File( filePath )
def fileLength = (int) file.length();
def buffer = new char[fileLength];
def inputReader = new FileReader(file);
def numChar = inputReader.read(buffer);
requestContext.responseBody = new String(buffer);
log.info("End "+method)
With "def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)" you get an XML object of the request. The lines "holder.namespaces["ns"] = "http://www.darwin-it.nl/XMLHeader/10" set the namespace-abbreviations, needed to select the values from the request.
Then with "def serviceRequestNr= holder.getNodeValue("//req:ChangeServiceRequest_Req/req:ServiceRequestData/req:ServiceRequestNumber")", you can perform an xpath query, to get the serviceRequestNr from the request message in this case.

The lines
def mockRunner = context.getMockRunner()
def mockService = mockRunner.mockService
def filePath = mockService.getPropertyValue( "responseFilePath")

show how to read a property from the mockService.

Then the last lines are to determine the actual file path using this property and the  queried serviceRequestNr, and  to read the file.

By putting the file in the requestContext using: "requestContext.responseBody = new String(buffer);" it can be put in the response using the property "${responseBody}" like in the response-skeleton above. You might notice that it is a mixture of Java and Groovy. I'm not so familiar with Groovy yet. But I found that if it works in Java it is easy to get it work in Groovy. Actually, Groovy is just more loosely typed. I hope this clears enough to get this going. Good luck.

Wednesday, 19 October 2011

Drag and drop in Gmail

Well, I'm probably one of the last gmail users that see's it but I just a moment ago encountered that Gmail supports drag and drop.  One of the things I really missed. When I wanted to move mails to a label I had to do it using the 'move-to' poplist. But apparently sometime in the past months google implemented the possibility to grab one of more mails/conversations and drag them to a label. Great. By this the frontend mimics a rich-mail-client as Thunderbird., so that handling mail using Gmail is much more convenient. I love empty mailboxes...

Thursday, 10 March 2011

Total Commander for Linux=>Krusader

Oh, how I love Total Commander. I never found a file-manager that is so powerful. And how I missed that under Linux. I work a few years with Linux now, but on my Linux I still have TotalCommander. It can browse through archives, it can FTP and it has tabs to quickly switch locations. And I find copying/moving using to panes much more convenient than the Windows Explorer way. I kind of hate Windows Explorer. KDE-Dolfin is better, but to me still too much Windows Explorer.

Today I looked at the Total Commander website, to see that there is a new version of it. I must admit that I have a new laptop with Windows 7/64bit. And one of the minor things that I miss in TC is that it's still 32 bit. It's not big of a problem, but in the context menu all the 64 bit tools (like svn) are under a sub-menu. That's a little inconvenient.

In the FAQ I saw that a Linux version of TC is postponed indefinitely. But that there is one recommended tool: Krusader. That I missed that until now! I installed it right away and at first glance indeed it is the first tool that I find comparable to TC. Tools like midnight commander and under Windows FreeCommander or other lookalikes aren't for me.

TC works under Wine, but not too optimal. Krusader however is native Linux. So I'm going to check that out. Just another reason to tempt me install OpenSuse over my Windows 7 system...

Thursday, 3 March 2011

Lightning on Thunderbird 3.x X86_64

I used to use the Mozilla Calander plugin for Thunderbird: Lightning. Haven't used it for long, but today I found that it would be nice to have it back again. I found that it was on my thunderbird plugins but it was not compatible anymore with my version of Thunderbird.

Since Lightning is architecture specific you need the 64 bit version of it. That is: if you use the 64-bit Linux Thunderbird. It is available but for some unknown reason Mozilla did not publish it. Via the Ubuntu site (thanks to the Ubuntu Community) I found the location of the 1.0b2 beta version (for Thunderbird 3.1.x) here. The 1.0b1 version (for Thunderbird 3.0.x) here. Since it is version specific, with new versions you can try it with changing the version id in the url.

Download it, together with the accompanying Google Calendar provider, and install it in Thunderbird.

Wednesday, 8 April 2009

Darwin XML Tester Utilities on Sourceforge

A few weeks ago I requested a project on Sourceforge to host our XMLTester toolset. It was granted by the Sourceforge admin team, so I am now able to transform my toolset project to a real opensource project. You can find the project at darwinxmltester.sourceforge.net.
For the download I used my own deployed directories and zipped them. In the near future, when I get familiar with the sourceforge capabilities, I hope to create a more nice deployment with a nice description on the use. Also I'll include a seperate export of the sources. But for that I have to create a tag on which I also base the deployment. So that I ensure that the sources are in line with the deployement.
The toolset exist of:
  • Hierarchical XMLEditor, that is also available in a standalone app.
  • Plain XML Edit Panel
  • XPath edit/test Panel
  • XSLT edit/test Panel
The plans I have for the toolset are the following.

XMLEditor
  • Enhance the exception handling and perhaps logging
  • Add copy and paste capability to copy a child-node to another parent
  • Enhance the copy-node capability to include attributes and child nodes (now it just creates another node with the same name within the same parent).
  • Add insert new node within the child-table. Now you have to first click another sibbling node within the same parent, click copy-node and then click on the parent to edit the attributes.
  • Give the buttons nice icons instead of the text (text to tooltips).
XML-Panel
Basically this is a simple panel with a TextArea in a Scrollpane. The only smart thing it does that is that the scrollpane resizes with the main-frame.
The textarea should be replaced by a text-editor. Preferably one that supports keyword highlighting and that is expandable so that you can do neat tricks like keyword-completion etc. There are opensource plugable editors that do this. So I have to find out which one to use.

XPath Panel
Lately I found out how to use Namespaces in xpath queries in Java. I wrote about it in this blog. So the main thing I want to do here is that it finds the namespace declarations in the xml and put them in a pop-list as well as in a namespace-resolver. And of course a button that adds the choosen namespace to the xpath query. Also it should be aware of the existing nodes that are valid on the particular level. So that it adds them automatically.

XSLT Panel
Besides extending the Error handling like mentioned in the XML Editor to-do list I want to replace the TextAreas with TextEditors here as well.

Bulk XSLT
I already created a simple solution to do XSLT in batch. You can create a simle xml file that contains several rows of xml, xslt and output combinations that it will perform in sequence. I want to create a nice screen that enables you to edit and execute this batch-file.
Also I think of creating a database connection, because in some of my projects I used this to create objects based on xml-queries in the Oracle database. So if I have a table in which I have these XML files, I would be able to create this bulk file from that.

JDeveloper Plugin
Lately I downloaded a tutorial that shows how to create a JDeveloper plugin. Now I know that JDeveloper is perfectly capable of editing XMLFiles. It has much more functionality then I'll plan to include. The nice think of this toolset is that it is simple and small. It should not exceed much more than a few hundreds of kilobytes.
But the hierarchical XML Editor would be nice to have as a plugin. Also the bulk XSLT could be a nice JDev plugin.

Finally
I feel that I forgot something that I came up with lately. So ofcourse during time I'll find other nice functionality. If you have any ideas feel free to leave a comment. I keep you posted.
Of course there are much other tools that can do the same and often much more. JDeveloper I allready mentioned, is also free to use. Darwin-IT stands for knowledge sharing. Expanding the Oracle Consultant market with improved skilled people, through workshops, trainings, coaching on the job and for example this blog. I feel that this open source project is also a nice way of sharing knowledge. And an effective way to learn myself. And it gave me a productivity boost on some of my project.
I happily use the XMLEditor regularly to edit my xml file with Bookmark-links. I created a xslt that is referenced in this xml file and that transforms the XML to a html page with the bookmarks in poplists. The XML file is my Home-page in my browser. Maybe I'll package that also as an example project.

Tuesday, 13 January 2009

Better GMail and GCal

GMail and GCal on-line are great apps from Google. But the user experience can be even better with two smart add-ons: Better GMail 2 and Better GCal. You can download those for FireFox here:
They provide Greasmonkey java-scripts packaged into a separate Add-On.

The great thing on GCal is that you can create several calendars and share each one of them with a different set of peers. So I drum in a combo and I created a seperate calendar for that combo and invited the members to it. Each event in that calendar is available to all of them (provided that they create a Google-account).

But you can also add public calendars. I added for example:
  • Basis school vakanties midden nederland (2006 - 2009)
  • Joodse Feestdagen NL
  • NL vakanties en feestdagen
  • Week Numbers
If you add them to your on-line calender you can also go to the calendar settings. There you get the calendar-addresses also for the added public calendars. Here it becomes handy, because with the Google Calendar Plugin for Thunderbird/Lighting and Sunbird you can add these also to Lightning and Sunbird. Just create a new calendar in Lightning/Sunbird following the steps in my previous post and provide the link from the XML-button in the calendar settings. You'll be asked for a username/password, just provide your own gmail-account credentials.

Struck by Lightning

I know I'm a little stubborn. Actually I feel that it does not quite fit the Dutch word "eigenwijs", that means something like "know it better". And indeed on contrary to my colleagues I use OpenSuse Linux 64-bit, whereas they stick to 32-bit Windows. If they're happy with it, they should. But since my laptop has 4GB I want to use it all, so I wanted a 64-bit OS. And I want to drive myself in getting used to a unix-a-like OS, I use Linux. I learned all the windows versions from 3.1 to XP/Vista by doing. So the best way to learn an OS or an application for me is just by using it.

For reasons that lay in the line of the above, I use Thunderbird for years now (long before I stepped into Linux). And since recently I use Gmail.
Now I had a problem. I have a 64-bit Thunderbird, because of my 64-bit Linux. But the Lightning extension that you download at mozilla.com is a 32-bit and thus not fit for my Thunderbird. Therefor I used Sunbird with the Google Calendar Plugin.

Yesterday I stumbled upon the lightning plugin in Yast (the packagemanager of OpenSuse). So I installed it. And it worked. Apparently just recently they released a 64-bit Lightning. So I also installed the Google Calendar plug-in. But this reports that it misses modules. Also the Lightning plug-in reports that it is not updatable because of its source.

Googling I found the 64-bit Lighting plugin via this blog.
It states that you have to download the 0.9 release of the 64-bit Lighting at:
http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/0.9/contrib/linux-x86_64/
Download the file lightning-0.9-linux-x86_64.xpi and install it in Thunderbird.
You can find the Google plugin at: https://addons.mozilla.org/en-US/sunbird/addon/4631.
Download the add-ons and install them in Thunderbird. Then after restarting the plugins both work.

Adding a Google Calendar is really easy. In the calendar settings click on the XML button of the private addresses:


Then copy the link in the pop-up dialog.

In Lighting create a new calendar. Choose "on the network" in the first wizard page. Then choose "Google Calendar" on the second wizard page, and paste the link in the location. At the connect dialog provide the correct username/password to your gmail account. You can give in a color and a name in the last wizard page, before you click finish. When you right click on the calendar and choose properties, you can check the "cache" box. This requires a restart of Thunderbird but will cache the events. Mark that adding events to the calendar while not on-line will fail. For that you might want to have a local (on the computer) calendar. Being on-line you can toggle the events to the on-line calendar when updating them.

Adding calendars of work-mates or friends is just the same. By default the connect-dialog provides the username of your work-mate/friend. Provide your own credentials and you're done.

So thanks Sunbird, but now I have my Calendars right into Thunderbird you're done.

Thursday, 8 January 2009

As (probably) every other consultant I don't like the task of documenting my source. It's necessary, but boring. And what do you document and what not? And what if you add a parameter? It would be handy if you can generate your documentation, wouldn't it?
And it can: using the pl/sql doc plug-in of Pl/Sql Developer.

See http://www.allroundautomations.nl/plsplsqldoc.html.

Already a few years a I wrote an article on it. For our Dutch readers and our non-dutch readers who are that linguistic that they haven't any problems with our beautiful language, you can download it here.

Explore your Windows Processes

Many consultants that use Windows find that the Taskmanager of windows is pretty rudimentary. Also you might have encountered that files are locked by processes that you're not aware of. Or process that you can't manage to kill using Taskmanager. Then the Process explorer tool of Sysinternals is very usefull. Sysinternals is now part of Microsoft (already since a few years) but the tool is still available for free. It is such a great tool that I recommend to replace the taskmanager by it.

You can download the tool at http://download.sysinternals.com/Files/ProcessExplorer.zip

For our dutch readers I have an article on Process Explorer that I wrote a few years ago. You can download it here.

Friday, 2 January 2009

Free your debug Session

Recently I had to build, test and debug some Pl/Sql. I use my all time favourite tool Pl/Sql Developer. But it happens when debugging Pl/Sql that for no apparent reason the debug-session hangs. Especially when hitting the Break button in Pl/Sql Developer, it may happen.
When it happens you'll have to kill Pl/Sql Developer the hard way, using Taskmanager. Because it refuses to quit while there is a session running.

Fortunately, there is a pretty simple solution.

When your test script looks like:
-- Created on 1/2/2009 by MAKKER
declare
  -- Local variables here
  i integer;
begin
  -- Test statements here
  :result := sos_log.log_run(p_schedule_id => :p_schedule_id,
  p_status => :p_status);
end;

Then just declare an extra variable l_time_out of data type number. Then set a time of for example 5 seconds. using the dbms_debug.set_timeout:
declare
  l_time_out number;
-- Local variables here
  i integer;
begin
  l_time_out := dbms_debug.set_timeout(5);
  -- Call the function
  :result := sos_log.log_run(p_schedule_id => :p_schedule_id,
  p_status => :p_status);
end;

When Pl/Sql Developer looses the connection to the debug session the debug session will be freed after the timeout. Pl/Sql Developer gets the control back and you can go on with compiling and debugging.

You can add it easily to the default test template. Unfortunately Pl/Sql Developer does not use the template when you do right-click->test on a program-unit.
For that you could create a macro that adds the code to your test script, and connect it to a key-stroke.

Wednesday, 24 September 2008

Pl/Sql Developer under Wine 2

In my previous post I mentioned that running Pl/Sql developer under wine goes fine, but it does not show the icons on the buttons. Indeed it was the case with me. But somehow they appeared magically.

However, the other "minusses" still stand.

Friday, 19 September 2008

Pl/Sql Developer under Wine

This week I installed Pl/Sql Developer under wine. It was pretty easy. To have it working you need to install an Oracle Instant client. Probably you could install a complete Oracle Client, but the Instant Client will do and it just gives you enough to run Pl/Sql developer.

I unzipped the 10gR2 instant client (Windows 32-bit) into /home/makker/.wine/drive_c/oracle/product/instantclient_10_2.
I also put the sql-plus addendum there, but that did not work.
Then you place a valid tnsnames.ora in the subdirectory /home/makker/.wine/drive_c/oracle/product/instantclient_10_2/Network/Admin.

Install Pl/Sql developer (I just ran the installer under wine). When starting Pl/Sql developer you first have to go to the preferences and then the connection part. (menu=> tools => preferences). There you have to point Pl/Sql developer to your instant client in a windows way: C:\oracle\product\instantclient_10_2\oci.dll. After doing that, restart Pl/Sql Developer. Then it will load the oci.dll.

Then, provided that you have a database running and a valid tnsnames.ora you can connect to your database. In my case the connection to my 11g database in the VM is very, very slow. I haven't figured out yet what causes it. But I got the same behaviour using SqlDeveloper.

I'm very pleased having Pl/Sql developer running under Linux. There are however a few points to figure out and/or improve:
  • Buttons in the button bar are not shown.
  • Some features just don't work, like the macro-recorder.
  • Sometimes when switching applications, the Pl/Sql developer pane is not repainted correctly or at all. I have to play with switch "shade" (right-click in the taskbar) on and of, to get Pl/Sql Developer shown again.
But for me Pl/sql developer is most productive tool for the job. So I accept these "instabilities" under wine.

Tuesday, 2 September 2008

Java Swing XML Editor and Tester

Today I fine-tuned my XML Editor and Testing tools that I published earlier. The main improvements are that I integrated the XML Editor in my XMLTesting tool. For this I had to enhance and restructure my XML Editor to make it a "plugable" JPanel. Another thing is that I had to make sure that changes in one panel is propagated to the central File-Objects. This latter need some improvements because the capturing of the window-change-events are aparently not so evident in Java Swing. And also I keep copies of the File Objects. I need to improve that in the near future.
You can download my xml-editor here. And the xmltesting-tool here. Just unpack the zips into a directory and adapt the scripts (I included a windows bat file and a linux shell script) so that the your java virtual machine is referenced properly. Maybe I should change it so that it relies on having java in your path.

Sunday, 17 August 2008

Second release XML Editor

You won't get another version of Mozilla Firefox or Thunderbird as fast as another release of my XMLEditor. But at the other hand, it might not be for long that the release frequency of Mozilla beats mine. Anyway I couldn't help hacking a little on my editor.

It struggled me that the element-content was not editable properly. So I added a button "add text node". It will add a text node with a default text "Node Text". This text is editable in the child-elements-table when selecting the parent node.

Besides that I added toolbar buttons for new file and save file.

The new version is downloadable here.

Friday, 15 August 2008

First release XML Editor

The last few weeks around my vacation, in my "in-between-hours" I created a light-weight XML Editor. As you could have read before, earlier I created an XML editor in Java Swing to test XPath expressions and XSLT's. But I lacked a nice editor to build up your xml files.

For my bookmarks I created an xml file with an xslt-stylesheet that transforms the xml to an html-page with poplists where you can choose a link, hit a button and it the browser will show you the page. Windows has a nice feature (from Windows 98, I think) that's called the Active Desktop. You can place links to html pages on your desktop and Windows will embed the page into your desktop. I used that to show my poplists right on the desktop. That's one feature that I miss in KDE at the moment. KDE seems to have such a possibility, but I could not get it working. Also Windows can have multple pages on your desktop and you can denote the area where to show this page.

Anyway, the xml-file I had to edit with a ascii-editor. Notepad++ would do the job nicely. There are applications as XMLSpy (which needs a license) or jDeveloper (which is too big for the job) that can help you. These packages are smarter then mine, since they're able to take an XSD and let you edit the xml according to the XSD. Also in the past I saw xml editors (I remember one called Peter's XML Editor). But they're nearly allways only for Windows (as the XTrans-tool that drove me to create the XMLTester tool). Having it in Java makes it portable to both platforms.

Another thing is that XML is by nature Hierarchical. So I would like to browse through my XML hierarchically and then edit the parts I want to change.
Besides that, it seems a nice project to explore Swing components like the JTree and the JTable and play with DOM to change the xml. So it'll give me a little more "Fingerspitzengefuhl" with the java DOM api's. In the past I had this with the Pl/Sql dom-api's of the database.

Yesterday I finished my first version. You can download it here. Just unzip it to a directory.
To run it I added a shell script (for Linux) and a bat file (for Windows). You'll have to edit it to change the path to your JRE (Java Runtime Environment).

It's very basic in it's functionality. But I think it's pretty straightforward and intuitive. You can start it with the xmlfile as a parameter to the script. I did that to have a link on my desktop to edit my LinkLists-xml-file. Then it will parse and process the file given. But of course you can also open the file with the open button and create a new file with the File-new Menu option.
To create a new xml file you have to give in a node name that is used for the root node.

Of course this little app might need some improvements. One of them is that I changing a node value does not behave like I expect. It's not so that a node value is seen back in the file when saved. Probably I have to explore that a little more. But adding and changing attributes, adding and copying nodes work fine. The copy node does not copy a complete node but just creates a node on the same level with the same name. I could add functionality that really copies a node tree.

Another thing I'd like to do is to integrate this into my XML Tester tool. Then I have a little "suite" to create, edit and test XML files with XSLT's.

I hope you enjoy it and find it usefull. If you have comments, ideas for improvements, feel free to post them. Since I have to do it in the scarce, free time I have I can't do promises on the proposed changes.

Wednesday, 9 July 2008

Total Commander, Irfanview, Notepad++ and Open Workbench in Wine

A few weeks ago I installed Wine Doors, that helps you with installing Windows applications under Wine. I found that it should install Total Commander, my favorite File management tool under Windows. I work with it for years, even bought a license for it. Unfortunately there is a bug in Wine-doors so that Total Commander and also Irfanview do not install correctly.
Luckily it is not to hard to install those tools by hand.

First Totalcommander. Download it from: http://www.ghisler.com/. Then start the installer by typing 'wine tcmdr703.exe' in the terminal. Or start tcmdr703.exe with wine.
This installs Total commander in the default wine-bottle. By default Total Commander installs in the c:\totalcmd folder. I don't like that, so I always change it to c:\Program Files\totalcmd.
The installer then turns out have difficulties in creating the menu-items. So you have to take care with that yourself. The command that you should provide in the menu-item is: 'wine ~/.wine/drive_c/Program\ Files/totalcmd/TOTALCMD.EXE'.

Irfanview was my favorite Graphics viewer under windows. It's nice to have it under Linux too.
To install irfanview is also easy. You could install it the same way you did with TotalCommander. But I found it easier to start TotalCommander and then just doubleclick on the irfanview installer. Easy does it.

The same counts for Open Workbench. Besides Microsoft Project (that is licensed) Open workbench is the only serious project managers tool that I know. I tried a few Linux tools (Ganttproject, KPlato) but they lack some basic functionalities. Like give in how much a task costs in terms of hours and doing baselining, scheduling etc. Ganttproject however does have an export to Microsoft Project, but I did not try that. It's in java so it should work in Linux aswell as under Windows (a bat file is provided).
To install Open workbench is also very simple. Double click on it from Total Commander. It appears neatly in your menu. You should also install a Java Runtime Engine. I just installed JRE 6 update 7 from http://java.sun.com/javase/downloads/index.jsp. For me there is no need to install the complete jdk. That I have available under Linux. After installing that one under Wine Open Workbench starts fine.

Now I tried to install Notepad++. A fine ascii-editor that is much more usefull then Notepad and a real advantage to have it the default editor of Total Commander.
I first tried the new 5.0 version but that aborts with an exception. But the previous version 4.9.2 works fine.