Posts

Showing posts from March, 2009

Playlists with MythTV

I've been wanting a way to use playlists on my media center either from within MythTV or with any other player. The reason is I have a bunch of short videos (music and documentaries) that I'd like to be able to play consecutively. It turns out to be a case of just RTFM . You can create playlists for MPlayer from directory listings, and then associate playlists with a particular mplayer command. To generate the playlist from all files in a directory, I use the following: dir * | sed 's/\\//g' > all_videos.pls The sed part of this command removes the \ from escaped spaces... i.e. a file 'Hello world' is output from the dir command as 'Hello\ world' - the space is escaped. We need to generate a file without these escaped spaces for it to work properly. I use the following mplayer command associated with the pls extension: mplayer -shuffle -fs -zoom -quiet -vo xv -playlist %s

Hey! Where'd my swap go?

I've just noticed that I've got no swap space! (Dell 1525 running Ubuntu 8.10). I first installed my laptop with Ubuntu 8.04, and later upgraded to 8.10. After the upgrade I noticed that hibernate no longer worked, and I think (from memory) I found an error message saying something about not enough swap space. I briefly thought about trying to find out how to add more swap (I already had a 4G partition defined, and I've only got 2G ram) but then I swiftly moved on to other more pressing issues. Well, just recently I fired up System Monitor to check on a process, and notice in the bottom right corner it said there was no swap space. Firing up 'top' confirmed this - my system had zero swap! I could see that I had a swap partition defined: paul@dell1525:~$ sudo blkid /dev/sda8: TYPE="swap" UUID="4bd53cb9-611c-4e57-a9df-4754d6bcdd65" But the corresponding entry in /etc/fstab had a different entry:. # /dev/sda8 UUID=e6eb6c47-599c-4612-ac8a-287279ee438

Grails Openid plugin and Xerces

I just created a grails 1.1 application, and installed the openid plugin. When starting the application, I got the following exception: 2009-03-17 22:25:41,090 [main] ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'consumerManager': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.openid4java.consumer.ConsumerManager]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser at java.security.AccessController.doPrivileged(Native Method) ... Caused by: java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser at org.openid4java.discovery.Discovery. (Discovery.java:47) at org.openid4java.consumer.ConsumerManager. (ConsumerManager.java:51) ... 21 more I worked around this by dropping xercesImpl-2.6.2.jar in the l

Set default browser in Ubuntu

To set the default browser, use update-alternatives as shown below: paul@dell1525:~$ sudo update-alternatives --config x-www-browser There are 2 alternatives which provide `x-www-browser'. Selection Alternative ----------------------------------------------- 1 /usr/bin/firefox-3.0 *+ 2 /usr/bin/seamonkey Press enter to keep the default[*], or type selection number: 1 Using '/usr/bin/firefox-3.0' to provide 'x-www-browser'. There is a good write-up of the update-alternatives system here .

Podcatching solution

I'm getting closer to a podcatching solution with gpodder . Gpodder is a simple and easy to use podcatcher - and importantly, it can be invoked from the command line in a non-interactive mode. This is important because of my internet plan - I get twice as much download quota on off-peak times as I do on on-peak. So, I can shedule a cron job to fire gpodder up at 1am and download the latest podcasts. Great, because I'm not going to consume precious on-peak bandwidth. Now that I've got the latest podcasts handy, I can listen to them on my media center using Amarok . This isn't the only option, but it works for me because the interface lets me 'group by album' - which is conveniently groups most podcasts - and display those added today/1 week/1 month/... Amarok also lets me configure Xine to output to SPDIF - important, because my media center is only connected via SPDIF to my surround sound receiver. Without this option, I wouldn't be able to hear anything. A

Extra Ubuntu Repositories

A friend put me on to this blog post about extra repositories for Ubuntu. This is a great resource which highlights some great (and possibly essential) software that you should know about if you are running Ubuntu (and possibly any linux flavour). Have a look, you may find some software listed there of interest to you. I didn't know about some of the items listed (eg GNOME Do ) so its been a great resource for me.

Getting rid of Root email

I've got a Linux VPS through RimuHosting - I'm no system admin, and the root account gets a pile of email spam. This takes up disk space so I try to regularly delete it. The best way I've found is to us Mutt - a console based email reader. Firing up Mutt as root displays the thousands of spam mails recieved. Pressing 'D' lets you delete messages that match a pattern. So I can specify the pattern 'a' and that matches almost all of the messages. When quitting the application, it deletes the marked messages. So, this is a good solution for reading or deleting many emails without downloading them - if you have ssh access. To avoid having to do this, can anyone tell me how to stop receiving these emails?

Groovy and Grails books

The catalog of Groovy and Grails books keeps growing, so if you are in the market for some, check out these sources: Pragmatic programmer Grails Groovy Apress Grails Groovy Manning Grails in Action Groovy in Action On Amazon:

Removing svn files

I recently needed to clean up and remove all of the svn files in a directory structure. I found the answer here , a simple linux command line to recursively delete .svn folders: find . -name ".svn" -print0 | xargs -0 rm -Rf

Over typing -Dskip.junit=true

I generally prefer Maven2, but I'm currently on a project using a custom ant build script - and I'm over having to type -Dskip.junit=true when I just want to generate a quick jar without running the tests. To easily switch off tests, I modified ant.bat so that it looks for a command line parameter 'st' and if found, it will substitute it with -Dskip.junit=true. In Ant 1.7.0, you just need to change line 68 in block ':setupArgs' from set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 to if ""%1""==""st"" (set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% -Dskip.junit=true) else (set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1) So, the whole block reads (from line 65): :setupArgs if ""%1""=="""" goto doneStart if ""%1""==""-noclasspath"" goto clearclasspath if ""%1""==""st"" (set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% -Dskip

Cannot find a valid baseurl for repo: core

I came across this error while trying to install a package on Fedora 5: # yum install gd-devel Loading "installonlyn" plugin Setting up Install Process Setting up repositories core [1/3] Cannot find a valid baseurl for repo: core Error: Cannot find a valid baseurl for repo: core The solution was relatively simple if obscure - I found it  here . I simply changed the enabled=1 to enabled=0 in: /etc/yum.repos.d/fedora-core.repo /etc/yum.repos.d/fedora-extras.repo /etc/yum.repos.d/fedora-updates.repo

Do you have that package installed

With yum, you can find out if you have a package installed using the query option. For example if you want to know if 'php-gd' is installed: # rpm -q php-gd php-gd-5.1.6-1.6