SQL Developer + tnsnames.ora for UWM

Posted by Quinn Madson | Posted in | Posted on 12:22 PM

0

After completing the steps below for your platform, TNS aliases will be available in Oracle SQL Developer in the "New/Select Database Connection" dialog by selecting "TNS" for the "Connection Type" combo box. These steps are only necessary if you can't or don't want to install the Oracle Client for your platform.

For Linux machines:
-get tnsnames.ora from: https://mumbles.imt.uwm.edu/dbdoc/tnsnames-noworld.php
-copy the file to: /etc

For Windows XP machines:
-get tnsnames.ora from: https://mumbles.imt.uwm.edu/dbdoc/tnsnames-world.php
-copy to c:\tnsnames\ (or some other directory where it will never be moved)
-right-click "My Computer" and select "Properties"
-click "Advanced" tab
-click "Environment Variables"
-under "System variables" click "New"
-"Variable name:" TNS_ADMIN (must be caps)
-"Variable value:" c:\tnsnames\ (or whatever directory you used above)
-Click "OK"
-Click "OK"
-Click "OK"

Ref:
http://wiki.oracle.com/page/SQL+Developer+FAQ?t=anon

* How does SQL Developer find my TNSNames file?
o SQL Developer checks the following:
1) $HOME/tnsnames.ora
2) $TNS_ADMIN/tnsnames.ora
3) /etc/tnsnames.ora ( non-windows )
4) $ORACLE_HOME/network/admin/tnsnames.ora
5) Registry Key

Wicked Juju

Posted by Quinn Madson | Posted in | Posted on 11:05 PM

0

Spent a few hours migrating from an old media server to a new one. For the most part everything went great except the MediaMVP running MVPMC would not load the dongle.bin.config. I assumed my TFTP server was mis-configured, the mvpmc commandline switches were wrong, etc.

No dice!

Found this wicked juju from: http://mlblog.osdir.com/multimedia.mvpmc.user/2006-05/msg00020.shtml
Reposting it here for posterity:

Guys,

See my post in the user group. I've posted an incantation that allows the MVP to boot. The problem with this H1 appears identical to the same problem I have with my H2. I'm posting an update later on more findings I've had with long vs short power cycles and using MVP relay. Here's the reader's digest procedure to get a successful boot (from an H2):

After trying several experiments, the following sequence got me back to reliable time and time again booting (until you boot from flash again):

* Unplug the MVP for (I got it to work with a 90 second to 120 second cycle).
* After the 120 seconds have elapsed, unplug the ethernet cable (I think leaving it plugged in may help bleed off any capacitors)
* Apply the power again and wait for the MVP to get to the point where it complains about not finding a server and asks you to press OK to re-scan. You'll also notice that your "favorite server" has disappeared from the list.
* Power it down
* Plug in the ethernet cable
* Power it up (no waiting)
* You should get past the hanging last square
* When you get to the screen that states to press OK within 3 seconds to configure press OK
* You should notice that the MVP is re-scanning and your available server should appear on the list.
* Press OK to save the configuration (this takes a while and I suspect clears out any "bad" data that may be causing the problem)
* The MVP restarts
* You get to the screen with the 10 squares and dongle.bin.ver is requested and served at about the 3rd square. Then dongle.bin gets requested and served and now the text LOADING APPLICATION appears above the 10 squares and they all fill completely and stop once all full (NOTE: only one cycle and the LOADING APPLICATION seem to indicate that its working)
* There is a delay as the mvpmc application loads and screen flashes as it boots up perfectly.

Please let me know if this works for you as well...

Cheers...

Sergio
It works ... as goofy as it seems ... it works.

CAS + ColdFusion

Posted by Quinn Madson | Posted in | Posted on 9:24 AM

3

The example available from JA-SIG is some of the ugliest code I've seen lately. This is what I came up with (based on their example code):
Application.cfm

<cfapplication name="my_awesome_app_name_here"
clientmanagement="yes" sessionmanagement="yes"
setclientcookies="yes" setdomaincookies="no"
loginstorage="session">
index.cfm
<!--- globals --->
<cfparam name="url.ticket" default="">
<cfparam name="username" default="">
<cfparam name="url.action" default="">
<cfscript>
cas_path = "https://cas-server.example.edu/cas/";
app_path = "https://coldfusion-server.example.edu/path/to/this/app/";
cas_url = cas_path & "login?" & "service=" & app_path;
</cfscript>

<!--- session init --->
<cflock timeout="10" scope="session" type="readonly">
<cfparam name="session.username" default="">
<cfparam name="session.authorized" default="0">
</cflock>

<!--- logout action --->
<cfif url.action eq "logout">
<!--- session reset --->
<cflock scope="session" timeout="30" type="exclusive">
<cfset session.username = "">
<cfset session.authorized = "0">
</cflock>

<cfset cas_url = cas_path & "logout">
<cflocation url="#cas_url#" addtoken="false">

<cfelse>
<!--- auth check --->
<cfif not len(trim(session.username))>
<cfif not len(trim(ticket))>
<cflocation url="#cas_url#" addtoken="no">
<cfelse>
<cfset cas_url = #cas_path# & "serviceValidate?ticket=" & url.ticket & "&" & "service=" & app_path & "/">
<cfhttp url="#cas_url#" method="get"/>
<cfset objXML = xmlParse(cfhttp.filecontent)>
<cfset SearchResults = XmlSearch(objXML,"cas:serviceResponse/cas:authenticationSuccess/cas:user")>

<cfif arraylen(SearchResults)>
Raw XML:<cfdump var="#cfhttp.filecontent#">
<cfdump var="#objXML#" label="CAS Results">
<cfdump var="#SearchResults#" label="Parsed CAS Results">
<cfset username = SearchResults[1].XmlText>
<cflock scope="session" timeout="30" type="exclusive">
<cfset session.username = username>
<cfset session.authorized = "1">
</cflock>
<cfelse>
<cflocation url="#cas_url#" addtoken="no">
</cfif>
</cfif>
</cfif>



<cfif structKeyExists(url, "accessdenied")>
Access Error
<cfelse>
Authenticated.<br/>
<cfdump var="#session#" label="ColdFusion Session Object">
<a href="?action=logout">Logout</a><br/>
</cfif>
</cfif>
Honestly, it's a pretty simple process:
  • Check for a ColdFusion session
  • If one doesn't exist, redirect to CAS and provide a call back URL
  • When CAS redirects back to your application you grab the ticket and verify it server to server via cfhttp.
  • If the ticket checks out, you create a ColdFusion session and use it within your application.
The point of this example is to keep it simple. The code is commented to clue you into where the different components would plug into the framework of your choice.

Zimbra URLs

Posted by Quinn Madson | Posted in | Posted on 7:08 AM

1

Zimbra has a bunch of built in functionality for rendering HTML versions of calendars as well as feeds such as RSS. This keeps coming up with Zimbra users inside and outside of our organization. I'm posting it here for future reference.

For an HTML representation of a public calendar we use a URL like this:

https://pantherlink.uwm.edu/zimbra/home/qkmadson/calendar.html?view=week

The view=week is optional; I just wanted to show an example. The view defaults to a month view and can be changed by the user. If the calendar is not set to public, you'll get a permission error. If you want to show a private calendar, you can use something like:

https://pantherlink.uwm.edu/home/bmaas/?fmt=freebusy&view=week

This will show the free and busy information but, no meeting details. For your purposes, you will need to change "pantherlink.uwm.edu" to your Zimbra server and change "qkmadson" or "bmaas" to one of your usernames. You may want to take a look at this blog entry:

http://www.zimbrablog.com/blog/archives/2006/01/rest-update.html

The show examples of how to use various feed options in Zimbra. For example, if you wanted to use RSS:

https://pantherlink.uwm.edu/zimbra/home/qkmadson/calendar.rss

RapidSVN currently broken in Ubuntu Repository

Posted by Quinn Madson | Posted in | Posted on 9:01 AM

0

The current package for RapidSVN segfaults constantly with the current version (as of today's date) in the Hardy Heron repos. To fix this:

  • Grab the Intrepid Ibex package by editing: /etc/apt/sources.list
  • Do a search and replace: "hardy" for "intrepid".
  • Update your packages and reinstall RapidSVN.
You can do this from the GUI side with gedit and synaptic. From the command line:
sudo -s
vim /etc/apt/sources.list

in vi:
:%s/hardy/intrepid/gi
:wq!

command line:
apt-get update
apt-get install rapidsvn
At this point, you should switch back to the hardy repos by editing sources.list and re-replacing intrepid for hardy.

Network Debugging w/ MVPMC

Posted by Quinn Madson | Posted in | Posted on 6:12 PM

0

While running the MVPMC software on MVC devices, sometimes I will receive an error that the streaming server cannot be found.

Check /var/log/messages for:

 dhcpd: DHCPACK on 192.168.0.51 to 00:0d:fe:39:21:06 via eth0

if that's the last message, make sure you run:
/usr/sbin/in.tftpd -l -a :16869 -s /tftpboot -v
/usr/bin/mvprelay 16881 5906 6337 192.168.0.1 &

Extending the Zimbra Canvas

Posted by Quinn Madson | Posted in | Posted on 11:17 AM

1

The Zimbra Canvas is pretty cool but, somewhat limited from the Zimlet XML definition file. For example, you cannot modify the buttons of the container if it's called from the XML. You can get around it by using the Zimbra JavaScript implementation.

It's pretty easy to get a canvas going from the JS side but, I was having issues getting the iframe style <actionUrl> functionality from the XML side. I had to reverse engineer this based on the source of ZmZimletBase();.

Here is the XML:

<zimlet name="edu_myschool_myzimlet" version="1.0" description="Some Zimlet">

<include>http://www.myschool.edu/LOCATION/TO/ZIMLET/zimlet.js</include>
<includeCSS>http://www.myschool.edu/LOCATION/TO/ZIMLET/zimlet.css</includeCSS>
<handlerObject>Edu_myschool_myzimlet</handlerObject>

<zimletPanelItem label="Some Zimlet" icon="My-panelIcon">
<toolTipText>This is a super awesome zimlet that does something.</toolTipText>
<contextMenu>
<menuItem label="Do something" id="doSomething" icon="My-panelIcon">
<canvas type="dialog" width="700" height="500" />
<actionUrl target="http://www.myschool.edu/LOCATION/TO/MASHUP/AWESOMENESS/" />
</menuItem>
</contextMenu>
</zimletPanelItem>
</zimlet>
This sets a right-click menu using the <zimletPanelItem> directive. More importantly, (for us, right now) is that it calls out to our JavaScript. Here is what the JavaScript should look like:
function Edu_myschool_myzimlet() {
}

Edu_myschool_myzimlet.prototype = new ZmZimletBase();
Edu_myschool_myzimlet.prototype.constructor = Edu_myschool_myzimlet;

Edu_myschool_myzimlet.prototype.init =
function() {
};

// Called by the Zimbra framework when the panel item was double clicked
Edu_myschool_myzimlet.prototype.doubleClicked = function() {
this.singleClicked();
};

// Called by the Zimbra framework when the panel item was clicked
Edu_myschool_myzimlet.prototype.singleClicked = function() {

var view = new DwtComposite(this.getShell());
view.setSize("500px", "500px");
var el = view.getHtmlElement();
var myBox = document.createElement("div");
el.appendChild(myBox);

var html = new Array();
var i = 0;
html[i++] = "First line of HTML <br/>";
html[i++] = "More lines of HTML";

// package up html and display it
myBox.innerHTML = html.join('');
this._dialog = this._createDialog({title:"My Dialog Title", view:view});
this._dialog.setButtonListener(DwtDialog.OK_BUTTON, new AjxListener(this, this.myHandler));
this._dialog.setButtonTitle(DwtDialog.OK_BUTTON, "Go go gadget Zimlet!");
this._dialog.popup();
};

Edu_myschool_myzimlet.prototype.myHandler =
function(ev) {
//do come more stuff: web services, api calls, etc
this._dialog.popdown();
}
This will show some HTML within the Zimbra Canvas. You can create a form and allow it to call web services, the Zimbra API, etc based on what the user did. This is pretty handy. Also, if you look at the code, you can add handler functions to the buttons, change the button text, etc.

In some cases, you may just want to call out to some other code: PHP, JSP, ASP, (or in my case) ColdFusion, etc. To do an iframe the exact same way that <actionUrl> does, change the click action functions:
Edu_myschool_myzimlet.prototype.singleClicked =
function() {
var view = new DwtComposite(this.getShell());
view.setSize("700px", "500px");
var el = document.createElement("iframe");
el.src = "http://www.myschool.edu/PATH/TO/MY/CODE/mashup.cfm";
var sz = view.getSize();
if (!AjxEnv.isIE) {
// substract default frame borders
sz.x -= 4;
sz.y -= 4;
}
el.style.width = sz.x + "px";
el.style.height = sz.y + "px";
view.getHtmlElement().appendChild(el);

//TITLE OF THE DIALOG BOX
var dialog_args = {
title : "Example",
view : view
};
var dlg = this._createDialog(dialog_args);
dlg.popup();
};
From here you could add code to modify the buttons, pass a query string from JavaScript via the URL, etc.