Thursday, September 29, 2011

Mounting a webdav url with davfs2

I found a very useful article online and my points of departure from the author's directions are summarised as a comment on the article and also quoted below.
Many thanks for the helpful information.
I placed the secrets file in ~/.davfs2/secrets and added an entry to /etc/fstab and it worked well.
Being on a 64bit system, I needed to install the 32 bit version of libneon27 for davfs2 to work.

Thursday, September 22, 2011

Adding new vtapes to amanda and troubleshooting

I needed to add new vtapes to amanda after successfully adding new space via LVM. Using a one line script included in the vtape how-to on the amanda wiki, I created the additional tape directories - slot[m] to slot[n].

After this, I changed the configuration file's tapecycle parameter to reflect the advice by martineau in a zmanda forum post - that tapecycle should be at least runspercycle * runtapes.

On executing amcheck on one of the amanda configurations, I ran into an error - WARNING taper changer error: slot : Slot  is already in use by driveN. This was resolved by deleting the driveN directory as suggested by dustin in another zmanda forum post.

Earlier, an all estimate timed out error had been resolved by adding the directive estimate calcsize to the configuration's dumptype as suggested by paddy in a zmanda forum post.

Monday, September 12, 2011

Screen Capture/Recording with ffmpeg

My attempt to record a video tutorial was failing with the error 'x11grab AVParameters don't have video size and/or rate. Use -s and -r'. This was in response to typing in the following command as based on an example in the ffmpeg man page.

ffmpeg -f x11grab -s 1280x1024 -i :0.0 -r 25 -sameq /tmp/test.mpg

After several failed tries, I determined that the error could be coming from the -r option. I moved it to immediately after the -s option so that both -s and -r options followed the x11grab specification. This time, it worked great. The final command is shown below.

ffmpeg -f x11grab -r 25 -s 1280x1024 -i :0.0 -sameq /tmp/test.mpg

Wednesday, July 20, 2011

Setting up the first LVM partition

Most of the LVM setups I have created have been done by the OS installer. I wanted to add more disk space to a server that did not have any LVM partitions setup. Below are the steps that I took:
  • added the hard disk (it was a virtual hard disk in this case)
  • created a partition and assigned it the lvm partition type id using fdisk
  • created the physical volume
    pvcreate /dev/sdb1
  • created a volume group called system with the earlier created physical volume:
    vgcreate system /dev/sdb1
  • created a logical volume to take up all the free space
    lvcreate -n storage -l 100%FREE system
  • created an ext3 file system on the logical volume
    mkfs.ext3 /dev/system/storage
  • Made an entry in /etc/fstab
    /dev/system/storage /storage ext3 defaults 1 2

Wednesday, May 25, 2011

Creating a patch file with Eclipse 3.5 Git plugin

This process assumes the changes to the file to create a patch from have been committed. The process may not be very different for working changes yet to be committed.

  • Display the Git repository view if it is not visible:
    Window > Show view > Other ... > Git > Git Repositories.
  • Navigate to the desired file. This can be done quickly by turning on the link with editor behavior of this view if the file is open.
  • Right click on the file in the Git repository view and select 'Show in History'.
  • In the history view, right click on the commit that has the desired changes and select 'Create Patch...' then provide a destination for the file in the subsequent dialogs.

Thursday, March 31, 2011

Using OJB Xdoclet in Eclipse

First of all, I copied the example Ant build file on the ojb xdoclet online reference (also available with the source distribution). Several attempts at running the build failed since ant produced an error to the effect that ojbdoclet was not a recognized sub-element of taskdef.

I therefore decided to comment out the outer taskdef element and left objdoclet as the a sub element of target. In Window > Preferences > Ant > Runtime > classpath, I added the xdoclet-ojb-module jar under Global Entries. I then clicked on the Tasks tab, and clicked on add new. In the resulting dialog, I gave the name of the task as ojbdoclet, selected the jar I had just added then selected the class file implementing the ant task - OjbDocletTask.


I then brought up the run dialog by clicking on the build file and selecting Run as > Ant build ... on the context menu. In the classpath tab, I added all the jars in the ojb binary distribution lib folder using the button add labelled external jars to the user entries section.

The build file, which also shows a task to delete the schema file during a build, is shown below:

<?xml version="1.0" encoding="UTF-8"?>

<project name="martinlaw-build" default="ojb-xdoclet">
<property name="destdir" value="./repository"/>
<property name="schemaFile" value="schema/schema.xml"/>

<target name="ojb-xdoclet" depends="delete-old-schema">
<!--
<taskdef name="ojbdoclet"
classname="xdoclet.modules.ojb.OjbDocletTask"
> --><!-- classpathref="build-classpath" -->
<!-- defined in eclipse ant > global entries > add jar > define task, add supporting jars to
build classpath under external tools configuration -->
<ojbdoclet destdir="${destdir}">
<fileset dir="../../main/java/edu/su/cv/ojb">
<!-- restrict to files with xdoclet markup only -->
<filename name="CourseTraining.java"/>
</fileset>
<ojbrepository destinationFile="repository_user.xml"/>
<torqueschema databaseName="placement_bundled" destinationFile="${schemaFile}" dtdUrl="database.dtd"/>
</ojbdoclet>
<!-- </taskdef> -->
</target>

<target name="delete-old-schema">
<delete>
<fileset dir="${destdir}">
<filename name="${schemaFile}" />
</fileset>
</delete>
</target>

</project>