Wednesday, September 16, 2015

List all svn externals

To list all svn externals you can use the following command:
svn propget svn:externals .

And to do it recursively just add -R
svn propget svn:externals -R .

Saturday, April 21, 2012

Installing DynDns (inadyn) as service on Linux (Ubuntu)

Installing DynDns (inadyn) as service on Linux (Ubuntu)

To use DynDns on linux, we firs need the client.

In this artice I'll use INADYN.

To install inadyn execute:
sudo apt-get install inadyn

than we have to create inadyn configuration file:
sudo vim /etc/inadyn.conf
# Basic configuration file for inadyn
#
# /etc/inadyn.conf
update_period_sec 600 # Check for a new IP every 600 seconds
username <yourusername>
password <yourpassword>
dyndns_system dyndns@dyndns.org
alias <yourdomainname>
background

now we are going to create the service by creating:
sudo vim /etc/init.d/inadyn
#!/bin/bash
case "$1" in
    start)
    if [ -f /tmp/inadyn.pid ]; then
        PID=$(cat /tmp/inadyn.pid)
        kill -0 ${PID} &>/dev/null
        if [ $? = 0 ]; then
            echo "Inadyn is already running."
        else
            /usr/sbin/inadyn
            pidof inadyn > /tmp/inadyn.pid
            PID=$(cat /tmp/inadyn.pid)
            kill -0 ${PID} &>/dev/null
            if [ $? = 0 ]; then
                echo "Inadyn started succesfully."
            else
                echo "Error starting Inadyn"
            fi
        fi
    else
        /usr/sbin/inadyn
        pidof inadyn > /tmp/inadyn.pid
        PID=$(cat /tmp/inadyn.pid)
        kill -0 ${PID} &>/dev/null
        if [ $? = 0 ]; then
            echo "Inadyn started succesfully."
        else
            echo "Error starting Inadyn"
        fi
        fi
        ;;
    stop)
    if [ -f /tmp/inadyn.pid ];then
        PID=$(cat /tmp/inadyn.pid)
        kill -0 ${PID} &>/dev/null
        if [ $? = 0 ]; then
            /bin/kill ${PID}
            kill -0 ${PID} &>/dev/null
            if [ $? = 1 ]; then
                echo "Inadyn stopped succesfully."
            else
                echo "Error stopping Inadyn"
            fi
        else
            echo "Inadyn is already stopped."
        fi
    else
        echo "Inadyn is already stopped."
    fi
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
esac
exit 0

let's change the file permission so can be executed:
sudo chmod 0755 /etc/init.d/inadyn

Then we configure inadyn for autostart:
sudo update-rc.d inadyn defaults

Starting the inadyn service:
sudo service inadyn start

And that's it.

Thank you...

References:
http://www.inatech.eu/inadyn/
http://www.linuxquestions.org/questions/linux-software-2/how-do-i-execute-inadyn-automatically-during-boot-541367/#post4518378

Sunday, April 15, 2012

Redmine on Ubuntu 11.10


First let's update the packages list and upgrade (optional).
sudo apt-get update
sudo apt-get upgrade

Now we need to install Apache2 Web Server, Mysql (LAMP):
sudo tasksel install lamp-server
sudo apt-get install libapache2-mod-passenger

Installing the latest Redmine (when I wrote this, it was 1.3.2), this will also install ruby on ubuntu:
sudo add-apt-repository ppa:ondrej/redmine
sudo apt-get update
sudo apt-get install redmine redmine-mysql

Installing rmagick:
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
sudo gem install rails
sudo gem install rmagick

Let's link redmine folder to apache:
sudo ln -s /usr/share/redmine/public /var/www/redmine

We need to tell Passenger to run on "www-data" user:
sudo vim /etc/apache2/mods-available/passenger.conf
PassengerDefaultUser www-data

You'll also need to configure the /var/www/redmine location in /etc/apache2/sites-available/default by adding:
sudo vim /etc/apache2/sites-available/default
<Directory /var/www/redmine>
    RailsBaseURI /redmine
    PassengerResolveSymlinksInDocumentRoot on
</Directory>


Enable passenger:
sudo a2enmod passenger

Restart apache2
sudo service apache2 restart

Know you should be able to access Redmine at: http://server.ip.address/redmine and login as:
user: admin
password: admin

Thank you...

References:
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu
http://www.redmine.org/projects/redmine/wiki/RedmineInstall?version=146
http://superuser.com/questions/163818/how-to-install-rmagick-on-ubuntu-10-04