Change SVN working copy format

Ubuntu 8 does not come with an svn client for subversion 1.6.
To downgrade svn to version 1.5, which is available on Ubuntu 8, use the following info

http://subversion.tigris.org/faq.html#working-copy-format-change

Use the script as follows:
usage: change-svn-wc-format.py WC_PATH SVN_VERSION [--verbose] [--force] [--skip-unknown-format]

Remove SVN Directories

To recursively remove svn configuration directories issue the following command:

rm -rf `find . -type d -name .svn`

String Concatenation

A neat little feature I found while searching for info on the ’substring’ function in shell scripting is the ability to concatenate string variables from the beginning and end.

Say you have a path:
MY_STRING=/build/config/ide/myfile.ipr

And you want just the file name, here is how you can get it:
${MY_STRING##*/}

Find file in Jar

Use the jar command to view the contents of a jar or zip archive with the following command:
jar tf archive.jar

Pipe it to grep to narrow to a specific file:
jar tf archive.jar | grep filename.txt

Linux Find and Replace

Use ’sed’ to find and replace in multiple files.

Eg. If you want to replace foo with bar:

sed -i 's*foo*bar*'

  • The ‘-i’ option edits the file in place.
  • ‘*’ can be replaced with any character eg ‘/’
  • The ’s’ stands for substitute.

To find and replace in multiple files use:

find . -name 'pattern' -type f -exec sed -i 's/ugly/beautiful/g' {} \;

Google Mash Ups – Buses

http://maps.mytrans.it/

Cool little tool for plotting bus routes on a Google Map.