ubuntu 11.10 server as a time machine
i have been working on this for quite some time. i finally found a blog that outlined it – here is the quick and dirty version. the blog is by chris lyons.
i currently have this set up and running in a local business. it manages 6 different mac’s (1x os x 10.5.8, 5x os x 10.6.8) and 2 windows xp sp3 virtual machines. so far the system has been in place for 8 months without issue. i will be migrating all mac’s to os x 10.7.8 in the coming months as well as migrating the server to a minimalist version of ubuntu 12.04.
# install the following packages
sudo apt-get install libdb4.7-dev libgcrypt11 avahi-daemon tcpd netatalk
# in order to build packages from the source, do the following
sudo apt-get install build-essential checkinstall
sudo apt-get install cvs subversion git-core mercurial
sudo chown $USER /usr/local/src
sudo chmod u+rwx /usr/local/src
# next, download the netatalk software
wget http://iweb.dl.sourceforge.net/project/netatalk/netatalk/2.2.2/netatalk-2.2.2.tar.bz2
# untar and build netatalk from source
tar xvjf netatalk-2.2.2.tar.bz2
cd netatalk-2.2.2
./configure --enable-debian
make
sudo make install
# edit the afpd.conf
sudo nano /usr/local/etc/netatalk/afpd.conf
# add the following to the bottom of the file
- -tcp -noddp -uamlist uams_randnum.so,uams_dhx.so,uams_dhx2_passwd.so -nosavepassword
# edit the applevolumes file to add shares to the afp server
sudo nano /usr/local/etc/netatalk/AppleVolumes.default
# add the following to the bottom – this allows users access to their home directories – change as neded
~ "Home" allow:UserName cnidscheme:dbd options:usedots,upriv
# you can add a variety of folders to the applevolumes – below is the syntax
/media/files "Files" allow:UserName cnidscheme:dbd options:usedots,upriv
/media/tm1 "Time Machine 1" allow:UserName cnidscheme:dbd options:usedots,upriv,tm
/media/tm2 "Time Machine 2" allow:UserName cnidscheme:dbd options:usedots,upriv,tm
# create the xml file that will control avahi
sudo nano /etc/avahi/services/afpd.service
# add this to the newly created /etc/avahi/services/afpd.service
<?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=Xserve</txtrecord>
</service>
</service-group>
# restart netatalk and avahi
sudo service netatalk restart
sudo service avahi restart
# go to each mac on the network, open a terminal, and enter the following
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
that should be it – now the mac users should be able to go to the Go -> Connect to server menu and connect to the afp using username@ip.of.the.server
right click in ubuntu on the powerbook g4
wow. i never thought i would have to google how to right click using ubuntu on the powerbook.
apples powerbook touchpad has no middle or right mouse button – where this isnt a big problem using os x, in ubuntu it can generally be an issue.
after much googling i finally found that by default the mouse middle-click was f11 and the mouse right-click was f12. now these are mapped and can be changed by editing the /etc/sysctl.conf and mapping dev/mac_hid/mouse_button2_keycode and dev/mac_hid/mouse_button3_keycode to their corresponding key scan codes.
you can get the key scan codes by running sudo showkey then pressing the key or keys for which the scan codes are to be printed. to exit the key mapping software, press ctrl d.
mac keyboard shortcuts
| C | boot from cd or dvd |
| D | force the boot device to be the internal hard drive |
| T | start in firewire target disk mode – essentially turns your mac into a wicked expensive external hd |
| X | force boot into mac os x (older macs that dual-boot into os 9 and x) |
| N | boot from network drive |
| shift | hold after power-up to boot into safe mode, hold after login to prevent startup items from opening |
| mouse button | eject cd before booting normally |
| command-S | boot into single user mode; type exit when done |
| command-option-O-F | boot into the open firmware prompt |
| command-option-P-R | reset PRAM |
| command-option-V | verbose boot | command-option-shift-delete | bypass internal hard drive and boot from external drive or cd |
| option | shows the startup manager for all bootable drives |
| command-. | when startup disk chooser is active, open the cd tray |
reset mac os x password
there are tons of guides out there on this topic. this is just here so i can get to it faster.
reset 10.5 leopard & 10.6 snow leopard password
- power on or restart your mac.
- at the grey screen hold down
command+son your keyboard to enter single-user mode - it’s a good idea because it checks the consistency of the hard disk before moving on. at the prompt, type
fsck –fyand press enter. wait for the checks to complete before going to the next step. - type
mount -uw /and press enter - type
launchctl load /system/library/launchdaemons/com.apple.directoryservices.plistand press enter. - type
dscl . -passwd /users/username passwordand replace “username” with one of the users displayed in the previous step. replace “password” with a new password of your choice. press enter. - reboot
reset 10.4 tiger password
- power on or restart your mac
- at the grey screen hold down
command+son your keyboard to enter single-user mode - type
sh /etc/rcand press enter - type
passwd usernameand replace “username” with the short name of the user account for which you’d like to reset the password - type your desired password and press enter
- reboot
humble indie bundle #2
an awesome collection of games, pick your price! there is only 4 days left for this deal.
i downloaded all 5 games for linux, mac and windows. i paid $20 for the 5 games. another nice thing was seeing that metasploit was the 2nd largest contributor.
- drm free
- ay what you want
- helps charity
- mac, windows, and linux
the games included are:
braid
cortex command
machinarium
osmos
revenge of the titans
save a file in vi as root
way to often i start editing a file without using sudo. here is a fix for that. when you go to save the file, do the following:
:w !sudo tee %
block google analytics
add this to your hosts file to block google analytics
127.0.0.1 www.google-analytics.com google-analytics.com ssl.google-analytics.com analytics.google.com googleanalytics.com
divvy for the mac
a real slick program for window management in the mac





