Thursday, December 06, 2007
Nicer URLs?
Wednesday, November 28, 2007
SVN Tip for Sakai
svn status
is normally the way todo this but due to the number of external definitions in Sakai it produces allot of output which can't easily be suppressed. Piping this through egrep
and tr
can clean things up.
svn status | egrep -v "^(Perform|X)" | tr -s "\n"
svnst
makes it easy to get back to.
Wednesday, November 21, 2007
NoMachine Client in Fullscreen
- Clicking on the top right pixel
- Minimises the NX Client and returns you to your client desktop.
- CTRL-ALT-M
- Same as above
- CTRL-ALT-T
- Brings up a popup asking if I want to terminate the session or just disconnect from it.
Monday, September 24, 2007
Sakai Sessions and UsageSession
However just to confuse things a little the UsageSessionService (manages UsageSessions) has some very important methods, login() and logout(). These setup and destroy your Session and UsageSession at the same time. Login tools in Sakai should call UsageSession.login() to setup the Sakai session with the authenticated user details.
Sunday, September 23, 2007
Formatting with Styles
Monday, July 23, 2007
More Kerberos Puzzlers
Jul 17 12:33:46 machine sshd[5020]: debug1: An invalid name was supplied\nHostn ame cannot be canonicalized\nNow after looking through pages of google it seemed to be that there was something wrong with the hostname but looking on other machines they had very similar setups and were working correctly. The reason for this message was that I think that kerberos was using the hostname for kerberos and couldn't find an entry for the hostname in DNS. The reason it couldn't find a hostname was the there wasn't a search entry in /etc/resolv.conf specifying the domain to look in, adding
search oucs.ox.ac.uk
to /etc/resolv.conf fixed the problem and everything worked fine.
Hopefully this post might help someone else from scratching hole in their head. But it would have been much easier to debug if the invalid hostname was logged in the message.
Wednesday, July 18, 2007
svn_load_dirs.pl and Ubuntu
Thursday, June 14, 2007
Ethiopian Food in Amsterdam
Loading Resources in Sakai Components
<property name="configLocation"> classpath:/sql-maps-config.xml </property>Now the problem is that this property is loaded through a PropertyEditor which sets the property to a ClassPathResource. In Spring the classloading policy is that resources should be loaded through the thread's classloader. When the component manager is starting up and so when my component is create this is caused by the fact that a web application has asked for it so the thread classloader points to the webapp and the resource in your component won't be found.
The solution to this is to have a way to load resources using the standard JVM Class.getResourceAsStream() which will use the classloader used to load the current class. So I created an class:
package org.sakaiproject.util;
import org.springframework.core.io.ClassPathResource;
/**
* Resource implementation for class path resources.
* Loads out of the same classpath as this class was loaded through.
*
* Supports resolution as java.io.File
if the class path
* resource resides in the file system, but not for resources in a JAR.
* Always supports resolution as URL.
*
* @author buckett
*/
public class LocalClassPathResource extends ClassPathResource {
public LocalClassPathResource(String path) {
super(path, LocalClassPathResource.class.getClassLoader());
}
}
and put this in my component. I also then change the configuration in my components.xml to use the resource directly:
<property name="configLocation"> <bean class="org.sakaiproject.util.LocalClassPathResource"> <constructor-arg type="java.lang.String"> <value>/sql-maps-config.xml</value> </constructor-arg> </bean> </property>Now the configuration file gets loaded without any problems. Hopefully future Sakai developments in the component manager will mean this hack isn't needed later on.
Tuesday, June 12, 2007
Safari 3 Beta and FCKEditor
Saturday, June 09, 2007
Plane on Google Maps
Friday, June 08, 2007
Sakai Maven Plugin Install
maven plugin:download -DgroupId=sakaiproject -DartifactId=sakai -Dversion=2.2 -Dmaven.repo.remote=http://source.sakaiproject.org/maven
This only works with maven 1. If nothing else maybe this will give Chucks second post a little more Google karma and push it up in search results.
Thursday, June 07, 2007
Custom Logging in Sakai
log.config.count=2 log.config.1 = DEBUG.org.sakaiproject.portal.charon.handlers.HierarchyHandler log.config.2 = DEBUG.org.sakaiproject.portal.charon.handlers.SiteHandler
Wednesday, June 06, 2007
Don't forget Resource normally same as Entity
org.sakaiproject.entity.api.Entity
interface was called Resource and although most things seem to have been updated there are still some references across the codebase to Resources. An example is the org.sakaiproject.event.api.Event#getResource()
method which actually returns a Entity reference.
Tuesday, June 05, 2007
Sakai Portal Handlers
PortalHandler
interface has a useful base class called BasePortalHandler
and then some of the usable implementations are:
PageHandler
- Just displays a page which will load the tool in an iframe without anything else by default. URL: /portal/page/placementIdWorksiteHandler
- Just displays a site with the list of tools but no inter site navigation, supports supplying a additional page reference. URL: /portal/worksite/siteIdGalleryHandler
- Display the site as well as the inter site navigation but still no logo or login box, supports supplying an additional page reference. URL: /portal/gallery/siteIdSiteHandler
- Display a normal Sakai screen with site and inter site navigation, including login/logout links.
SkinnableCharonPortal.init()
which calls through to the portal service. The list of handlers if configurable at runtime through the portal service. Just posting this as a note for future reference really.
Bash History Expansion
!!
(previous command) and !$
(last argument of previous command) but today I discovered a new trick, the :h
modifier. This takes a word and removes file file name, here I am using it in action.
buckett@oucs-matthewb:~ $ sudo vi /opt/tivoli/tsm/client/ba/bin/incl.excl.SAVE buckett@oucs-matthewb:~ $ cd !$:h cd /opt/tivoli/tsm/client/ba/bin buckett@oucs-matthewb:/opt/tivoli/tsm/client/ba/bin $ mv incl.excl.SAVE incl.excl mv: cannot move `incl.excl.SAVE' to `incl.excl': Permission denied buckett@oucs-matthewb:/opt/tivoli/tsm/client/ba/bin $ sudo !! sudo mv incl.excl.SAVE incl.exclNow I just have to remember it for more than a few days for it to seep into my normal usage of the shell.
Tuesday, May 29, 2007
Sakai Startup Logs
tail -f logs/catalina.out | grep -v INFOwhich doesn't display all the INFO messages but still shows me anything serious, and all the internal tomcat messages about how the startup is progressing. I know I could change the logging (log4j) but this is a simple trick which still allows me to look back at the info messages to check things.
Friday, May 25, 2007
Installing Grouper Quickstart
tomcat-users.xml
as I didn't have any existing users I wanted to keep.
After a quick scan of the grouper-ui/build.properties
file I attempted to build the UI with ant ui
and selected option 6 (war) however this fell over with an ugly ant error. Looking at the build.xml
it seemed to be failing on the <propertyfile> task. A quick google and it seems this is an optional task, from previous experience I knew that the nice Ubuntu people split off the optional ant tasks into a seperate packages and sure enough that was missing on my system. An apt-get
later and I had the ant build successfully running.
I copies the newly created WAR into Tomcat and started it up. 14 seconds later I could access the Grouper UI. After a delay I realised that all I had was a redirect to populateIndex.do and a blank page. Then I remembered a mention at the start of the document saying I needed an HSQL database to be running. As it turns out this is actually reasonably easy, just ant db at the toplevel of the quickstart. Then a trip back to the webserver and yey, a working grouper installation. Now time for a little play.
Tuesday, May 22, 2007
Upgrading Sakai to 2.4
- Get source checkout from svn of 2.4.0
- Set maven.repo.remote in master/build.properties
- Check build works with maven bld
- Get patches used on 2.3.1 release
- Apply patches to login-tool and providers and fix rejections
- maven cln bld
- maven sakai:deploy-zip
- Copy sakai.tar.gz to server
- Stop existing tomcat and move out of the way
- Expand a clean tomcat 5.5.23
- Copy across conf/server.xml
- Copy across sakai folder from 2.3.1
- Copy across mysql connector from 2.3.1
- Upgrade the schema
- Copy across /portal redirection
- Start up tomcat
Monday, May 21, 2007
Sakai maven 1 & 2 problems
Maybe the version of maven 2 artifacts should be dev by default, rather than M2, to match maven 1? What I'm not yet sure of is why you would ever want more than copy of a particular JAR in a classloader, so maybe the version shouldn't be used in the filename when the deployment is made. Although in production it is useful to have the versions for working out what versions of a file you have.
Thursday, April 26, 2007
Google Apps at Oxford
Now when you signup for Google Apps you are asked to provide a domain onto which these apps will run and Google then allows you to provide branding of that domain. Google has the option to provide lots of applications (Word Processing, Spreadsheets, Calendaring, etc) and here I am talking about providing about everything except GMail which is a much more complicated issue.
My personal thinking is that OUCS should provide this service to its users and view it in a similar way to how it will provide a Shibboleth service. We provide the authentication, but the actual application is run and managed by someone else and the users should be aware of that. The possible problem with running Google Apps on an Oxford domain (docs.ox.ac.uk) is that it looks like an Oxford endorsed service and that if you have issues with it you should visit the Oxford helpdesk. However if Oxford could use the domain oxford.google.co.uk (or similar) then I believe it is much clearer that the service is provided by Google and Oxford is just providing the integration with SSO.
For a little effort we have the ability to make users lives easier in that they only need to sign on to WebAuth and they automatically get access to Google Apps. As Google already provides this service free to individuals there is nothing to stop any member of Oxford University just visiting Google and signing up for an account.
This also shows members of the University how SSO makes lives easier and how OUCS is looking to embrace new tools. But I think that we need to be clear that OUCS isn't endorsing the use of Google Apps and isn't supporting it (Google is). And why stop at Google Apps, if other companies provide similar authentication integration service why not integrate with them?
Friday, March 30, 2007
Sakai LDAP Provider
Ok so I was attempting to connect Sakai up to our LDAP server to get user details and after a successful user login was seeing an error in the logs:
WARN: getUser() from LDAP directory exceptionnull (2007-03-29 17:32:34,597 http- 8443-Processor25_edu.amc.sakai.user.JLDAPDirectoryProvider)
Not the most helpful error so I edited the source so that it logged the stack trace as well:
java.lang.NullPointerException at com.novell.ldap.asn1.ASN1OctetString.<init>(Unknown Source) at com.novell.ldap.rfc2251.RfcLDAPString.<init>(Unknown Source) at com.novell.ldap.rfc2251.RfcAttributeDescription.<init>(Unknown Source ) at com.novell.ldap.rfc2251.RfcAttributeDescriptionList.<init>(Unknown So urce) at com.novell.ldap.LDAPSearchRequest.<init>(Unknown Source) at com.novell.ldap.LDAPConnection.search(Unknown Source) at com.novell.ldap.LDAPConnection.search(Unknown Source) at edu.amc.sakai.user.JLDAPDirectoryProvider.getEntryFromDirectory(JLDAP DirectoryProvider.java:360) at edu.amc.sakai.user.JLDAPDirectoryProvider.getUser(JLDAPDirectoryProvi der.java:247)
Now we are getting a null pointer exception thrown from inside the novell LDAP library (not a good sign or very helpful). After a little bit of digging around I found the call line:
conn.search(getBasePath(), LDAPConnection.SCOPE_SUB, searchFilter, attribs, false, cons);
and it turns out (half an hour later) that one of the elements in the attribs
array was set to null. This was caused by having a sakai configuration where I had removed the attribute mapping for the group memberships as I wasn't using it but it turns out that the provider was still attempting to retreive this value from the configuration and then using it. It really shouldn't be this hard to fix simple configuration problems.
I believe that this LDAP provider has had some work done on it for 2.4 and I'll check to see if this bug still exists in 2.4 and if it does send in a patch.
Thursday, March 29, 2007
Are we there yet?
buckett@oucs-matthewb:~/sakai/sakai-2.3.1/checkout $ maven cln bld __ __ | \/ |__ _Apache__ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0.2 [...snipped...] BUILD SUCCESSFUL Total time: 11 minutes 2 seconds Finished at: Thu Mar 29 15:24:07 BST 2007
Wednesday, March 28, 2007
Miscellaneous failure No principal in keytab matches desired name
I was getting this error in the server logs when trying to ssh into a kerberos enabled box and although my ssh client was getting a principal for the machine host/machine.ox.ac.uk@OX.AC.UK I wasn't getting logged in. Now looking on the net it seemed that it was likely that I didn't have the matching principal in the keytab file. But a klist -k /etc/krb5.keytab showed all the correct keys. The next thing I checked was that the DNS records matched host machine.ox.ac.uk and host 192.0.2.0. After running round in circles I checked /etc/hosts to find the line 192.0.2.0 machine and because my machine used the hosts file before DNS it was looking for the principal host/machine@OX.AC.UK which of course didn't exist.
This whole saga would have been much easier to debug if the error message had just included the principal that wasn't present in the keytab file. The machine was a server Ubuntu 6.10 install. Strangely it seems that my desktop Ubuntu machine has the machine name only associated with 127.0.0.1 and not the external IP, although this machine uses DHCP to get its IP.
Tuesday, March 27, 2007
pam_env, /etc/environment and expansion
JAVA_HOME DEFAULT="/opt/jdk1.5.0_11"
PATH DEFAULT="/usr/local/sbin:/usr/local/bin:/usr/sbin:\
/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:${JAVA_HOME}/bin"
Tuesday, February 27, 2007
Firebug and Net View
Monday, January 29, 2007
Microsoft, Patnets and BlueJ (Java IDE)
Friday, January 12, 2007
ProxyUserDirectoryProvider
As part of the work I have been doing with Sakai and Bodington I needed to allow Sakai to access the user details that are stored in Bodington. The normal way to do this would be to write a UserDirectoryProvider (UDP) that sits in the components folder. The problem is that I didn't want to put the whole of Bodington into the components classloader and tomcat was going to load Bodington anyway as a webapp. The solution was to create a proxy that could be injected with the real Bodington UDP when Bodington started up. This needed to be an API that extended the standard UDP:
public interface ProxyUserDirectoryProvider extends UserDirectoryProvider {
UserDirectoryProvider getUdp();
void setUdp(UserDirectoryProvider udp);
}
This ProxyUserDirectoryProvider could then be requested from the component manager at Bodington startup and setUdp() called with the full implementation of the Bodington UDP. The proxy I created is currently sitting in https://svn.oucs.ox.ac.uk/projects/vle/sakai/user-proxy/trunk/.