Thursday 22 September 2011

svn ci -m"svn helper script to maintain 'Pristine' workspace area and do faster checkouts" svncoP.sh svnmaintainP.sh

#!/bin/bash
# svncoP: svn co using Pristine workspace (faster!)
#
#Svn command-line co or updates are slow on big svn repositories becasuse they do each file sequentially.
#TortoiseSvn and other clients are a little bit more clever I think and have an element of multi-threaded/parallel checkouts.
#In the past I used a cron to maintain a .pristine. copy of large svn.
#And a helper script when I needed a checkout.
#
#The way it works:
#Cron does regular cleanup and svn up and makes archive of the pristine workspace.
#Helper checkout script unpacks archive of pristine workspace, unpacks it in new place, then does svn up in there.
#
# 22/9/2011 James Coleman

PRISTINEDIR=~intregress/pristine
if [[ ! -d $PRISTINEDIR ]] ; then
  echo "FAIL: pristine dir:$PRISTINEDIR is not set up"
  exit -1
fi
project=$1
if [[ "$project" == "" ]] ; then
  echo "FAIL: USAGE: $0 "
  echo "e.g. $0 lab"
  exit -1
fi
if [[ ! -e $PRISTINEDIR/${project}_trunk.tbz ]] ; then
  echo "FAIL: pristine workspace:$PRISTINEDIR/${project}_trunk.tbz is not set up"
  exit -1
fi

DTS_START="$(date)"
S_START="$(date +%s)"
echo "DTS_START:$DTS_START"
tar -jxvf $PRISTINEDIR/${project}_trunk.tbz
DTS_UPSTART="$(date)"
echo "DTS_UPSTART:$DTS_UPSTART"
cd $project
svn up
cd ..

DTS_END="$(date)"
S_END="$(date +%s)"
echo "DTS_START:$DTS_START"
echo "DTS_UPSTART:$DTS_UPSTART"
echo "DTS_END:$DTS_END"
echo "svncoP project:$project Total time taken: $(($S_END - $S_START)) secs" |tee -a $PRISTINEDIR/svncoP_${project}.log



#!/bin/bash
# svnmaintainP: cron script to maintain 'Pristine' svn workspace
#
#Svn command-line co or updates are slow on big svn repositories becasuse they do each file sequentially.
#TortoiseSvn and other clients are a little bit more clever I think and have an element of multi-threaded/parallel checkouts.
#In the past I used a cron to maintain a .pristine. copy of large svn.
#And a helper script when I needed a checkout.
#
#The way it works:
#Cron does regular cleanup and svn up and makes archive of the pristine workspace.
#Helper checkout script unpacks archive of pristine workspace, unpacks it in new place, then does svn up in there.
#
# 22/9/2011 James Coleman

PRISTINEDIR=~intregress/pristine
if [[ ! -d $PRISTINEDIR ]] ; then
  echo "FAIL: pristine dir:$PRISTINEDIR is not set up"
  exit -1
fi
project=$1
if [[ "$project" == "" ]] ; then
  echo "FAIL: USAGE: $0 "
  echo "e.g. $0 lab"
  exit -1
fi
if [[ ! -e $PRISTINEDIR/${project} ]] ; then
  echo "FAIL: pristine workspace:$PRISTINEDIR/${project} is not set up"
  exit -1
fi

DTS_START="$(date)"
S_START="$(date +%s)"
echo "DTS_START:$DTS_START"

cd $PRISTINEDIR/${project}
svn up

DTS_TARSTART="$(date)"
echo "DTS_TARSTART:$DTS_TARSTART"
cd ..
tar -jcvf $PRISTINEDIR/${project}_trunk_new.tbz ${project}
mv $PRISTINEDIR/${project}_trunk_new.tbz $PRISTINEDIR/${project}_trunk.tbz

DTS_END="$(date)"
S_END="$(date +%s)"
echo "DTS_START:$DTS_START"
echo "DTS_TARSTART:$DTS_TARSTART"
echo "DTS_END:$DTS_END"
echo "svnmaintainP project:$project Total time taken: $(($S_END - $S_START)) secs" |tee -a $PRISTINEDIR/svnmaintainP_${project}.log



Monday 19 September 2011

handy script to add mp3 title/info to mp3 files. add_mp3info.sh


I am listening to Irish CD that Kate brought home and fixing up some .mp3 file info. Using this script I made earlier (25/12/2009).

#!/bin/bash


# Retrospectively add mp3 info into mp3 files.
# Based on directory name and file name.


# usage:
#~/mp3$ add_mp3info.sh */*/*.mp3
#~/mp3$ add_mp3info.sh -f therapy/*/*.mp3
# WARNING: doesn't work for other directory levels
# TODO: oops, doesn't work if leading ./ or anything leading.
# BUT: is safe enough, it won't overwrite existing mp3info (unless -f FORCE flag is passed)




# e.g.
# artist_name/album_name/01-track_title.mp3 does not have an ID3 1.x tag.
#find . -name *.mp3 -exec mp3info {} \; |less




FORCE=$1
if [[ "$FORCE" == "-f" ]] ; then echo foo; shift; fi
#for f in tom_waits/*/*; do
for f in $*; do
 info=$(mp3info "$f")
 if [[ "$FORCE" == "-f" || "$info" == "" ]] ; then 
  echo "Adding info to file:$f"
  artist=;album=;title=;track=;
  artist=${f%%\/*.mp3}
  rest=${f#*\/}
  album=${rest%%\/*.mp3}
  rest=${rest#*\/}
  title=${rest%%.mp3}
  title=${title##*-}
  track=${rest%%-*}
  title=$(echo $title|sed "s/_\([a-z]\)/ \U\1/g" |sed "s/^\([a-z]\)/\U\1/")
  artist=$(echo $artist|sed "s/_\([a-z]\)/ \U\1/g" |sed "s/^\([a-z]\)/\U\1/")
  album=$(echo $album|sed "s/_\([a-z]\)/ \U\1/g" |sed "s/^\([a-z]\)/\U\1/")
  params=""
  #[[ "$title" != "" ]] && params="$params -t \"\$title\""
  mp3info -t "$title" -l "$album" -a "$artist" -n "$track" -c "badgers are lovely" "$f"
 fi
done


# TODO: oops, doesn't work if leading ./ or anything leading.
#/home/jamesc/bin/add_mp3info.sh: 24: [[: not found
# so this won't work:  find . -name "*.mp3" -exec add_mp3info.sh {} \;


# to get meta info from music/video files generally (if it is there): exiftool





A couple of other handy snippets:

# fill in fixed  mp3 info into file, increment track number as you go.
track=1
function mrfle1 {
title="$TTITLE"
f=$t
mp3info -t "$title" -l "$album" -a "$artist" -n "$track" -c "is maith linn broc" "$f"
track=$((track+1))
}

# rename track files according to title (replacing non-alpha-numerics for thefile name)
function mrfle {
f=$(echo "$TTITLE"|tr "[:punct:][:space:]" "__").mp3
mv $t $f
}


Sunday 18 September 2011

gimp/inkscape tickets/poster for Gala Show


This year is a very important birthday year for the Glencullen Musical and Dramatic Society. The 40th Anniversary of the society is being celebrated with a Gala Show * * The Magic of Musicals * *.


Rehearsals have kicked off with great energy. There is some lovely music to be heard in St. Tiernan's School on Tuesday and Thursday evenings and indeed from inside cars and bathrooms around the area the whole week long! Younger members have started working on some old favourites from Oliver! and Scrooge. For teenage and adult members rehearsals have started with chorus numbers from Oliver!, Oklahoma, My Fair Lady, Guys and Dolls, Calamity Jane, Chess and others.
Well done to everyone who came to auditions for solo parts on Thur 15th Aug. The production team is pulling together the songs and the comedy and drama pieces and the exact order will be set in the coming weeks. Thanks to all who gave input into the selection of pieces from the show!

The show will run at the Mill Theatre in Dundrum from Wed Nov 30 to Dec 3. Please see our poster for details.
Director: Tom Ronayne, Musical Director: Gerry Connolly Choreographer: Helen McCann



omlette, fried potatoes, daal and my first tempura.

I cooked more than usual this weekend.

There was omlette yesterday. Whew it was spicy! (using up some cute looking chillies). Lots of potatoes. Cube. Fry. Add some other veg: some leek and chilli.  Out from the pan with all. In with the egg. Back in with potato. In with sliced tomato. Finally top with cheese.  Later on cook some pasta Kate liked the omlette, Maeve ate some but not too much and Christy didn't like it.  Fionnuala and James looved it. Yum.

Today fionnuala painting hallway. Daire back from camp and Kate from GAA so warm food needed. Fried potatoes worked. Wash and slice potatoes. Blanch. Fry in oil (and remainder into oven with the sausages. Also cauliflower with cheese and beans for the dislikers of cauliflower.

This evening daal + savoury rice and tempura.

I'd never made tempura before. Slice items. Roll items in seasoned flour (and some oats). Dip in egg. Deep fat fry. Items: mango, apple, courgette, one mushroom, leek, carrot, pasta, melon. An odd collection. Using up some things that needed to be used up. Lovely light coating of batter results. I used quite a small saucepan. Fry things  ~6 at a time. Low heat on smallest ring.

Definately good fun. I still have the oil :) Other random things must be chopped and tempura'd.

At end of session oil was inclined to bubble up and froth over. Over onto the lit gas. Except I didn't let it. Torn between wanting to see an explosion of flames and self+house preservation. I do presume hot frothy veg oil would go *foom* for me quite nicely.

For Daal: chop leeks, fry in pan, add daal (green and orange today), add chilli, add garlic, daal curry spice mix, tomatoes, butter. After a bit add water and then simmer for 30 mins.

lighttpd so easy to set up :)

Working sat night examining test runs and results.

I have script that processes results and spits out some URLs.
It runs in Hudson using ssh plugin.
When on from home the link to URLs (like file:///wherever) don't work.  :-(

So ...
# Google lighttpd install.   http://www.cyberciti.biz/tips/installing-and-configuring-lighttpd-webserver-howto.html 
 
#Get lighttpd src.
mkdir ~/src; cd ~/src;  wget http://lighttpd.net/download/lighttpd-1.4.13.tar.gz
tar -zxvf lighttpd*.gz
cd lighttpd-1.4.13 
 
#Configure build/install. Hmm. Need to configure to install and run from user area. Configure.
echo $HOME
./configure --prefix=$HOME/src/usr --sysconfdir=$HOME/src/etc --datadir=$HOME/src/usr/share --localstatedir=$HOME/src/var
mkdir -p $HOME/src/{usr/share,var} 
 
#Build and Install
make; make install

#Configure lighttpd to serve up test results dir, port 8888, allow dir browsing, log access area.
cp ~/src/lighttpd-1.4.13/openwrt/lighttpd.conf ~/src/etc/lighttpd.conf
vi ../etc/lighttpd.conf

-#                              "mod_accesslog"
+                               "mod_accesslog"

-server.document-root             = "/www/"
+server.document-root             = "/projects/__TEST_RESULT_AREA__/"

-# accesslog.filename          = "/www/logs/access.log"
+accesslog.filename          = "/__HOMEDIR__/src/www/logs/access.log"

-#server.port                = 81
+server.port                = 8888

-#server.dir-listing          = "enable"
+server.dir-listing          = "enable"
  
diff -u ~/src/lighttpd-1.4.13/openwrt/lighttpd.conf ~/src/etc/lighttpd.conf

#Run. 
cat > ~/src/runlighttpd.sh  <<EOT
cd ~/src
./usr/sbin/lighttpd -f etc/lighttpd.conf
EOT
~/src/runlighttpd.sh 
 
# Browse results. happy dance. 

Sunday 11 September 2011

Weekend at Roundwood House, Co. Laois.

Weekend at Roundwood House, Co. Laois.
Callan family get-together.

Loads of books.
Lots of lovely old and a bit wonky door handles.
And a poor old old piano we were allowed to open up and try and help a little.
Needs lots more work.
Keys were fallen out and down and catching on other keys.
Board + leather sandwich + keys stuck back on needed.
Replacing and fixing up the strings looks liek it could be quite hard.
And how does the tuning work?  The pegs don't really look like they turn?

Trip through the Slieve Blooms and visit bog park.
http://www.loughbooraparklands.com/

Trip up the hills and short walk.


Monicknew woods/river look close but we didn't quite get htere:
http://www.coillteoutdoors.ie/index.php?id=54&trail=124&no_cache=1
http://www.coillteoutdoors.ie/index.php?id=54&trail=125&no_cache=1
http://www.coillteoutdoors.ie/index.php?id=54&trail=133&no_cache=1




http://www.roundwoodhouse.com/Recreation.htm#walking
http://maps.google.com/maps/ms?msid=216736632193507650192.0004ac7476fd48c190c44&msa=0&ll=53.078765,-7.555847&spn=0.116938,0.323067


http://www.slievebloom.ie/index.php?page=slieve-bloom-way

Map 1 - Glenbarrow to Capard and Glendinoregan

Map 2 - Capard to Monicknew

Map 3 - Monicknew to Glendine



http://www.irishtrails.ie/trails.aspx?c=Laois