Tuesday, November 22, 2016

Samba server on Ubuntu

. Install samba server on ubuntu if not done yet.
    sudo apt-get install samba

. Create an user, howard.
    sudo useradd howard

. Create a samba user, howard, and set the password.
    sudo smbpasswd -a howard

. Configure the shared folder permission info in samba config file.
    sudo vi /etc/samba/smb.conf
    Add following info to the end of smb.conf file
    [src]
    path = /home/howard/src/
    browseable = yes
    read only = no
    writeable = yes
    create mask = 0755
    directory mask = 0755
    valid users = howard

. Restart the samba service and it's now ready!
    sudo service smbd restart


[To connect the samba server from a Mac OS X]
    Go to finder and Cmd+K, enter smb://IPOfUbuntu/src

Monday, November 7, 2016

Sync folders with rsync

Copy everything from srcFolder to dstFolder
     rsync -va srcFolderPath/ dstFolderPath/


Copy everything from srcFolder to dstFolder and delete any files that does not exist in srcFolder

     rsync -va --delete srcFolderPath/ dstFolderPath/

Note: the trailing slash (/) of the srcFolderPath is important. If you omit it, for instance, rsync -va srcFolderPath dstFolderPath/
then a folder named "srcFolderPath" will be created and saved into dstFolderPath.

Check clients which connect to Mac OS X Wi-Fi Internet Sharing

arp -i bridge100 -a bridge100 may be different on your Mac OSX