Thursday, November 19, 2009

vlc, jackd no audio

I've been playing with Jack.

I'm feeling like I should always have it running since it works pretty well on the machine i'm using (xubuntu 9.10) and I'm going to want to use some audio production applications in future.

But, today I wanted to play a movie in VLC.

The sound didn't work and patchage didn't show 'vlc'. A brief search and I discovered that there is a jack plugin for vlc.

apt-get install vlc-plugin-jack

fixes that... Then within VLC, you need to switch to jack output:

tools->preferences->audio output label 'jack audio output'

then, I had to switch to 'show settings' all.
Open the audio->output modules->jack tree
and check the 'automatically connect to writable clients'

This made it work. I expect I'm going to experience some problems when I have more than one 'writable client', but I'll burn that bridge when I get to it.

Wednesday, November 4, 2009

basic http auth with Shiro in Grails

A quick note:

I found a blog nice simple recipe for basic http auth using Shiro in Grails. However, since this was published, JSecurity has been renamed Apache Shiro and so some minor changes need to be made at the end of the blog.

I posted them as a comment to that page but will repeat them here for good measure:

the last additions to Config.groovy when using Shiro should be:
security.shiro.filter.config = """
[filters]
authcBasic = org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter
authcBasic.applicationName = Demo app name
 
[urls]
/rest/** = authcBasic
"""

Monday, November 2, 2009

Grails, Shiro, addToPermissions() error

I've been playing with Grails with an eye to using it on a new project.

Apache Shiro looks like a suitable security framework for me so I thought I'd use it right from the off. There is even a plugin for Grails to simplify installation.

I discovered that you still have to create your own shiro.jar from the shiro source - but that was relatively straight forward....

[... once I had downloaded a new version of Maven (Fedora 11 packaged version wasn't recent enough)....]

So, once I had installed shiro.jar, and the plugin, I decided to run:
'grails create-db-realm' and
'grails create-authcontroller'
and added bootstrap code according to the plugin advice

ASIDE: for the purposes of just playing around. A better choice for 'playing around' is to do:
'grails quick-start'


If you followed the same route as me, you may have experienced:

Caused by: groovy.lang.MissingMethodException: No signature of method: static groovy.lang.MissingMethodException.addToPermissions() is applicable for argument types: (java.lang.String) values: [*:*]

The fix I arrived at is to add the line:
static hasMany = [ roles: ShiroRole, permissions: String ]
to ShiroUser.groovy so it becomes:

class ShiroUser {
String username
String passwordHash

static hasMany = [ roles: ShiroRole, permissions: String ]

static constraints = {
username(nullable: false, blank: false)
}
}


This got me past this error, however since I feel that I still don't properly 'get it', I expect more issues (and possibably blog posts) in the future!

Thursday, October 15, 2009

karmic ubuntu on hp mini 1000

I've spent the last couple of days trying to get Karmic (beta) on a HP Mini 1000 (1030NR).

This is simple enough with the help of unetbootin. My problems started when I tried to get wireless working with the proprietary drivers. I have never enjoyed satisfaction with proprietary drivers and this occation was the same.

In the 'Live mode' the installed (jockey) happily identified the hardware and swiftly installed ssb broadcom drivers. Once installed jockey didn't seem to be `all there'. I couln't install the drivers.

What finally worked was to go to synaptic package manager and search for 'broadcom' and force a reinstall of the relevant drivers:

bcmwl-kernel-source and bcmwl-modaliases

After this, it all worked perfectly.

Monday, October 12, 2009

Tomcat6 on Fedora 11

I'm contemplating using Tomcat for my next project. I'm going to be developing on my Fedora 11 desktop.

I am new to this whole app server business and have spent this morning getting everything working. It shouldn't have taken that long, but it did.

My aim was to have some thing running on localhost which I could connect to and click about in. Compressed down in to a couple of steps I needed to do:
  1. yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
  2. edit /etc/tomcat6/tomcat-users.xml
    add the line:
    <user name="manager" password="tomcat_manager_secret" roles="manager"/>
  3. service tomcat6 restart
tomcat6 is a basic package. to get something which you can click about with when you point your browser at localhost:8080, you need tomcat6-webapps. To get the manager component, you need tomcat6-admin-webapps.

This sounds obvious enough now that I've done it.

Thursday, September 10, 2009

plotting for cairo

I've been using cairo quite a bit recently. Inevitably, i've found myself wanting to do some graphs. Instead of doing an exhaustive search on the internet, I quickly decided that there was nothing suitable out there and I should do my plots manually for my application.

Some weeks (months?) on, I've noticed that this is not a sensible approach. I've spent a little more time on the internet looking for solutions, and had some helpful suggestions on email lists.

The primary candidate is:
PLplot that provides an 'extcairo' driver. This driver will allow you to construct a cairo context in your app, pass it to PLplot, call PLplotting commands, and provide you with a nice graph plotted on your context.

An example is provided: http://plplot.sourcearchive.com/documentation/5.9.2/ext-cairo-test_8c-source.html

Up until now, I've been a heavy user of gnuplot. I'm currently interested in extending gnuplot to support this type of work-flow.

Friday, August 21, 2009

firefox 3.5 landscape printing orientation icon

I have recently upgraded to Firefox 3.5. I am experiencing pretty poor performance from it, but this is no different to 3.0 I was running previously.

I suspect that it is either: the extensions i'm using (adblock, noscript, cookiemonster?) or my machine setup: openSuse 11.1.

Today i'm posting on something which I have noticed: I think the 'landscape' icon in firefox printing dialogues is broken. This icon appears in 'page setup' and 'print preview' and I believe it should show the picture of a person rotated through 90deg anti-clockwise to be correct. Here is an annotated screenshot capturing the offending icon.
The same criticism could be leveled at the 'reverse landscape' icon.

UPDATE: it would appear that these icons are provided by GTK, not firefox.