Saturday, August 23, 2014

Script: create new SVN project, create branches and trunk folders, set permissions


Script for automatically creating a new SVN project, branches / trunk folders and setting file permissions.

Usage: $ ./repoCreate.sh svn-project-name

File (repoCreate.sh) contents:

#!/bin/bash

dirRepo="/svn-repos-location/$1"
dirCheckoutTmp="~/svn-new-project-tmp"

if [ -d "$dirRepo" ]; then
        echo "ERROR: Directory already exists: $dirRepo"
        exit
fi

echo "Creating repository folder"
svnadmin create $dirRepo

echo "Checking out, creating trunk/branches folders and first commit"
if [ -d "$dirCheckoutTmp" ]; then
        echo "Deleting directory $dirCheckoutTmp"
        rm -rf $dirCheckoutTmp
fi
svn co file://$dirRepo $dirCheckoutTmp
cd $dirCheckoutTmp
mkdir trunk
mkdir branches
mkdir tags
svn add *
svn ci -m "init deploy" *
rm -rf $dirCheckoutTmp

echo "Setting additional permissions"
chown -R user:group $dirRepo




Friday, August 22, 2014

Ubuntu 14.04 add custom launcher to menu

Ubuntu 14.04 create custom launcher prerequisites:

$ sudo apt-get install gnome-panel --no-install-recommends

Create executable file for easy reuse

$ cd ~
$ touch launcher-create.sh
$ chmod +x launcher-create.sh

Edit the file launcher-create.sh and set contents:

#!/bin/bash
sudo gnome-desktop-item-edit /usr/share/applications/ --create-new

Anytime you want to create a new launcher, run:

$ ~/launcher-create.sh

After creating the launcher, it will show up in Unity's search result.

Saturday, April 26, 2014

Eclipse SVN change repository url

Subversion repository moved to a new machine. Solution for modifying the repository url.

Go to "Repository Browser" perspective, right click current repository and select "Relocate".

Observation: If the SVN repositories are not displayed on the left side (and instead the projects are displayed) you must select a different view (SVN repositories) for the left panel by using the plus icon (which may be at the bottom of the panel)... Not very intuitive.

Thursday, April 10, 2014

Ubuntu PHAR extract

Install PHAR:

$ pear channel-discover pear.kotowicz.net

$ pear install kotowicz/PharUtil-beta

Extract PHAR contents:

$ phar-extract library.phar output-directory