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

Solution:

 https://discussions.apple.com/message/16577371#16577371

source: http://www.uluga.ubuntuforums.org/showthread.php?p=7332557

 

Soluition:

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

Code:





%h


_daap._tcp
3689



_rsp._tcp
3689


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.

Source

Contents

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


Introduction

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.

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



Installation

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):

CODE: SELECT ALL
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:

CODE: SELECT ALL
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:

CODE: SELECT ALL
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no



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

Next open afpd.conf,

CODE: SELECT ALL
sudo nano /etc/netatalk/afpd.conf



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

CODE: SELECT ALL
- -transall -uamlist uams_randnum.so,uams_dhx2.so -nosavepassword -advertise_ssh



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

CODE: SELECT ALL
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):

CODE: SELECT ALL
/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:

CODE: SELECT ALL
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

CODE: SELECT ALL
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. 

CODE: SELECT ALL
sudo nano /etc/avahi/services/afpd.service



And copy this xml data into the file:

CODE: SELECT ALL
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=MacPro</txt-record>
</service>
</service-group>



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.

CODE: SELECT ALL
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/Terminal.app) and type:

CODE: SELECT ALL
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1



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

Conclusion

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: http://blog.charlvn.com/2008/02/setting-up-commit-emailpl.html

 

Setting up commit-email.pl

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 commit-email.pl script. You can search for it on your local system. For example:

locate commit-email.pl

And you might get something like:

/usr/share/doc/subversion-1.2.3/tools/hook-scripts/commit-email.pl

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/commit-email.pl .

Otherwise, download the script:

wget http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in

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/' commit-email.pl.in > commit-email.pl

Now of course just make sure this script is executable:

chmod +x commit-email.pl

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

./commit-email.pl /var/svn/myproject 1 

In my case, I got this:

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

At least simple to fix:

./commit-email.pl /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 ./commit-email.pl 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/commit-email.pl "$REPOS" "$REV"