07 November 2014

If you are interested in Oracle EPM infrastructure...

... then you might want to pop in at UKOUG Apps 14 in Liverpool, on 10 December, to hear me describe the sad state of security in our little niche and how we can improve it.

I promise that I won't bamboozle you with security nerdspeak; it will mostly be an overview of "things EPM customers should ask for but somehow never do". Remember to pack your tinfoil hat!


02 November 2014

What to do if Apple Mail becomes invisible in OSX 10.10

Apple Mail is a solid application, but occasionally it can be infuriating.

Today, all of a sudden, when I opened it, the main viewer window would not appear. The program seemed to work fine in the background: I received notification of new emails, the unread count on the icon would get updated, but there was no window. Trying to use Exposé, "Bring all to Front", "Arrange all to front" wouldn't bring any improvement. Right-clicking on the icon and selecting "Show all windows" would show transparent squares with actual window titles, but trying to click on them would make no difference. File -> New Viewer Window seemed to produce new "transparent" windows, so the list under the Window menu would get longer but I still wouldn't see anything. Using Applescript to resize and reposition a window gave very strange results, with the window appearing half-broken (no Preview column, no Mailbox list, missing toolbars etc) and eventually disappearing again.

Out of desperation, I quit Mail and started digging in the filesystem. I eventually managed to fix the problem by doing the following:

cd /Users/your-user/Library/Containers/com.apple.mail/Data/Library
# 'tar' is just for safety, delete the gz file if fix works
tar -czvf ~/Desktop/Preferences.tar.gz Preferences
rm -rf Preferences


When I then launched Mail, the Viewer window finally appeared and worked correctly. It had lost my original layout, so I had to set a couple of preferences again, but apart from that it seemed to work well and it didn't lose any mail or account information. 

19 October 2014

Read this before you upgrade to OSX 10.10 "Yosemite".

A few notes for people looking to upgrade to OS X 10.10 "Yosemite".

  • If you are a homebrew user, you might want to backup your /usr/local directory and then remove or rename it before running the upgrade. This is, reportedly, why my upgrade was stuck on "about a minute remaining" for almost 20 minutes; basically Yosemite will go through that dir and "fix" a lot of your hacks.
  • For the same reason, backup your PostgreSQL data. If you don't, you'll have to fix it as reported on this StackOverflow question, i.e. recreating some dirs under (guess what) /usr/local. 
  • iStatMenus 3.27 was branded "incompatible" and disabled at first boot. After manually launching it, it had to "upgrade some components", but it seems to have been working fine since then. All its configuration was lost though. You might have a better experience with (paid upgrade) iStat Menus 5.
  • IntelliJ PyCharm 3.4 seems to crash on startup. Apparently this is a known problem for all JetBrains products at this time (as commenter Bardia confirms below), due to them using Java 1.6 which is not officially supported on Yosemite. To fix it, I opened /Applications/PyCharm.app/Contents/Info.plist and edited the JVMVersion key from "1.6*" (i.e. "any 1.6 version") to "1.6+" ("any version greater than 1.6"). This found the 1.7 Oracle JVM I had previously installed, and launched successfully. However, it looks like the standard interface fonts now look bad (but not the custom ones used in actual editor tabs, somehow). I'll probably have to read through the relevant thread in the IntelliJ forums at some point.
  • my not-regularly-updated homebrew was broken because it expected Ruby 1.8 to be available, whereas Yosemite ships only 2.0. To fix it, I successfully followed the instructions on this comment, just running the listed commands with sudo (because my homebrew is oldish and sudo-ed and I can't be arsed to reinstall and I'm a bad boy like that).
  • The upgrade freed about 10GB of space, which is nice but makes me slightly nervous about what was removed.
  • "Dark mode" is gorgeous, but the the new system fonts and overall "flatness" just make me sick. Apple Mail now looks sad. Guess I'll have to get used to it for now.
  • Animations feel a bit glitchier than before, on my beefy 2012 MBPr (2.6 i7 with 16GB RAM). It took about 5 minutes before I got the first system crash (pointer still moving but desktop completely unresponsive). Apple must be working hard behind the scenes to sell me a new laptop. EDIT: I've found the way to get pre-upgrade performance -- System Preferences -> Accessibility -> Display -> Reduce Transparency should be ticked. It makes a HUGE difference.
  • The upgrade didn't seem to make much of a difference with my HDMI problems (I have a new external monitor that can do 3840x2160, but it stopped working via HDMI earlier today, well before the upgrade. Hopefully it's a cable issue.)
I will likely update this post in the following days, as I experience more problems.

19 July 2014

Oracle ODBC Connection Strings - how I learnt to stop googling and RTFM

I just wasted four hours on the most idiotic thing, so I thought I'd document it here as self-reference.

Background: to connect to some Oracle db, I'm using the excellent pypyodbc module, which is a pure-Python ODBC implementation - basically a not-so-thin layer on top of your installed ODBC providers - that works great with Python 3. If you have to support multiple database vendors (in my case, Oracle, MSSQL, DB2 and maybe others), it makes sense to avoid packing a module for each product and just let ODBC work its magic.

The main problem with ODBC has always been the dark magic involved in crafting connection strings. Each driver provides different options, and when the syntax is not correct, in most cases there is precious little feedback. This is why we have sites like connectionstrings.com.

In my case, the connection string I was using worked fine with TNS names (the stuff in tnsnames.ora) like this:

Driver={Oracle in OraClient11g_home1};DBQ=myTnsServiceName; Uid=myUsername; Pwd=myPassword;

However, I did not want to rely on that particular catalog (which is often misconfigured/broken in the real world), and would rather specify the usual host, port and sid trimurti. So I went on connectionstrings.com and found the following:

Driver={Oracle in OraClient11g_home1}; Server=serverSID; Uid=myUsername; Pwd=myPassword;

... and then I spent four hours figuring out why it wasn't working. I turned on all tracing options, spent ages reading tracing logs, tried umpteen different values for SERVER... all for nought: from logs, it was clear that my SERVER option was completely disregarded and replaced with some default "orcl" values.

Desperate, I eventually thought of daring the (usually unwieldy) original driver documentation from Oracle. And lo, I've found in the FAQ doc for Oracle ODBC, on page 13, a very helpful table listing all the options you can specify in a connection string. "SERVER" was nowhere to be seen. Ouch.

It turns out the trick was to keep using "DBQ" and just replace it with the standard Oracle network syntax:

Driver={Oracle in OraClient11g_home1}; DBQ=myserver.mydomain.com:1521/mySid; Uid=myUsername; Pwd=myPassword;

In the end, I wasted 4 hours because I thought googling would have been faster than Reading The Fine Manual. Lesson learnt.

06 June 2014

Dash docset for Python 2.2.1 (i.e. Jython for Weblogic / Websphere)

I use Dash quite a bit, so I just spent a little bit of time creating a docset from Python 2.2.1 documentation. This old Python version matches the Jython implementation shipped with Oracle WebLogic ("WebLogic Scripting Tool", or WLST) and IBM WebSphere.

To install it in your Dash, just click on this link:dash-feed://https%3A%2F%2Fraw.githubusercontent.com%2Ftoyg%2Fpy221dashdocs%2Fmaster%2Ffeed.xml

The source script is in my GitHub repo, and you can manually download resulting packages on the Release page.

As tempting as it is, the idea to repackage webapp-specific documentation (e.g. for connect(), startEdit() etc) is a non-starter due to Oracle and IBM being quite trigger-happy with their copyright lawyers.