Change user name and group name via ssh

1) Enable root login

sudo passwd root

2) exit, and re-ssh to the computer but login as root

3) usermod -l login-name old-name

  1. move user dir cd /home mv old-name new-name

5) edit /ect/passwd to change the path of the user's home dir 

6) Change groupname

groupmod -n new_group_name old_group_name

7) exit, and re-ssh as the new-name, test if everything works

8) disable root account: 

sudo passwd -dl root





1) Use Synaptic Package Manager to load "mt-daapd"
2) Edit /etc/init.d/mt-daapd to add the "DAEMON_OPT=-m" assignment
3) Create file /etc/avahi/services/daap.service containing





NOTE: If you happen to be tailing syslog when you write the file, you'll see avahi-daemon find it and begin publishing daap.
4) Start the mt-daapd ('/etc/init.d/mt-daapd start')
5) web-browser http://localhost:3689/ to configure Firefly. Let the initial scan run until it has found all your tunes, then create your smart playlist(s).
6) Restart your Roku Soundbridge and select a playlist.



  • Introduction
  • Installation
  • Configuring Netatalk
  • Configuring Avahi
  • Configuring your Mac


There are a number of ways to get Time Machine to backup to a Linux, and while theoretically it is possible to use a Samba share, the best way to do it is to setup Linux (in this case Ubuntu 9.04) to work as a Mac server to OS X. 

This guide will walk you through, step-by-step, to install the open-source implementation of the Apple Filing Protocol (AFP), which is what allows Macs (or in this case other UNIX-like OS) to share services across a network.

This guide uses the Command-line based text editor nano. If you would prefer to use another editor (such as vim) simply replace nano with your chosen editor in the given commands. Alternatively, if you are running the Desktop version of Ubuntu 9.04, it might be easiest to replace nano with gedit, a graphical based text editor.

After you are finished editing each file with nano, you must save your changes with Control+X. You must use the control key, even if you are remotely editing (via ssh or similar service) on a Mac.

It is recommended that before following the setup in the rest of the guide, that you run these commands to ensure that your Ubuntu installation is up-to-date. NOTE: Everything after the ‘#’ is a comment, and does not need to be copied into the Terminal.

sudo apt-get update #Refreshes Ubuntu Repositories
sudo apt-get upgrade #Downloads and installs new updates
sudo apt-get autoclean #Deletes unneeded installation files


Installing AFP on Ubuntu (or any other UNIX-like OS) requires one basic open-source package (plus other prerequisite packages):

  • Netatalk - contains the actual implementation of AFP
  • Avahi – broadcasts server’s presence across LAN to allow OS X to access them

These commands to install the proper packages (requires internet connection):

sudo apt-get install netatalk avahi-daemon

Configuring Netatalk

Once all of the needed packages are installed, you will need to configure Netatalk to work properly. Run:

sudo nano /etc/default/netatalk

Scroll to the bottom of the file and under the “# Set which aemons to run (papd is dependent upon atalkd):” change your configuration to match the following:


These commands will prevent unneeded services from starting at boot, causing your machine to boot much quicker.

Next open afpd.conf,

sudo nano /etc/netatalk/afpd.conf

and append the following line to the end of the file:

- -transall -uamlist, -nosavepassword -advertise_ssh

Finally, you will need to tell Netatalk what to share as a Volume. Open up the AppleVolumes.default file with

sudo nano /etc/netatalk/AppleVolumes.default

Comment out all lines (put a '#' at the beginning of the line) and add this to the end of the file (if the volume you want to share is /media/backup and the username you want to use with Time Machine is gries818):

/media/backup Backup allow:gries818 cnidscheme:dbd options:tm

Additional lines can be added to give access to different folders on the Ubuntu machine.

Restart netatalk with:

sudo /etc/init.d/netatalk restart

Configuring Avahi

Netatalk can be used without any further configuration, but in order to get the server in the "Shared" section in the Finder window, you need to configure Avahi (which is basically an open implementation of Apple's Bonjour service).

First, edit nsswitch.conf with

sudo nano /etc/nsswitch.conf

and add mdns to the end of the line that starts with "hosts:".

Next, will need to create a new file for Avahi so it knows what services to broadcasts to the Macs on your network. 

sudo nano /etc/avahi/services/afpd.service

And copy this xml data into the file:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<name replace-wildcards="yes">%h</name>

This will make your server display itself as a MacPro, but you can make it display as any type of a Mac you want by substituting the model=MacPro with the desired model:

  • iMac
  • MacPro
  • MacBook
  • MacBookPro
  • MacBookAir
  • PowerBook
  • PowerMac
  • Macmini
  • Xserve
  • AirPort

Now, simply restart Avahi to make Finder aware of the new services available on your Ubuntu machine.

sudo service avahi-daemon restart

Configuring your Mac

Finally, to use TimeMachine with your Ubuntu setup you need to override the default TimeMachine settings on your Mac. Open up the Terminal (/Applications/Utilities/ and type:

defaults write TMShowUnsupportedNetworkVolumes 1

Your new Shared Volume will now available in the TimeMachine disk selection. 


If you have any problems with this tutorial be sure to ask... not every setup will yield the same results. Additionally, this should work with any Linux OS, provide you make adjustments for the different package managers (apt is Ubuntu's package manager).

problem: since upgrating to ubuntu 9.04 commit mailer was not working.

here is the solution from:


Setting up

How would you like to receive an e-mail every time a commit is made to a certain subversion repository? No problem. SSH into your server and do the following.

Firstly, change your working directory to the hooks directory of your repository. For example, if my repository is located at /var/svn/myproject I would type the following:

cd /var/svn/myproject/hooks

If you haven't done this already, enable the post-commit hook.

cp post-commit.tmpl post-commit
chmod +x post-commit

Get the script. You can search for it on your local system. For example:


And you might get something like:


If you do, it would normally be the easiest just to copy this file, for example:

cp /usr/share/doc/subversion-1.2.3/tools/hook-scripts/ .

Otherwise, download the script:


If you download the above file, you need to replace all occurrences of @SVN_BINDIR@ with the directory of your subversion tools. First, find this directory. For example, if you type:

whereis svn

You might get:

svn: /usr/bin/svn /usr/share/man/man1/svn.1.gz

In this case, your directory will be /usr/bin. Just run the replace, for example with sed:

sed 's/@SVN_BINDIR@/\/usr\/bin/' >

Now of course just make sure this script is executable:

chmod +x

Now test the script as there is probably like a million things that can go wrong here:

./ /var/svn/myproject 1 

In my case, I got this:

./ use of either `-h' or `--from' is mandatory when sending email using direct SMTP.

At least simple to fix:

./ /var/svn/myproject 1  --from 

Now it works. Well, if you see nothing, it should work. Check your inbox. If you don't receive the mail, maybe you're just being impatient, but if you don't after a day or two, you're not necessarily farked, but good luck in debugging that bastard...

(By the way, in this case with me, I received the mail but the mail headers were stuffed.)

That was with the script I downloaded, if I try the copy that existed on my machine, I got this:

Use of uninitialized value in -d at ./ line 224.

On line 224, we have:

my $tmp_dir = ( -d $ENV{'TEMP'} ? $ENV{'TEMP'} : '/tmp' );

I just replaced this with:

my $tmp_dir = '/tmp';

Now it worked perfectly, no obvious issues.

Anyway, next thing is to trigger this from your post-commit script. Just edit the script with whatever you want, like:

vim post-commit

Then add this line:

$REPOS/hooks/ "$REPOS" "$REV"