if the DVD icon in Finder is gone you could use
drutil eject
within a terminal.
Technical tweaks, helpers, contradictions and a lot of blood sweet and tears are inside this blog.
Search This Blog
Showing posts with label Macosx. Show all posts
Showing posts with label Macosx. Show all posts
Monday, February 21, 2011
Thursday, February 4, 2010
Mount network share at startup in MacOSx
I run a Buffalo TeraStation NAS server within my environment. To use it within a unix based machine like my IMac I just need to open a Finder and select the share on the server. That'll do the trick for instant access or manual connect. If you want to have your shares mapped before you logon do the following:
1. Create Script, which mounts your shares (see my sample below)
2. Add the script to the LoginHook
sudo defaults write com.apple.loginwindow LoginHook /path/to/script
(I store my script on MacOSX in /Library/Scripts). More infos on the LoginHook.
Note: If you mount a share keep in mind that mounting the share with root privileges will only allow root to use the share. Because of that I used su $1 -c to run the mount as the current logged in user.
1. Create Script, which mounts your shares (see my sample below)
2. Add the script to the LoginHook
sudo defaults write com.apple.loginwindow LoginHook /path/to/script
(I store my script on MacOSX in /Library/Scripts). More infos on the LoginHook.
Note: If you mount a share keep in mind that mounting the share with root privileges will only allow root to use the share. Because of that I used su $1 -c to run the mount as the current logged in user.
Sample mount script for a NAS server with afp protocol for Mac OSX (if your NAS has no afp just change the mount parameter accordingly):
#!/bin/bash
# Information about the NAS access
username=MY_NAS_USER
password=MY_NAS_PASS
hostname=MY_NAS_HOST
# The $1 is within login scripts the current user, which enters MacOsx
loginuser=$1
# Create a mount dir if necessary
save_mkdir() {
if [ ! -d $1 ];
then
su $loginuser -c "mkdir $1"
fi
}
# Create a mount as the current logged in user
do_mount() {
if /sbin/mount|grep -q $1; then
# echo "Mounted"
/sbin/umount $1
fi
save_mkdir $1
su $loginuser -c "/sbin/mount -t afp afp://$username:$password@$hostname/$2 $1"
}
echo "******************************************************"
echo "*** Unmount all network drives from boshuda"
echo "******************************************************"
/sbin/umount /Volumes/pictures
/sbin/umount /Volumes/music
echo "******************************************************"
echo "*** Mount all network drives from boshuda"
echo "******************************************************"
do_mount /Volumes/pictures pictures
do_mount /Volumes/music my_music
Labels:
Macosx,
Network,
Share,
Snow Leopard,
Startup
Tuesday, February 2, 2010
Min .bashrc
# *****************************************************************************
# bashrc
# *****************************************************************************
SHELL=/bin/bash
PATH=$PATH:$HOME/bin:/usr/local/bin
PS1="\u \w$ "
export EDITOR=vi
export HISTCONTROL=ignoredups
# Cli Colors
export CLICOLOR=1
# use yellow for dirs
export LSCOLORS=dxfxcxdxbxegedabagacad
export LSCOLORS=exfxcxdxbxegedabagacad
# *****************************************************************************
# alias
# *****************************************************************************
alias ..='cd ..'
alias h=history
alias ip='ipconfig getifaddr en0'
alias l='ls -al'
alias lp='ls -p'
alias lt='ls -lt'
alias sys_prefs='open -a System\ Preferences'
Friday, January 29, 2010
Keys I missed on an Apple keyboard
Well to all of you movers to Apple here is a list of the most missed keys on my Apple Keyboard:
Tilde : ~ ALT-N
Pipe : | ALT-7
curly bracket : {} ALT-8/9
square bracket: [] ALT-5/6
End of line : CMD-right
Start of line: CMD-left
Begin of doc : CMD-UP
End of doc : CMD-DOWN
Jump word : ALT-left/right
Tilde : ~ ALT-N
Pipe : | ALT-7
curly bracket : {} ALT-8/9
square bracket: [] ALT-5/6
End of line : CMD-right
Start of line: CMD-left
Begin of doc : CMD-UP
End of doc : CMD-DOWN
Jump word : ALT-left/right
Subscribe to:
Posts (Atom)