Monday, December 15, 2008

Enabling file sharing on Mac using SMB

Windows use SMB sharing to access other computers' file shares on the network. To access a MacOSX machine SMB File Sharing needs to be enabled on the MacOSX machine. This guide is for MacOSX 10.5 Leopard but may work for older versions too.

1. Goto System Preferences (Apple->System Preferences)

2. Click on Sharing icon. The following window will come up


3. Check File Sharing on the left-hand pane



4. Click on Options... button on lower right had side of sharing window



5. In the pop-up window enable Share files and folders using SMB then enable the users who you want to allow access to the shares you will create. You will be prompted for the password of each user that you enable. Click on Done.



6. Now its time to specify the folders that need to be shared on the network. Under Shared Folder click on the plus(+) sign and select the folder that you need to share.



7. For each Shared Folder you can specify what type of access each user has on that folder. Click on the folder you want to specify the access restriction you need to enforce and then click on the pull-down menu for the user you want to modify the access to. The options available are Read & Write, Read Only, Write Only(Drop Box), and No Access. Where Write Only(Drop Box) allows that user to drop files into the drop box but not access any of the files in that folder. To create permissions for users not listed click on the plus(+) button below the Users subsection.

Monday, December 8, 2008

MSN Messenger for Mac sucks

I am really disappointed at the feature list for msn messenger for the mac. It lacks the ability to message people when you are appearing offline and there is no video chat funtionality. Microsoft need to come out with live messenger for mac to keep up to par with the windows version. In the meanwhile i'll look for alternative chat clients with better functionality.

Tuesday, December 2, 2008

Login scripts for individual users on MacOSX

I will demonstrate a simple way to create personalized user login scripts on MacOS Leopard. Using “login items” we can run a script with a .command extension but it is slow to launch at login and leaves an ugly terminal window at login. As an alternative MacOS allows Login Hook to attach a script to the login process but one thing it doesn’t do is allow for a different script for each user. To work around this issue with Login Hook, what you can do is create a login script for each user in their respective folders and the main login script will call the appropriate script for the user when they log in.


One issue with this procedure is that the script launches with root privileges so that may not be ideal. This specific example uses the say command for an audio greeting of the user by their name when they log in. There may be more elegant ways of doing this in Applescript perhaps, maybe someone would like to comment on that.


1. Login as an admin user in MacOSX who has access to sudo. The user created at install time should have this functionality by default


2. Open Terminal by going to Machintosh HD->Applications->Utilities->Terminal


3. Choose a place to store the main login script, I created a Startup folder in /Library and created a startup script called startup.sh

sudo mkdir /Library/Startup

sudo vi /Library/Startup/startup.sh

4. Add the following code which checks for the .startup file in the user's home folder and loads that script if it exists otherwise performs a default command

#!/bin/bash

if [ -e $HOME/.startup ]

then

$HOME/.startup

else if [ $# -gt 0 ]

then

/usr/bin/say welcome $1

fi

fi


5. Change the permissions on the script so it can be executed

sudo chmod u+x /Library/Startup/startup.sh


6. Now create the LoginHook to the script. Type the following command in terminal:

sudo defaults write com.apple.loginwindow LoginHook /Library/Startup/startup.sh


7. create .startup file in each users home directory

sudo vi /Users/username/.startup

chmod u+x /Users/username/.startup

Add the following code or whatever you would like to run at login for that user:

#!/bin/bash

/usr/bin/say welcome username