Tuesday, November 15, 2011

Novell IDM (dirxml) - How to get the user DN in LDAP format

You can use the following Dirxml script to get the user DN in standard LDAP format:

<do-set-local-variable name="SlashDN" scope="policy">
<arg-string>
<token-src-dn/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="userDN" scope="policy">
    <arg-string>
        <token-parse-dn dest-dn-format="ldap" src-dn-format="qualified-slash">
            <token-xpath expression='query:readObject($srcQueryProcessor, "",$SlashDN,"","")/@qualified-src-dn'/>
        </token-parse-dn>
    </arg-string>
</do-set-local-variable>

Tuesday, September 13, 2011

jQuery and IE8 not the best of friends

So I've been pulling my hair out with IE8 ... again. I wrote some code that was working like a charm in FF and Chrome:

$(this).val().trim().match(match)

Sadly this code did not work in IE8 and I got the following error:

"Object doesn't support this property or method"

Changing it to the below did the trick:

jQuery.trim($(this).val()).match(match)

Another part of my life wasted debugging IE issues :(

Wednesday, August 3, 2011

Some of my old IT Textbooks

Wow what a find! Was digging around the house and found some really old textbooks. Check this out. Love the story about the CPU.









Tuesday, June 28, 2011

My Favourtie LDAP Tool

Just had to post this one, else I land up Googling between 1000s of LDAP tools.

http://www.novell.com/communities/node/8652/gawors-excellent-ldap-browsereditor-v282

Saturday, June 25, 2011

One of my best CDs


http://www.kalahari.net/music/All-Comes-Round/19738/120249.aspx

Wow I forgot how good this CD was. It's really good to enjoy some old school SA music :)

Tuesday, June 14, 2011

Oracle Regex

Needed some regex to only leave a-z values.

This seemed to work for me:


select regexp_replace(ent_val,'[^a-zA-Z]','') from ac

Friday, May 20, 2011

Novell Null Driver vs Loopback Driver

FYI a loopback driver can perform a query operation. A null driver returns nothing to a query operation.

Also they are different drivers as they use different Java classes:

com.novell.nds.dirxml.driver.nulldriver.NullDriverShim

vs

com.novell.nds.dirxml.driver.loopback.LoopbackDriverShim

ldapsearch strange results

Always make sure you use the -h option when using ldapsearch on Linux. Else it defaults to what's in the local ldap config (/etc/ldap.conf) which can result in some strange and unexpected results.

Wednesday, May 18, 2011

Clearing a lock in Oracle

I've been using Oracle's SQLDeveloper now for a while and found you can easily lock a table by not committing an update. Coming from a MySQL and MSSQL world I'm pretty used to updates committing by themselves. Here is how I cleared the lock:


Run this SQL to see what's locking what:

SELECT SUBSTR(TO_CHAR(session_id),1,5) "SID",
       SUBSTR(lock_type,1,15) "Lock Type",
       SUBSTR(mode_held,1,15) "Mode Held",
       SUBSTR(blocking_others,1,15) "Blocking?"
  FROM dba_locks


Use this command to get the serial number of the session:

SELECT s.inst_id,
       s.sid,
       s.serial#,
       p.spid,
       s.username,
       s.program
FROM   gv$session s
       JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE  s.type != 'BACKGROUND';



Use this command to kill the session that's holding the lock:

ALTER SYSTEM KILL SESSION ',';
e.g.
ALTER SYSTEM KILL SESSION '126,19703';

Some good references:

http://www.oracle-base.com/articles/misc/KillingOracleSessions.php
http://www.broadh2o.net/docs/database/oracle/oracleLocks.html

Monday, May 16, 2011

Novell RBPM - How to fix %nrf-sod-root% error

Picked up the following error:

16/05/2011 12:41:38 ERROR [ObjectsLookup] Error encountered while executing the service com.novell.idm.nrf.ajaxservice.ObjectsLookup : Ldap error querying for results. Error: javax.naming.InvalidNameExcepti
on: %nrf-sod-root%: [LDAP: error code 34 - Invalid DN Syntax]; remaining name '%nrf-sod-root%'.
com.novell.srvprv.spi.vdata.exception.VirtualDataException: Ldap error querying for results. Error: javax.naming.InvalidNameException: %nrf-sod-root%: [LDAP: error code 34 - Invalid DN Syntax]; remaining na
me '%nrf-sod-root%'
 



16/05/2011 12:42:44 INFO  [STDOUT] DEBUG [com.novell.soa.af.impl.core.ProvisioningRequestManager:getValidAttribute] ***** %%%TOP%%% ProvisioningRequestManager.getValidAttribute*****
16/05/2011 12:42:44 INFO  [STDOUT] DEBUG [com.novell.soa.af.impl.core.ProvisioningRequestManager:getValidAttribute] going to return a value! values.get(0) = SoD Conflict Approval

Found that someone had deleted the SoDDefs Object.

How to Fix:

1) Recreate the SoDDefs Object.
2) Update the nrfSODContainer attribute on the configuration object under RoleConfig.
3) Flash the cache in the UA.
4) Happy days!

Saturday, May 7, 2011

MySQL Select Random Row

Found a good post here: http://www.greggdev.com/web/articles.php?id=6 on this.
Basically you just add this to your query -> "order by rand() limit 1"
e.g. select saying from sayings order by rand() limit 1

Saturday, April 30, 2011

Windows 7 - Copy and Paste Issue

So I've been using Windows 7 more since our clients make use of OCS (Office Communicator), which I must say is a really awesome piece of software. Sadly though Windows seems to have issues with copy and paste. First I thought I was going mad...I mean how can you break something as simple as Copy and Paste? Well I can confirm it has been done! I decided to Google the problem and to my surprise found a large number of people having similar issues. So I decided to download Total Commander and use my really old-school tool to copy my files from the one folder to another. A very sad day for Windows 7, else I must say they've come a long way since Vista.

Tuesday, April 26, 2011

Traffic and Inflation

I find it amazing that the inflation rate is more or less 5-10%. Which means when you get your annual increase it might be 5-10% to accommodate for inflation. The reality though hit me when I went to go buy some Ciro coffee. About 2 years ago I used to pay R26 for 200g of Ciro coffee. Now it costs R40. So sadly the inflation rate for coffee is not where near 5-10%.

Regarding traffic I was in the biggest traffic mess I've ever been in on Friday. It was 100km+ of traffic on the N3. It took us 2 hours to do about 100km. This was crazy and the last thing I felt like to start off the long weekend. After 100km I decided to take some back roads and to my surprise .... road works :( basically it took us 8 hours to get to our destination when it should have only taken 4.5.

Well at least we back at home safely now :)

Busy installing a nice new legal copy of Windows 7 for my new Media PC. I really hope it can play .flac files cause I ripped by whole CD collection to flac. Oh and if you wondering why I'm not using MythTV, gladly I don't have a whole week to waste trying to get it working with my sound card again. Some things should just work, although it is still really sad that Creative do not make proper Linux drivers.

Tuesday, April 19, 2011

XGR Webcam from CNA

So I lost my driver CD for my XGR webcam I bought at CNA.

After doing some googling I found these drivers which sadly did not work:

http://www.comstarsa.co.za/tmp/

I did however find out the the webcam is a Vimicro VC0321

And got the driver here:

http://download.cnet.com/Vimicro-USB-PC-Camera-VC0321/3000-2110_4-104729.html

LDAP DN Characters

Ok so I need to clean up a String that needed to be a DN.

This post proved very useful: http://www.rlmueller.net/CharactersEscaped.htm

Backup copy

Oracle SQL Developer 3 on Ubuntu

1) Download RPM from Oracle
2) Alien RPM with -k option
3) Install deb with dpkg -i
4) Create file .sqldeveloper/jdk
5) Put this in the file:
/usr/lib/jvm/java-6-sun
6) Make sure you have sun-java6-jdk installed

Run sqldeveloper :)

Cool LDAP Tool

http://www.novell.com/communities/node/8652/gawors-excellent-ldap-browsereditor-v282

Saturday, April 9, 2011

Ubuntu Install Log

This is my install log for my Ubuntu 10.10 install.

1) Clean install from USB, default settings.
2) Install ubuntu tweak -> move close, maximise, minimise btns to other side of window.
3) Install codecs.
4) Install Firefox 4.
5) sudo apt-get install flashplugin-nonfree
6) apt-get install ubuntu-restricted-extras
7) sudo apt-get install build-essential
8) download and install VMware workstation
9) following this guide to get VMware working -> http://www.debuntu.org/how-wmware-workstation-7.1-ubuntu-maverick-meerkat-10.10
10) install drop box client
11) change firefox start options to: "firefox -ProfileManager -no-remote" and create no-proxy profile in firefox
12) sudo apt-get install vpnc network-manager-vpnc
13lucky number 13, trying to setup vpn but "no valid secrets" message, sadly time for reboot :(
14) reboot did the trick vpn up and running :)
15) did some digging here to get my mic louder, http://ubuntuforums.org/showthread.php?t=1245767, but somehow after sudo apt-get install padevchooser the mic seemed to work better :)
16) did an online update (excluded kernel update)
17) did this to get command prompt here -> http://www.watchingthenet.com/add-open-command-prompt-here-functionality-to-nautilus-in-ubuntu.html
18) install Novell Designer 4 followed debian-based install instructions
19) download eclipse php
20) uncomment "deb http://archive.canonical.com/ubuntu maverick partner" from /etc/apt/sources.list and run apt update
21) sudo apt-get install sun-java6-jdk
22) sudo apt-get install bzr-xmloutput
23) run php ecplise and install BzrEclipse (http://wiki.bazaar.canonical.com/BzrEclipse/Installation)
24) download and install soap ui

Wednesday, March 23, 2011

Kanu Red Wine

Some good red wine ->

Samsung LCD Locked Settings

To unlock a locked Samsung LCD Monitor child lock hold the menu button for 5 seconds. :)

Tuesday, March 15, 2011

Oracle Insert Statement Containing & (Ampersand)

So I needed to insert some data into an Oracle DB and found it was having issues with the ampersand (&). So I did some digging and found that before my insert statement I just execute the statement:


set define off

This proved very handy :-)

Source: http://forums.oracle.com/forums/thread.jspa?threadID=466604

Tuesday, February 22, 2011

Novell RBPM Best Engine Settings

Ok so I've been trying some of the settings for the workflow engine and found that these seem to work the best for us:



What I have however found is with about 5000 workflow requests the system does seem to choke a bit. I would recommend giving some good spec server to the server where you are going to run the workflow engine and assign another server as the 'front-end' server. This way the user experience should not be affected.

Tuesday, February 1, 2011

Getting JSON and JQuery .getJSON to work in IE8

To no surprise my code that was working 100% in FF died a horrible death in IE8.

Here's what I had to do to get it to work.

1) Set Header to:
response.setContentType("text/javascript; charset=UTF-8");   
Source: http://stackoverflow.com/questions/3517608/why-isnt-this-simple-bit-of-jquery-getjson-working-in-ie8

2) Prevent I8 from caching my Ajax requests:
$.ajaxSetup({ cache: false });
$.getJSON("/MyQueryUrl",
   function(data) {
     // do stuff with callback data
     $.ajaxSetup({ cache: true });
   });
Source: http://stackoverflow.com/questions/264216/getjson-returning-cached-data-in-ie8
 
3) Add JSON support to IE8
Basically just include json2.js in my script. 
Source: http://www.json.org/ 
 
Don't we all just 'love' IE


Monday, January 31, 2011

Getting back into Java

What a day! I've been doing some Java dev again and its amazing to struggle with the differences between PHP and Java. Although I originally started with C/Java I've really become almost lazy in some of my PHP practices. PHP being a 'scripting' language makes life easy as you don't have to cast everything in a 'type'. You also don't need to use good OO, which I guess you could say is a down side.

During my exploration with Java over the last couple of days I've come across a couple of problems and solution that I thought I'd write about here.

First problem that cropped up was that Eclipse kept on crashing. Some really weird error but after a bit of Googling I found the solution. Basically the problem was causing by having two versions of xulrunner installed. A quick 'sudo dpkg --remove xulrunner-1.9.1' got the problem sorted. Here's a ref to some a posting about it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=303372 and http://www.eclipse.org/forums/index.php?t=msg&goto=539642&

Second thing I decide to do was give Eclipse some more memory, by changing my run.sh to ./eclipse -vmargs -Xms1024m -Xmx1024m  -XX:PermSize=256m  -XX:MaxPermSize=512m

Next error I run into was Eclipse moaning about Jboss taking too long to start. So had to edit Jboss setting for this. Here's a screen shot on where to find the setting:

Basically you need to right click on the server in the button pane to bring up these properties. I also find it very difficult to find the correct settings for stuff in Eclipse.

Next thing I needed a bit of an update on was Vectors. Well I've been using Vectors for a while and they seem a bit clunky. So I decided to check out ArrayLists. The nice thing with ArrayLists is that they are quicker than Vectors and I found a really cool one liner to convert an ArrayList back to String array.

String[] yourArray = (String[])yourList.toArray(new String[yourList.size()]);

This also works for any other object type.

Ok, on to the next thing. JSON. So I've been playing with JSON and JQuery for awhile but never used it in Java. I first tried to use the standard JSON libraries but found them a bit of a pain. Then I found Gson (http://code.google.com/p/google-gson/). This worked much better and I was able to convert my Object array to JSON with two lines of code:

Gson gson = new Gson();       
String json = gson.toJson(resources);


Ok next thing I found out was really crazy. It took me about an hour to troubleshoot what the heck was going on here. So the reason I'm doing all this Java dev is so that I can plug a custom approval form into Novell's Roles Based Provisioning Module (RBPM). The only thing they don't tell you in this really cool article (http://www.novell.com/communities/node/9210/using-jquery-identity-manager-roles-based-provisioning-module-workflow-forms) is that if you use a HTML field type, the content of the HTML is obtained only after the page is loaded. Which results in alot of fun and games when using JQuery with dynamic content thats not on the page when .ready() function runs. So for now I would highly recommend make use of the TEXT field type in RBPM. This field is loaded already on the page and no .live() Jquery is required. I do however recommend using .live() when re-writing a page with Jquery and needed to keep track of changing items.

Any way think thats more than enough for one day.

Cheers.

Tuesday, January 25, 2011

Listen to Radio 702 on Ubuntu

Just use this one simple command:

mplayer mms://196.35.64.36/702_16

Wednesday, January 19, 2011

Oracle and PHP

Today seems to be the day the Oracle DB in Dev would start giving problems. I was running an SQL command from my PHP script, but it was never returning results. The SQL was an update command. I found this very strange as I could run the exact same command in Oracle SQL Developer. After alot of hair pulling I found that Oracle SQL Developer had a 'lock' on the table where I was trying to run the update SQL command. Once I closed // committed the outstanding transaction in SQL Developer my PHP script run fine. The problem I have however identified here is that there does not seem to be any may using the OCI library with PHP to put a time limit on the SQL query (more digging required). So I guess for now I may try putting a limit on the PHP script, but I'm really hoping there's some way to put a time limit on the SQL query to Oracle from PHP.

Followers