Oracle Timezone Conversions – GMT to localtime (and back)

clock

GMT to Local Time

Convert a datetime value (which has no timezone info, but assumed as GMT/UTC) to a local datetime (based on timezone parameter as set by SESSIONTIMEZONE, eg ‘+11:00′):

SELECT CAST((FROM_TZ(CAST(TO_DATE('1999-12-01 11:00:00',
'YYYY-MM-DD HH24:MI:SS') AS TIMESTAMP), 'GMT')
AT LOCAL) AS DATE) "Local Time"
FROM DUAL;

Local Time
--------------------------------------------------
1/12/1999 10:00:00 PM

Read the rest of this entry »

Tags: , , , ,

Syntax Highlight Code On Any Page Using Google Code Prettify

prettify00

The Google Code Prettify is a JavaScript module that allows syntax highlighting of any code snippets on a HTML page.  Setting this up on any web page is a simple 3 step process, and is supported on most common browsers.

[Demo]   (Based on:  prettify-21-May-2009.zip)
[Download Source Files]

Read the rest of this entry »

Tags: , , , ,

Unix LS Command With Colors… Without the —color Option

lscolor03

Having command line text in colors makes things easier to read.  For example the ls command for listing directories and files.  In some Unix environments, the ls command may not support the –color option to let us do that (as it  requires GNU ls).  So how can we workaround this to add color to ls?

Here are my steps to make it happen. Note i’m no Unix guru, and I didn’t have time to perfect it.. but it gets the job done!

Read the rest of this entry »

Tags: , ,

Live Messenger 8.1/8.5 Bypass Mandatory Upgrade

msnbypass00

Today when logging into my Windows Live Messenger 8.1,  I received a message forcing me to upgrade to the latest Windows Live Messenger (2009).  This was discussed on their blog less than 1 month ago (thanks for the short heads-up).  However, like many others, upgrading to the 2009 version was not ideal. That is:  it just doesn’t work at all.

For me, I ran into problems logging in (via my workplace), as I kept getting the error: “Signing in to Windows Live Messenger failed because the authentication service is not compatible with this version of the program.
Error code: 8100030f”.
And NOTHING in the online help provided any clues with this message!

So the only resolution for me was to find a way to continue using the old version.  Here I found a workaround to skip the mandatory upgrade (I’m on XP, however Vista should work also).

Read the rest of this entry »

Tags: , ,

BIAR File Command Line Import – Bypassing Import Wizard

The command line to import the BusinessObjects Enterprise (XIR2 Unix) exported biar file can be done using the following command:

java -jar <BOBJE_HOME>/bobje/java/lib/InstallEntSdkWrapper.jar 'cms_name' 'admininistrator' 'admin_password' 'secEnterprise' <PATH_TO>/MyBiarFile.biar

[InstallEntSdkWrapper.main] Connecting to CMS Development as administrator
[InstallEntSdkWrapper.main] BIAR Imported Successfully

Tags: , ,

How to untar a gz file in Unix

untargz

For a .gz file,

$ gunzip myfile.gz

For .tar.gz file,

$ gzip -dc myfile.tar.gz | tar xvf -

Tags:

BusinessObjects Enterprise – Changing Tomcat Session Timeout

To change the timeout limit of a BusinessObjects Enterprise XIR2 (Solaris) logged-in session (with Tomcat), the following files needs to be modified:

$BOBJE_HOME/tomcat/webapps/businessobjects/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/desktoplaunch/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/adminlaunch/WEB-INF/web.xml
$BOBJE_HOME/tomcat/webapps/businessobjects/enterprise115/adhoc/WEB-INF/web.xml

Find the following setting within the web.xml file to change the timeout value in minutes.

<!-- Define the default session timeout for your application,
      in minutes.  From a servlet or JSP page, you can modify
      the timeout for a particular session dynamically by using
      HttpSession.getMaxInactiveInterval(). -->
<session-config>
      <session-timeout>20</session-timeout> <!-- 20 minutes for session objects -->
</session-config>

Then just restart the Apache Tomcat webserver to take effect.

Tags: , , ,

BusinessObjects Universe Designer – Sysdate Value Object

universe_sysdate

Creating SYSDATE value objects in a Universe (via Oracle connection) can simply be done as shown above.   I have simply created a single-value dimension object, which can be used anywhere within a query (result/condition/sort).  Having sysdate values allows the flexibility to create dynamic time-based reports.  For example you can schedule a weekly report to extract data from the past 7 days starting from the current time the report was run.

Note, when parsing the object against the database (Oracle), an error will appear. ORA-00903: Invalid table name.

You can just ignore this error and press ok.

Tags: , , ,

Abort Windows Shutdown Using Shortcut

forceshutdown_abort

This follows on from the previous post on how to force shutdown your Windows machine using a shortcut.  This post shows how to cancel / stop Windows from shutting down after launching the shutdown command (eg by accident).

To create this shortcut, open Notepad, and add the following line of text, then save it with a .bat extension.  You need to hit the shortcut quickly if you want to abort in time.

shutdown.exe -a

Where:
-a abort shutdown

[abort_shutdown.bat] 32 bytes

Tags: , , ,

Exercise Your Idle System Doing Nothing

sleepy_idle

Via Unix/Linux:

cat /dev/zero > /dev/null

or

cp /dev/zero  /dev/null

Explaination:

/dev/null is basically a black hole (a special null file), anything written to it goes down the drain.  Anything read from it will result in nothing returned.  /dev/zero is basically the same as /dev/null when writing to it, however reading it will result in a continuous stream of zeros without EOF.

Tags: , , ,