For a few weeks now I have been seeing weird network behavior, but only at home and only on my Macs. Both Macs connect to a WRT150N wireless router running DD-WRT VPN firmware. As described in an earlier post (its early and I am too lazy to link) I have set up a fake TimeCapsule on an Ubuntu box sitting on my home network for net-based backups. Everything was working fine until a few weeks ago...
Suddenly when attempting to move large amounts of data across the network, such as when backing up, my network connection would drop. My connection to the network remained, but throughput went to zero on the local network. Connectivity was completely lost. Many times I couldn't even reconnect to the wireless network to reestablish connectivity. However, if I used a hard-wired connection I didn't see the same problem. Ultimately this corrupted my TimeCapsule data twice in 2 weeks.
After some frantic Googling I found somewhere which indicated that the problem may have to do with auto channel switching in 802.11N networks. So last night I configured my wireless network to choose a specific channel (8, FWIW) instead of allowing it to automatically choose the best channel. My network problems appear to have now been resolved, no more loss of connectivity over night or this morning. I created a local backup on a USB disk overnight and I am now recreating my online backup to the Ubuntu TimeCapsule as I write.
This seems to be an unacknowledged bug in most recent versions of MacOS Snow Leopard. Apple, I hope you're listening.
Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts
Tuesday, October 27, 2009
Saturday, July 11, 2009
Google Apps, Mail.app and the iPhone
I've started consolidating my domains' mail and calendaring services under Google Apps. Besides being free for the standard edition, Google provides many of the same services I was using at my previous host, LuxSci, plus group calendaring, docs, etc. However, the support of labels in Gmail is what has really intrigued me.
I've been an IMAP user for years. I'm extremely organized with my email, using a large number of filters on MacOS X's Mail.app to filter email into the right folder for organization. Unfortunately, when I got my iPhone last summer, I began to realize this strategy had its problems. Namely, if Mail.app is downloading and filtering email to folders other than the Inbox, I would miss them on my iPhone, due to its failure to synchronize the entire IMAP folder structure. To handle this, I would disable mail checking from my Mac when I was away from it, allowing all mail to flow to my inbox where I could check it on my iPhone. Unfortunately, it means the hundreds of emails I receive daily from mailing lists were causing me to check email incessantly, often to be dissapointed to only find mailing list messages which could wait to be reviewed later. There had to be a better way.
My goal was to have mailing list email automatically filtered to the appropriate folder, skipping the inbox and the related notification(s) while allowing friends and family mail to hit my inbox where I was guaranteed to see it in a timely manner. This would require strong filtering on the server, which GMail provides (sort of... more on this in a moment). I also want to ensure that seen friends and family mail is filtered into the appropriate mailbox as well, requiring a filter that runs occassionally to move read mail to its organized spot in my mail hierarchy. Unfortunately, this is not supported by GMail.
What's a geek to do? While researching the use of labels for GMail I realized that I could have inbound email skip the inbox for mailing lists (yay!) and I could label friends and family mail with the appropriate label, i.e. [Gmail]/Friends, while retaining the default Inbox label as well. Mail.app treats Gmail labels as IMAP folders, therefore, mail labeled with Inbox and [Gmail]/Friends will appear in both my Inbox and my friends folder at the same time! More importantly, if I read the mail in either folder, it is automatically marked as read in both folders with a slight lag-time between IMAP folder synchronizations. But the best part is that if I delete the mail from Inbox, it only removes the Inbox label, effectively "archiving" the mail in my friends folder. Suh-weet! So how does this work in practice?
Let's say an email from a friend arrives and is placed in the inbox and friends folder. If I am using my iPhone, I receive a notification and read the email. I can delete the email from the inbox, removing the label and ensuring that it is archived in the Friends mailbox. If I am using Mail.app, I'll probably first notice the email in my Friends folder and read it there. In either case, it is marked as read and won't show in the unread count in either folder. This is almost ideal, except that when I am using Mail.app the email shows up in both mailboxes, a less than stellar behavior, but one I can deal with. Also, if I read the email in my Friends folder, a copy of the read email still remains in the Inbox where I have to manually delete it. I may handle this with a filter in Mail.app to clean up such occurrences in the future, but for now it doesn't seem to be a big issue since the vast majority of my email is from mailing lists.
The biggest problem I have so far is with Gmail's filtering. It is teh suck. I need a few abilities that it doesn't support:
I've been an IMAP user for years. I'm extremely organized with my email, using a large number of filters on MacOS X's Mail.app to filter email into the right folder for organization. Unfortunately, when I got my iPhone last summer, I began to realize this strategy had its problems. Namely, if Mail.app is downloading and filtering email to folders other than the Inbox, I would miss them on my iPhone, due to its failure to synchronize the entire IMAP folder structure. To handle this, I would disable mail checking from my Mac when I was away from it, allowing all mail to flow to my inbox where I could check it on my iPhone. Unfortunately, it means the hundreds of emails I receive daily from mailing lists were causing me to check email incessantly, often to be dissapointed to only find mailing list messages which could wait to be reviewed later. There had to be a better way.
My goal was to have mailing list email automatically filtered to the appropriate folder, skipping the inbox and the related notification(s) while allowing friends and family mail to hit my inbox where I was guaranteed to see it in a timely manner. This would require strong filtering on the server, which GMail provides (sort of... more on this in a moment). I also want to ensure that seen friends and family mail is filtered into the appropriate mailbox as well, requiring a filter that runs occassionally to move read mail to its organized spot in my mail hierarchy. Unfortunately, this is not supported by GMail.
What's a geek to do? While researching the use of labels for GMail I realized that I could have inbound email skip the inbox for mailing lists (yay!) and I could label friends and family mail with the appropriate label, i.e. [Gmail]/Friends, while retaining the default Inbox label as well. Mail.app treats Gmail labels as IMAP folders, therefore, mail labeled with Inbox and [Gmail]/Friends will appear in both my Inbox and my friends folder at the same time! More importantly, if I read the mail in either folder, it is automatically marked as read in both folders with a slight lag-time between IMAP folder synchronizations. But the best part is that if I delete the mail from Inbox, it only removes the Inbox label, effectively "archiving" the mail in my friends folder. Suh-weet! So how does this work in practice?
Let's say an email from a friend arrives and is placed in the inbox and friends folder. If I am using my iPhone, I receive a notification and read the email. I can delete the email from the inbox, removing the label and ensuring that it is archived in the Friends mailbox. If I am using Mail.app, I'll probably first notice the email in my Friends folder and read it there. In either case, it is marked as read and won't show in the unread count in either folder. This is almost ideal, except that when I am using Mail.app the email shows up in both mailboxes, a less than stellar behavior, but one I can deal with. Also, if I read the email in my Friends folder, a copy of the read email still remains in the Inbox where I have to manually delete it. I may handle this with a filter in Mail.app to clean up such occurrences in the future, but for now it doesn't seem to be a big issue since the vast majority of my email is from mailing lists.
The biggest problem I have so far is with Gmail's filtering. It is teh suck. I need a few abilities that it doesn't support:
- Filter ordering and a "stop processing rules" function on filter actions. I need mailing list filters to run first and then friends, family and other filters. Too many people are friends and regular mailing list posters and I don't want to have mailing list mail show up in my inbox, the appropriate mailing list and my friends mailbox. For now, all friends filters must also contain a filter which doesn't match mail sent to mailing lists.
- Filtering based on contact groups. Instead of writing a filter to use many different email addresses, all of which get pushed to the same folder, I should be able to filter based on the group a contact belongs to instead. This will make filter management a LOT easier.
Sunday, February 22, 2009
Ubuntu Time Capsule Update
I finally did a disaster recovery using my Ubuntu Time Capsule replacement. It took about 5 hours to recover a 160GB drive (95% full) over my home network. Started right up and worked like I had left off just a few hours before!
Here's the set up to use:
Start up from the MacOS X disk and open the Terminal from the Utilities menu. Type the following:
cd /Volumes
mkdir ./YOURDIRNAMEHERE
mount_afp -i afp://ip_address_of_ubuntu_box/VolumeName /Volumes/YOURDIRNAMEHERE
ls -al ./YOURDIRNAMEHERE
If you find the disk image volume in the listing, you're all set. Exit the terminal and using the Utilities menu you can select Restore from Backup Disk.
Sweet.
Here's the set up to use:
Start up from the MacOS X disk and open the Terminal from the Utilities menu. Type the following:
cd /Volumes
mkdir ./YOURDIRNAMEHERE
mount_afp -i afp://ip_address_of_ubuntu_box/VolumeName /Volumes/YOURDIRNAMEHERE
ls -al ./YOURDIRNAMEHERE
If you find the disk image volume in the listing, you're all set. Exit the terminal and using the Utilities menu you can select Restore from Backup Disk.
Sweet.
Sunday, December 21, 2008
Geeking Out - Setting Up an Ubuntu Server
I've been working on this project for a few weeks now and its finally coming to completion, so I thought I'd document it here so others can save some of the time and hassles I have had in getting to this point.
When I bought a new MacBook for myself, I convinced Steph to ditch her P.O.S. Windows XP machine and take my old MacBook. We now needed a few thing:
First, I replaced the hard drve with an unused 160GB SATA drive I had sitting around. After burning a CD from an ISO of Ubuntu 8.10 Server (Intrepid Ibex), I installed the server and got it up and running on my home network with a static IP address. The server is called "papaya". The initial install included an ssh daemon for remote access so I could work away from the console. Eventually the box will be headless, but for now its connected to my home office KVM.
Next, I configured ufw (Uncomplicated Firewall) to start locking down services. First, set the firewall into the "default deny" mode (a.k.a. whitelisting of approved inbound connections):
sudo ufw default deny
And then I added a rule to allow inbound ssh from the local network:
sudo ufw allow proto tcp from 192.168.5.0/24 to 192.168.5.2 port 22
Next I installed netatalk to support AppleTalk, allowing me to connect my MacOS X systems to papaya's shared disks. I started with directions from here and here, but I found they didn't work exactly as presented, and I needed some tuning to make it work. (See the referenced links for more details on all of these steps, I just distilled this down to the most important info.)
First, install netatalk with encryption support (required by MacOS X):
sudo aptitude update
mkdir -p /tmp/src/netatalk
cd /tmp/src/netatalk
sudo aptitude install devscripts cracklib2-dev dpkg-dev libssl-dev
apt-get source netatalk
sudo apt-get build-dep netatalk
cd netatalk-2.0.3
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -us -uc
sudo debi
echo "netatalk hold" | sudo dpkg --set-selections
Note the last line, it places a hold on any updates to netatalk when running updates on the Ubuntu server, this is necessary to prevent updates from breaking the installed version. Next I configured netatalk by editing a few files. First, /etc/default/netatalk was modified with the following configuration:
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
Next, edit /etc/netatalk/afpd.conf by adding the following line to the end of the file:
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh
Now, configure your shared volumes in /etc/netatalk/AppleVolumes.default by adding the following lines to the end of the file (make sure its one line!):
/media/TimeMachine TimeMachine allow:username1,username2 cnidscheme:cdb options:usedots,upriv
This mounts a shared volume named TimeMachine located at /media/TimeMachine (your mount point may vary, this is an external 1TB USB drive at the moment). List the specific users who should be able to login to the share with their credentials. The remaining options have to do with dealing with invisible files/folders which are used by MacOS X. I actually created a handful of shares, each of them with different functions (TimeMachine, generic file share, etc.).
Now we restart netatalk:
sudo /etc/init.d/netatalk restart
Unfortunately, this share is not publicized to the local network, which I wanted for ease of use. So I set up Avahi, a daemon for Apple's Bonjour zero-configuration service:
sudo apt-get install avahi-daemon
sudo apt-get install libnss-mdns
Edit /etc/nsswitch.conf to add the mdns service to the end of the line beginning with hosts. In the end the line should look like:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
Next, configure Avahi to publish the service. Create a file with the name /etc/avahi/services/afpd.service containing the following XML:
<?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</txt-record>
</service>
</service-group>
Note that this sets up Avahi on port 548 and tells Avahi to publish the device as an XServe, which will make papaya appear as an XServe icon on any Macs connected to the network. Open port 548 to listen for inbound connections:
sudo ufw allow proto tcp from 192.168.5.0/24 to 192.168.5.2 port 548
Restart Avahi to publish the servers:
sudo /etc/init.d/avahi-daemon restart
Woohoo, now I have the server publishing its shares to the network which are seen by my Macs, as seen below.

Now we need to configure the Mac to be able to use papaya as a TimeCapsule without paying for Apple's hardware. Drop to a command line and run the following (on your Mac, not Ubuntu!):
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Mount any of the remote volumes from the Mac and use the TimeMachine preferences to select the remote system for backups. TimeMachine will actually create a disk image on the remote system and utilize that image for its backup volume. Or, in my case, maybe not! But we can easily fix that. Use MacOS X Disk Utility to create a new disk image as a "sparsebundle disk image". The naming is very specific and in the format machine_name_MAC_ADDRESS.sparsebundle. For instance, if your machine name is joeyjr and the MAC address of the primary interface (en0) is 00:13:24:1f:12:10 then the name of the disk image should be:
joeyjr_0013241f1210.sparsebundle

Note that the MAC address separators have been removed. How do you find the MAC address of the primary adapter? Drop to a command line and execute the command ifconfig, it should return something like:
lo0: flags=8049 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
gif0: flags=8010 mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863 mtu 1500
inet6 fe80::223:32ff:febf:cd2%en0 prefixlen 64 scopeid 0x4
inet 192.168.5.114 netmask 0xffffff00 broadcast 192.168.5.255
ether 00:23:32:bf:0c:d2
media: autoselect (100baseTX) status: active
supported media: none autoselect 10baseT/UTP 10baseT/UTP 10baseT/UTP 10baseT/UTP 100baseTX 100baseTX 100baseTX 100baseTX 1000baseT 1000baseT 1000baseT
en1: flags=8863 mtu 1500
inet6 fe80::223:6cff:fe7f:5cd%en1 prefixlen 64 scopeid 0x5
inet 192.168.5.3 netmask 0xffffff00 broadcast 192.168.5.255
ether 00:23:6c:7f:05:cd
media: autoselect status: active
supported media: autoselect
vmnet8: flags=8863 mtu 1500
inet 192.168.94.1 netmask 0xffffff00 broadcast 192.168.94.255
ether 00:50:56:c0:00:08
vmnet1: flags=8863 mtu 1500
inet 192.168.200.1 netmask 0xffffff00 broadcast 192.168.200.255
ether 00:50:56:c0:00:01
The lines after en0 refer to the primary adapter, in this case the ethernet adapter, and the MAC address is found on the line in bold.
Create a sufficiently large image (i.e. 500GB) (note: this image will only take a few MB until it is filled, so this can be done on a pretty full disk) and move it to the root of the share you wish to use for TimeMachine.
Mount the TimeMachine share from above. Open the System Preferences, choose the share as your TimeMachine volume and let it go to work. If you did everything correctly, bacups should begin. My 160GB backup took at least 8 hours, if not longer.
Now backups are great, but they only work for me if you can restore from them in a crisis. How do I define a crisis? Not restoring a file that has been accidentially deleted by using the TimeMachine application, that should work as long as I have the volume mounted. How about Installing MacOS on a blank drive and having the MacOS installer pull all of the data from your networked backup?
In theory, everything should work as follows. I have not done a full disaster recovery yet (though I will before I depend on this as my only backup solution) so take all of this with a large grain of NaCl. Boot from the install CD and start the terminal from the Utilities menu. In the terminal, mount your afp file share:
mkdir /Volumes/timemachine
mount_afp afp://username:password@papaya/TimeMachine /Volumes/timemachine
If the disk is mounted you should be able to find your .sparsebundle in the directory /Volumes/timemachine. Exit the terminal and now open the Restore from Backup utility. The restore utility will find the remotely mounted TimeMachine volume and allow you to restore from that point.
OK, we now know we can back up and restore from the backup. That's all good news. Let's get some printers set up. I have 2 HP printers, a HP LaserJet 1100 which runs on a paralell port, and a HP OfficeJet 5510 All-In-One, running from the USB port. First, ensure hp-lip and cups are installed:
sudo apt-get install hplip
sudo apt-get install cups
Run the hp-setup command to set up your printers (follow the prompts):
sudo hp-setup
Configure cups to listen on port 631 for remote printing and configuration by editing /etc/cups/cupsd.conf
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
And configure cups to allow remote administration at http://papaya:631/:
<Location />
Allow all
Allow all
# Allow shared printing and remote administration...
Order allow,deny
Allow all
</Location>
<Location /admin>
AuthType Default
Require user @SYSTEM
Allow all
# Allow remote administration...
Order allow,deny
Allow all
</Location>
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Allow all
# Allow remote access to the configuration files...
Order allow,deny
Allow all
</Location>
See http://ubuntuforums.org/showthread.php?t=736489 for more information on configuring cups. I'm not perfectly happy with this yet, I believe it can be locked down further, but its good for now.
Now, open the firewall to allow access on port 631:
sudo ufw allow proto tcp from 192.168.5.0/24 to 192.168.5.2 port 631
Restart cups:
sudo /etc/init.d/cupsys restart
Now I browse to http://papaya:631/ to manage configured printers. With the printer URLs in hand I can add remote printers to my MacOS X machines through the Printers preference pane. Printing on the LaserJet is a bit wonky at times, but printing to the OfficeJet is perfect. I still need to set up remote scanning, but that's a project for another day.
The VPN is still a work in progress. I'll post details on setting up OpenVPN once I have had chance to configure and test it completely.
(All the info posted herein is for informational purposes only. Use this at your own risk as I will provide no support.)
When I bought a new MacBook for myself, I convinced Steph to ditch her P.O.S. Windows XP machine and take my old MacBook. We now needed a few thing:
- Home file server for sharing documents, photos, etc
- Automated back up system (TimeMachine would be ideal, but I didn't want to purchase a TimeCapsule for the network based backups. I'm cheap!)
- Shared printing (again, I'm cheap, I don't want to buy a new printer and my existing printers don't support networked printing)
- Home-based VPN to allow me access to the home network when on the road
First, I replaced the hard drve with an unused 160GB SATA drive I had sitting around. After burning a CD from an ISO of Ubuntu 8.10 Server (Intrepid Ibex), I installed the server and got it up and running on my home network with a static IP address. The server is called "papaya". The initial install included an ssh daemon for remote access so I could work away from the console. Eventually the box will be headless, but for now its connected to my home office KVM.
Next, I configured ufw (Uncomplicated Firewall) to start locking down services. First, set the firewall into the "default deny" mode (a.k.a. whitelisting of approved inbound connections):
sudo ufw default deny
And then I added a rule to allow inbound ssh from the local network:
sudo ufw allow proto tcp from 192.168.5.0/24 to 192.168.5.2 port 22
Next I installed netatalk to support AppleTalk, allowing me to connect my MacOS X systems to papaya's shared disks. I started with directions from here and here, but I found they didn't work exactly as presented, and I needed some tuning to make it work. (See the referenced links for more details on all of these steps, I just distilled this down to the most important info.)
First, install netatalk with encryption support (required by MacOS X):
sudo aptitude update
mkdir -p /tmp/src/netatalk
cd /tmp/src/netatalk
sudo aptitude install devscripts cracklib2-dev dpkg-dev libssl-dev
apt-get source netatalk
sudo apt-get build-dep netatalk
cd netatalk-2.0.3
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -us -uc
sudo debi
echo "netatalk hold" | sudo dpkg --set-selections
Note the last line, it places a hold on any updates to netatalk when running updates on the Ubuntu server, this is necessary to prevent updates from breaking the installed version. Next I configured netatalk by editing a few files. First, /etc/default/netatalk was modified with the following configuration:
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
Next, edit /etc/netatalk/afpd.conf by adding the following line to the end of the file:
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh
Now, configure your shared volumes in /etc/netatalk/AppleVolumes.default by adding the following lines to the end of the file (make sure its one line!):
/media/TimeMachine TimeMachine allow:username1,username2 cnidscheme:cdb options:usedots,upriv
This mounts a shared volume named TimeMachine located at /media/TimeMachine (your mount point may vary, this is an external 1TB USB drive at the moment). List the specific users who should be able to login to the share with their credentials. The remaining options have to do with dealing with invisible files/folders which are used by MacOS X. I actually created a handful of shares, each of them with different functions (TimeMachine, generic file share, etc.).
Now we restart netatalk:
sudo /etc/init.d/netatalk restart
Unfortunately, this share is not publicized to the local network, which I wanted for ease of use. So I set up Avahi, a daemon for Apple's Bonjour zero-configuration service:
sudo apt-get install avahi-daemon
sudo apt-get install libnss-mdns
Edit /etc/nsswitch.conf to add the mdns service to the end of the line beginning with hosts. In the end the line should look like:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
Next, configure Avahi to publish the service. Create a file with the name /etc/avahi/services/afpd.service containing the following XML:
<?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</txt-record>
</service>
</service-group>
Note that this sets up Avahi on port 548 and tells Avahi to publish the device as an XServe, which will make papaya appear as an XServe icon on any Macs connected to the network. Open port 548 to listen for inbound connections:
sudo ufw allow proto tcp from 192.168.5.0/24 to 192.168.5.2 port 548
Restart Avahi to publish the servers:
sudo /etc/init.d/avahi-daemon restart
Woohoo, now I have the server publishing its shares to the network which are seen by my Macs, as seen below.

Now we need to configure the Mac to be able to use papaya as a TimeCapsule without paying for Apple's hardware. Drop to a command line and run the following (on your Mac, not Ubuntu!):
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Mount any of the remote volumes from the Mac and use the TimeMachine preferences to select the remote system for backups. TimeMachine will actually create a disk image on the remote system and utilize that image for its backup volume. Or, in my case, maybe not! But we can easily fix that. Use MacOS X Disk Utility to create a new disk image as a "sparsebundle disk image". The naming is very specific and in the format machine_name_MAC_ADDRESS.sparsebundle. For instance, if your machine name is joeyjr and the MAC address of the primary interface (en0) is 00:13:24:1f:12:10 then the name of the disk image should be:
joeyjr_0013241f1210.sparsebundle

Note that the MAC address separators have been removed. How do you find the MAC address of the primary adapter? Drop to a command line and execute the command ifconfig, it should return something like:
lo0: flags=8049
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
gif0: flags=8010
stf0: flags=0<> mtu 1280
en0: flags=8863
inet6 fe80::223:32ff:febf:cd2%en0 prefixlen 64 scopeid 0x4
inet 192.168.5.114 netmask 0xffffff00 broadcast 192.168.5.255
ether 00:23:32:bf:0c:d2
media: autoselect (100baseTX
supported media: none autoselect 10baseT/UTP
en1: flags=8863
inet6 fe80::223:6cff:fe7f:5cd%en1 prefixlen 64 scopeid 0x5
inet 192.168.5.3 netmask 0xffffff00 broadcast 192.168.5.255
ether 00:23:6c:7f:05:cd
media: autoselect status: active
supported media: autoselect
vmnet8: flags=8863
inet 192.168.94.1 netmask 0xffffff00 broadcast 192.168.94.255
ether 00:50:56:c0:00:08
vmnet1: flags=8863
inet 192.168.200.1 netmask 0xffffff00 broadcast 192.168.200.255
ether 00:50:56:c0:00:01
The lines after en0 refer to the primary adapter, in this case the ethernet adapter, and the MAC address is found on the line in bold.
Create a sufficiently large image (i.e. 500GB) (note: this image will only take a few MB until it is filled, so this can be done on a pretty full disk) and move it to the root of the share you wish to use for TimeMachine.
Mount the TimeMachine share from above. Open the System Preferences, choose the share as your TimeMachine volume and let it go to work. If you did everything correctly, bacups should begin. My 160GB backup took at least 8 hours, if not longer.
Now backups are great, but they only work for me if you can restore from them in a crisis. How do I define a crisis? Not restoring a file that has been accidentially deleted by using the TimeMachine application, that should work as long as I have the volume mounted. How about Installing MacOS on a blank drive and having the MacOS installer pull all of the data from your networked backup?
In theory, everything should work as follows. I have not done a full disaster recovery yet (though I will before I depend on this as my only backup solution) so take all of this with a large grain of NaCl. Boot from the install CD and start the terminal from the Utilities menu. In the terminal, mount your afp file share:
mkdir /Volumes/timemachine
mount_afp afp://username:password@papaya/TimeMachine /Volumes/timemachine
If the disk is mounted you should be able to find your .sparsebundle in the directory /Volumes/timemachine. Exit the terminal and now open the Restore from Backup utility. The restore utility will find the remotely mounted TimeMachine volume and allow you to restore from that point.
OK, we now know we can back up and restore from the backup. That's all good news. Let's get some printers set up. I have 2 HP printers, a HP LaserJet 1100 which runs on a paralell port, and a HP OfficeJet 5510 All-In-One, running from the USB port. First, ensure hp-lip and cups are installed:
sudo apt-get install hplip
sudo apt-get install cups
Run the hp-setup command to set up your printers (follow the prompts):
sudo hp-setup
Configure cups to listen on port 631 for remote printing and configuration by editing /etc/cups/cupsd.conf
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
And configure cups to allow remote administration at http://papaya:631/:
Allow all
Allow all
# Allow shared printing and remote administration...
Order allow,deny
Allow all
</Location>
<Location /admin>
AuthType Default
Require user @SYSTEM
Allow all
# Allow remote administration...
Order allow,deny
Allow all
</Location>
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Allow all
# Allow remote access to the configuration files...
Order allow,deny
Allow all
</Location>
See http://ubuntuforums.org/showthread.php?t=736489 for more information on configuring cups. I'm not perfectly happy with this yet, I believe it can be locked down further, but its good for now.
Now, open the firewall to allow access on port 631:
sudo ufw allow proto tcp from 192.168.5.0/24 to 192.168.5.2 port 631
Restart cups:
sudo /etc/init.d/cupsys restart
Now I browse to http://papaya:631/ to manage configured printers. With the printer URLs in hand I can add remote printers to my MacOS X machines through the Printers preference pane. Printing on the LaserJet is a bit wonky at times, but printing to the OfficeJet is perfect. I still need to set up remote scanning, but that's a project for another day.
The VPN is still a work in progress. I'll post details on setting up OpenVPN once I have had chance to configure and test it completely.
(All the info posted herein is for informational purposes only. Use this at your own risk as I will provide no support.)
Sunday, November 11, 2007
Leopard & Stacks
Stacks are a cool new feature of Leopard when used in the dock. However, the implementation leaves something to be desired, since it isn't clear which directory the stacks belong to. Until now! These neat little icons serve as an overlay to give a container like appearance in the dock, making the stacks more visually appealing and a bit more intuitive.
Saturday, July 14, 2007
Back to normal...
My digital life is back to normal. I did lose most of my vacation photos, but I found some advice on various sites which indicates that I may be able to recover some of my data by fscking the disk... This is something to work on in my spare time.
My west coast trip report is forthcoming... I recovered the vast majority of the writing I have already done for the blog post, now I just have to finish writing. I hope to do that over the next few days...
My west coast trip report is forthcoming... I recovered the vast majority of the writing I have already done for the blog post, now I just have to finish writing. I hope to do that over the next few days...
Thursday, July 12, 2007
Backing up is important
I have for many years maintained regular backups of my systems. Minimally I keep a copy of my user directory on either a network share (which ended with the demise of my G4 tower) or USB based hard disks.
Before going to the west coast I backed up my MacBook. I always make a backup before a road trip.
When we came home, laden with gigs of pictures, I made a backup. It filled the drive and never completed. I finally got around to making a backup yesterday.
"Hey, what's making that funny noise?"
Oh. Crap. That funny noise is coming from the hard drive in my MacBook. Everything got very slow on my Mac and it finally hung. I had to reboot.
No dice. The drive is dead. Nothing has been able to rescue it (Disk First Aid, Disk Warrior). "Invalid sibling link" errors. Note the part where it says "This is an error you definitely don't want. It indicates that parts of your directory, and therefore some of your files and folders, are inaccessible." Yay!
So, the question now is, how far did my backup get? Did I really lose 800+ pictures from 10 days on the road?
Sadly, the answer looks to be yes. Everything that hasn't been uploaded somewhere or possibly saved in an email looks to be lost. Once I replace the drive and get my digital life back in order I will explore other options to retrieve my data. So far it looks like I may have only lost those photos, other directories containing important data that has changed recently (remember the older, incomplete backup). Thankfully I didn't lose my 7000+ photos that happened before the road trip or hundreds of albums that I have in my iTunes library. Ripping disks to MP3s is a PITA!
I bought a new Western Digital 160GB SATA drive which is being delivered tomorrow. The old drive, a Hitachi 160GB SATA drive, is still under warranty, so I should get a replacement eventually. And I'll be using it to make more regular backups. The plan is to have a 160GB drive that I use a tool like SuperDuper
to make a bootable image of my laptop drive on a regular basis. (Oh crap, I have a lot of software to reinstall...) I'll make incremental backups of my home directory and application directories using Carbon Copy Cloner.
Next time, I won't procrastinate on making a backup of something as important as vacation photos, either.
Before going to the west coast I backed up my MacBook. I always make a backup before a road trip.
When we came home, laden with gigs of pictures, I made a backup. It filled the drive and never completed. I finally got around to making a backup yesterday.
"Hey, what's making that funny noise?"
Oh. Crap. That funny noise is coming from the hard drive in my MacBook. Everything got very slow on my Mac and it finally hung. I had to reboot.
No dice. The drive is dead. Nothing has been able to rescue it (Disk First Aid, Disk Warrior). "Invalid sibling link" errors. Note the part where it says "This is an error you definitely don't want. It indicates that parts of your directory, and therefore some of your files and folders, are inaccessible." Yay!
So, the question now is, how far did my backup get? Did I really lose 800+ pictures from 10 days on the road?
Sadly, the answer looks to be yes. Everything that hasn't been uploaded somewhere or possibly saved in an email looks to be lost. Once I replace the drive and get my digital life back in order I will explore other options to retrieve my data. So far it looks like I may have only lost those photos, other directories containing important data that has changed recently (remember the older, incomplete backup). Thankfully I didn't lose my 7000+ photos that happened before the road trip or hundreds of albums that I have in my iTunes library. Ripping disks to MP3s is a PITA!
I bought a new Western Digital 160GB SATA drive which is being delivered tomorrow. The old drive, a Hitachi 160GB SATA drive, is still under warranty, so I should get a replacement eventually. And I'll be using it to make more regular backups. The plan is to have a 160GB drive that I use a tool like SuperDuper
to make a bootable image of my laptop drive on a regular basis. (Oh crap, I have a lot of software to reinstall...) I'll make incremental backups of my home directory and application directories using Carbon Copy Cloner.
Next time, I won't procrastinate on making a backup of something as important as vacation photos, either.
Monday, December 25, 2006
Networking issues... I'm an idiot!
So, the networking problems were of my own making. Oftentimes I reorganize applications from /Applications to subdirectories, such as /Applications/Utilities. I did this with the System Preferences application. The app was also in my dock.
So when I copied over my apps, preferences, etc. from my old PowerBook to the new MacBook, over came the old System Preferences application too! I didn't know I had even done it or even consider that an option! My best guess is that the PPC version of the app didn't like running on the Intel MacBook. Anyway, I figured this out halfway through a complete reinstall of OS X
and copying all my data from the old laptop over to the new one.
Time wasted? At least 4 hours.
D'oh!
So when I copied over my apps, preferences, etc. from my old PowerBook to the new MacBook, over came the old System Preferences application too! I didn't know I had even done it or even consider that an option! My best guess is that the PPC version of the app didn't like running on the Intel MacBook. Anyway, I figured this out halfway through a complete reinstall of OS X
and copying all my data from the old laptop over to the new one.
Time wasted? At least 4 hours.
D'oh!
Sunday, December 24, 2006
New MacBook
I finally broke down and bought myself a new sleek, black MacBook. Yay! It showed up yesterday and after installing some RAM and applications, its showing what a powerful beast it really is. I am ripping a DVD — for archival purposes only — usng HandBrake. On my 1GHz 12" Powerbook this would take 4 - 7 hours. HandBrake is reporting that it will complete the task in ~45 min! Woohoo!
Looking forward to installing Parallels and playing with VM images tomorrow... perhaps. In the meantime, there is a problem with the Ethernet networking which may cause me to reinstall everything from scratch. That may be tomorrow's task du jour, if I can't find another solution tonight.
Looking forward to installing Parallels and playing with VM images tomorrow... perhaps. In the meantime, there is a problem with the Ethernet networking which may cause me to reinstall everything from scratch. That may be tomorrow's task du jour, if I can't find another solution tonight.
Subscribe to:
Posts (Atom)