Archive for the 'Development' Category

wget binary for Mac OS X

“wget” is a very handy Unix command line utility to download files over http. It not only shows details about the connection but also tracks current and overall download speed in KB/s or MB/s. Unfortunately, it’s not part of Mac OS X. If you already own Apple’s Xcode development environment you could easily compile your own wget binary or just download it from this site’s download area.


wget http://cachefly.cachefly.net/10mb.test
--19:59:11-- http://cachefly.cachefly.net/10mb.test
 => `10mb.test'
Resolving cachefly.cachefly.net... 205.234.175.175
Connecting to cachefly.cachefly.net[205.234.175.175]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10,485,760 [application/octet-stream]

100%[================================================================================================>] 10,485,760 1.86M/s ETA 00:00

19:59:17 (1.63 MB/s) - `10mb.test' saved [10485760/10485760]

You could do something similar with curl (which is included in OS X by default) but I prefer wget’s output over curl’s.

curl -o test.bin cachefly.cachefly.net/10mb.test
 % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 10.0M 100 10.0M 0 0 1739k 0 0:00:05 0:00:05 --:--:-- 2119k

How to read WebLogic 10.3 transaction logs (TLOG)

When analyzing distributed XA transaction problems it can prove useful to have a look at Oracle WebLogic’s internal transaction backup log file (TLOG). Since that file is all binary, it needs to be converted into a more human readable format first. In WebLogic 10.3, the TLOG file can be converted to text using this class:

weblogic.transaction.internal.StoreTransactionLoggerImpl

The class needs the transaction library from the modules directory and weblogic.jar in the classpath. Read more »

MMITunes v3.0 brings you genre-based playlists

Just in case you’re one of the few users of MMITunes: I added a new feature to auto-create genre-based playlists in MMITunes v3.0. If you select create playlists for genres MMITunes will generate .m3u playlists for every genre it finds in the tracks on the selected volume (which ideally is an SD-card or similar).

If you find playlists with weird names like (79).m3u you will have to convert the ID3-tags of that particular track to a newer version. You’ll find the names of the tracks which may require attention in the MMITunes output window. To convert the ID3-tags simply open iTunes, right-click the track, select Convert ID3 tags and apply ID3 v2.4. An easier way is to convert all your tracks at once instead of selecting single tracks. Don’t forget to re-export the tracks you modified to your destination volume.

The names of the three default playlists MMITunes creates have changed slightly as well. MMITunes v3.0 is available in the downloads area.

RTMPDump 2.4 binaries for OS X 10.7 Lion

I just got word from a commenter that RTMPDump 2.4 is out (thanks!). Since the release of Xcode 4 I have been unable to compile the RTMPDump binaries using the supplied Makefile. Actually, the binaries are all there but I always get a signal fault when the rtmpdump binary tries to establish a connection to a target server. I had to resort to plan B which was to import the RTMPDump sources into Xcode and to create a proper console application project. Read more »

When is the next Apple keynote address?

Since Apple announces their keynote addresses in their respective time zone (Pacific Standard Time or PST), I always thought it would be nice to have some sort of automatic time zone aware converter that shows the start of a keynote address for everyone’s local time zone. Since no one else is providing this kind of service (at least not that I know of) I took matters into my own hands.

Once Apple announces a keynote address, wheniskeynote.com will show the start time of the keynote depending on the time zone setting it finds on your computer. By the way, did you know they have a :45 minute time zone offset on Chatham Island?

The link list gets shuffled every time the page is loaded so not to give preference to any of the linked web sites. I wanted the site to look like a real keynote slide and I think the design comes pretty close to that. This was primarily a fun project to try out some programming techniques I wasn’t too familiar with. It would have been a lot more work if it hadn’t been for the fantastic jQuery JavaScript library, the very useful time zone detection JavaScript from Josh Fraser and Jon Nylander and the uber cool looking countdown timer JavaScript from Vassilis Dourdounis.

Check out wheniskeynote.com.

Controlling WSO2 Enterprise Service Bus programmatically using JMX

A few weeks ago I started working with WSO2‘s Enterprise Service Bus software, which is a lightweight and extremely high performance, open source enterprise service bus (ESB). One reason it’s so lightweight and fast is that it doesn’t have to be run in a bloated application server environment (although it can, but where’s the point). Instead, it’s running in an OSGi container. While the ESB itself still needs some polishing, especially in the area of deployment in large company environments, it looks extremely promising. We even flew in a few guys from HQ in Sri Lanka to help us with the initial setup of the product. Judging from the guys I’ve met, there must be a lot of talent in that company! Support is top notch and fairly priced.

One thing I was working on over the last few days is a command line remote control utility for the WSO2 ESB. It supports deployment and undeployment of the Eclipse Carbon Studio .car files and many other features, which at the time are only available through the web based user interface. The utility comes with an awesome name too: Carbonara :) We need this command line functionality for our fully automated change and configuration management processes. There’s no point in releasing the whole thing to the public because it’s tailor-made for the staging processes in my company.

Here’s a small Carbonara excerpt that shows how to send administrative commands like shutdown or entering/exiting maintenance mode to any WSO2 product using JMX. You can also use JConsole to remotely control any WSO2 product by the way. You will have to activate the JMX registry in the carbon.xml file in order to be able to use JMX. The supplied username and password will have to match a user with administrative privileges in the user store. Read more »

iPhone 4 iOS 4.2 beta installation error in iTunes

Installing the new (finally!!) iOS 4.2 beta on my iPad didn’t pose any problems. As usual, I just restored it using iTunes. Then I tried the same on my iPhone 4 but there always occurred an installation error right at the end of the update process. Read more »

MMITunes: Create playlists for your Audi MMI/RNS-E on the Mac

I have an iPod Classic connected to the Audi Music Interface (AMI) in my car to listen to music over the Audi multimedia system MMI 3G. The iPod is able to store a vast collection of music but sometimes I just want to listen to the tracks I recently downloaded in the iTunes music store without having to walk down to the garage, disconnecting the iPod, sync it on my Mac and so on. Read more »

Nofollow tag cloud for WordPress

I love the tag cloud widget that comes with WordPress. There’s just one thing that bugs me: it floods every post or page with lots of internal links that a search engine crawler will follow. The SEO community says that this could be seen as some sort of artificial link generation by a search engine and eventually lead to a disadvantage in a site’s SERP ranking. Having fewer internal links on a post should also pass a higher page rank to linked posts as well. See this post from Matt Cutts detailing how it makes sense to nofollow non-essential internal links:

There’s no stigma to using nofollow, even on your own internal links; for Google, nofollow’ed links are dropped out of our link graph; we don’t even use such links for discovery. By the way, the nofollow meta tag does that same thing, but at a page level.

Unfortunately, it’s not possible to instruct the built-in WordPress tag cloud sidebar widget to use nofollow tags for the generated links. Read more »

Must Read Posts: New version 2.0

After quite a long time with no updates I just released a new version of my WordPress plugin “Must-Read Posts”. The new version adds several configurable sorting options which was the most requested missing feature. With the exception of the custom sort order they’re pretty self explanatory and include:

  • Post date descending (latest posts/pages first)
  • Post date ascending (oldest posts/pages first)
  • Random (randomizes the sort order)
  • Custom

The custom sort order allows pre-defined ordering of posts or pages and was the default and only sort option in the earlier versions of the plugin. If you update from an earlier version of the plugin this still is the default sort order. The sort ordering option can be found on the widget’s configuration area.

In case you’re using the non-widget PHP function, the sort order parameters are:

  • date_asc
  • date_desc
  • rnd
  • custom

If you don’t specify a sort order, the default is “custom”. If you’re using a plugin like WP Super Cache don’t expect the random sort order to show a different order every time you load the page.

The plugin can be installed/updated from the plugins admin page within your WordPress site or downloaded here.

MMI VIM login-code generator Windows application

Due to popular demand there’s a MMI 2G/3G VIM login-code generator application available in the download area. Windows-only. And you need .NET Framework 3.5 in order to run it. You will be asked to download it from Microsoft during the installation if it can’t be found on your system.

WordPress Plugin/Widget for Must Read Posts

Today, I was looking for a simple WordPress widget that allows me to statically display links to certain posts in the sidebar. I could have used the links widget but it wasn’t flexible enough for me. My idea was to use a certain custom field of a post or page as a trigger to display it in a widget. I searched for almost an hour but I just couldn’t find any simple, widget-capable WordPress plugins that could do this?! 

In the end, I ended up writing my own widget-capable plugin. I decided to publish it so anyone else can use it on her/his blog too. The plugin’s name is “Must Read Posts”. It shows your most recommended posts and pages in a sidebar widget or in a page. As the widget’s title is editable in the WordPress Dashboard you could change it to something like “Recommended Posts”, “Important information”, “Tips & Tricks” or whatever you like. Read more »

SSO between BEA WebLogic Server and SAP Enterprise Portal (Web Dynpro) using Web services

You’re looking for a way to consume Web services in SAP NetWeaver 2004s (and SAP Composition Environment aka NetWeaver 7.1) from BEA WebLogic Server 8.1 (and newer versions) using Single Sign On (SSO)?

You may have figured out already that SAML is not an option here because the SAP side is just a SAML consumer and not a provider (as of today). The only way left is to use the proprietary SAP Logon Tickets. Proprietary authentication mechanisms always require some extra work. In this blog article I’ll fill you in on what you need to SSO-connect those two J2EE platforms. Read more »

SSO with SAP Logon Tickets and Java

To validate/verify a SAP Logon Ticket in a non-SAP Java environment you have to call into native libraries. Fortunately there’s some Java sample code provided in the SAPSSOEXT library archive.

Go to service.sap.com (you need a valid user and download permissions) -> Download -> Support Packages and Patches -> Entry by Application Group -> Additional Components, follow the SAPSECULIB and SAPSSOEXT links and download the library versions for your operating system. You’ll also need SAPCAR to extract those .SAR files. Both libraries – sapsecu.dll and sapssoext.dll – are needed to validate a SAP Logon Ticket. Read more »

QName problem with BEA WebLogic Server (WLS) 8.1

One day I was looking for a fast and easy to use Java webservice implementation. I found XFire, the next gen java SOAP framework which is based on a low memory StAX model. There’s a FAQ on the XFire website about how to run XFire in a WebLogic environment. XFire requires a newer version of the javax.xml.namespace.QName than is included in weblogic.jar. Now, this cures the problem with the missing constructor. Depending on what exactly you do in your webservice other errors may occur. The most prominent exception being this one:

java.lang.LinkageError:
loader constraints violated when linking
javax/xml/namespace/QName

The problem occurs if there’s the combination of an older version of QName (being loaded from the application server at boot time) and a library which uses the 3-string constructor introduced in a later version of QName. This most likely is a class loading issue because the QName class in weblogic.jar is loaded earlier by the system classloader and can’t be “overridden” by the EAR/WAR classloader. But that’s just my best bet as I am not a classloader expert when it comes to WebLogic’s classloading mechanism.

This is neither an XFire-only problem nor is it a WebLogic-only problem! I read about XML libraries (eg. XMLBeans, Spring, Muse) having the same issues with QName if running in an application server environment (e.g. IBM Websphere). Read more »