»

I am an idiot – an iPod story

Technology — Tags: , , — Nathan on May 19, 2009 at 10:57 am

I have been really frustrated with my 160GB black iPod for the last several months. For some reason, whenever I changed the volume or searched through folders while a song was playing, the song would skip horribly, sounding clipped or just plain messed up until I stopped messing with the thing and left it alone. In the last few days, it started skipping even when I wasn’t touching it. I was bemoaning my iPod purchase. My 60GB iPod never did this. I already gave it to my wife and there is no way I can get it back now…

I searched the internet for any indication that someone else had this problem, but I came up empty. I was almost to the point of taking the thing in to one of the Apple Store “geniuses”, even though I make it a personal rule never to talk to anyone who calls them self a “genius”. Then this morning, after months of dealing with what I thought was a piece of crap iPod, I stumbled on the fix….

Restart the iPod. Press and hold the middle button and the menu button for 6 seconds.

Darn my fool brain! This is always the first course of action for any techno-problem. How could I have overlooked this???!!??!?!?

Anyway, the iPod is fixed and it took a total of 10 seconds. I’m glad I figured this out before I sold it on eBay.

Setting up an automated sync process on my Mac

Technology — Nathan on January 24, 2009 at 3:19 pm

I have been trying for years to find a way to keep a central source of my important files that could be accessed from anywhere.  For a long time I kept these files on my Fileserver, which is an old G4/533 Mac that is constantly online.  This was fine for text files, as I could ssh into the fileserver and adjust access the text files through Putty on a PC or terminal on another Mac.  The issue is with other types of files such as images and PDFs.

I decided to try Dropbox to scratch this itch, but I still had some issues:

  1. Dropbox will keep all the files in one designated folder in sync between the Dropbox server and any other computers you hook up using the Dropbox application.  However, there is no way to only sync up certain folders within, say, your Documents folder.  One requirement I have is to keep my Documents folder on my Mac Book Pro the way it is, but only sync up certain folders from my Documents.
  2. I tried variations of Aliases and Symbolic links, but this was not acceptable.  I usually use list view in the finder, and I make heavy use of the expanding triangles there, so Aliases and Links were not working for me.
  3. Dropbox only lets you store 2GB on their server, so I had no issue with having my data in two places locally to solve my problem.
  4. I would like to have my Documents folder be the system of record – meaning any changes to Documents would be reflected on Dropbox, and any changes to Dropbox would be overwritten by what was on my documents.  The only issue here is the ability to transfer from another computer to my Mac view Dropbox, which I also would like to do.

I think that’s it for my requirements.  I went through a few different designs, but here is what I ultimately came up with:

  1. Create a script on the mac that would use rsync to copy my select Document folders to my Dropbox folder.
  2. Set up my system so this rsync script would run at a set interval.
  3. Create a transfer folder in the Dropbox that was not included in the sync for moving files from the cloud to my Mac.

So I will go through each of these steps in a little detail just to show how this went down.  The first step was to set up the rsync script.  For those who don’t know, rsync is a Unix utility that will keep a source location in sync with a destimation location by copying over anything that is at the destination.  There are a ton of options with rsync – if you want to learn more, the man page is excellent.

What I want to do here is set 5 or 6 of the folders in my Documents folder to sync up and leave the rest unsynced.  Here is a diagram of what I’m trying to do:

Documents Folder 		Dropbox Folder
Articles	--rsync---->	Articles
Beer-Recipes	--rsync---->	Beer-Recipes
Business
Ebooks		--rsync---->	Ebooks
Finance
Lilypond	--rsync---->	Lilypond
Manuals-Receipts
Notes		--rsync---->	Notes
Parallels
Photos		no sync		Photos
Public		no sync		Public
Unix		--rsync---->	Unix
 				Transfer

So, as you can see, there are several folders I will sync with my Dropbox, some folders I will not sync and that are not in my Dropbox (I don’t need these folders available away from my Mac), and two folder that are not synced, but exist in both folders.  These two – Photos and Public – serve different purposes in the two folders.  Public on my Mac are files that are available to other users on my network, whereas Public on Dropbox is open to the entire internet.

There is also a folder on Dropbox that is not in my Documents folder – Transfer.  This is folder I will use to load things to my Mac from other computers I set up with Dropbox.  If any of the synced folders are changed by other computers, though (like if I accidentally delete all of my notes, for example), they will automatically be copied from my Mac to Dropbox next time I log in ot my Mac.

Here is the script I wrote to accomplish this, nice and simple.  I am sure there are other things I could do to imporve this.  Feel free to comment or drop me an email if you have suggestions:

#!/bin/bash
# Sync of Document directories to my dropbox - Nathan Bibb 2009-01-22
rsync -a --delete ~/Documents/Articles ~/Dropbox/
rsync -a --delete ~/Documents/Beer-Recipes ~/Dropbox/
rsync -a --delete ~/Documents/Ebooks ~/Dropbox/
rsync -a --delete ~/Documents/Lilypond ~/Dropbox/
rsync -a --delete ~/Documents/Games ~/Dropbox/
rsync -a --delete ~/Documents/Music-Notes ~/Dropbox/
rsync -a --delete ~/Documents/Networking ~/Dropbox/
rsync -a --delete ~/Documents/Notes ~/Dropbox/
rsync -a --delete ~/Documents/Science ~/Dropbox/
rsync -a --delete ~/Documents/Unix ~/Dropbox/

So I saved this text file in my Library/Scripts folder as “dropboxrsync”.  Now I just have to set it up to run every 30 seconds or so.

This is where I ran into a problem.  I was planning to use the unix command cron, but I ran into some problems, then found out the as of Mac OS 10.4 cron was depreciated in favor of a program called launchd.  I had to do a lo of research to figure out how this whole thing works, but I finally got it going.  Here’s what I did:

  1. Create a directory in the Library folder of my home directory called “LaunchAgents”
  2. Create a “plist” XML file and save it in this directory.  I used the name “com.nathanbibb.dropboxrsync.plist”.  Here is the XML file I created:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com
/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.nathanbibb.dropboxrsync</string>
        <key>LowPriorityIO</key>
        <true/>
        <key>Program</key>
        <string>/Users/nathanbibb/Library/Scripts/dropboxrsync</string>
        <key>ProgramArguments</key>
        <array>
                <string>dropboxrsync</string>
        </array>
 <key>StartInterval</key>
        <integer>30</integer>
</dict>
</plist>

This file tells the launchd program to run my “dropboxrsync” script (Program and ProgramArguments both do this – I am not sure why you need both of these, but apparently you do) every 30 seconds (StartInterval does this), keep this a low priority task in case the processor is doing something importnat (LowPriorityIO does this), and track this activity in launchd as “com.nathanbibb.dropboxrsync” (This is the label).  The format of this label is using the Apple convention of “reverse DNS”.

So now I have an rsync script that runs every 30 minutes keeping my Dropbox folder in line with my chosen folders in my Docments folder.  The only real downside here is that I have to keep the files in two locations on my local hard drive.  If I ad access to a public rsync server, I suppose I could set up the same rsync script to sync my files with a different server rather than using Dropbox, but I would need command line access to my web server, I think, which I don’t have on my current server.  So we’ll see how long this whole crazy process lasts.

Here are some of the really helpful sites I found that got me where I needed to go:

http://developer.apple.com/MacOsX/launchd.html

http://www.macresearch.org/tutorial_backups_with_launchd

And some pertinent man pages (these are accessible from the Mac Terminal.app interface):
man rsync
man launchd
man launchd.plist
man launchctl
man plist

Cheers!

Email, RSS feeds, and the one-armed bandit

Technology, microposts — Nathan on September 15, 2008 at 11:08 am

Micro-Post 2

An article in the Guardian a couple of weeks ago examined how the use of email can be compared to gambling addition.  Here’s a good quote:

Dr Tom Stafford, a lecturer at the University of Sheffield and co-author of the book Mind Hacks, believes that the same fundamental learning mechanisms that drive gambling addicts are also at work in email users. “Both slot machines and email follow something called a ‘variable interval reinforcement schedule’,” he says, “which has been established as the way to train in the strongest habits. This means that rather than reward an action every time it is performed, you reward it sometimes, but not in a predictable way. So with email, usually when I check it there is nothing interesting, but every so often there’s something wonderful – an invite out, or maybe some juicy gossip – and I get a reward.” This is enough to make it difficult for us to resist checking email, even when we’ve only just looked.

I don’t know if I feel this way about email, but this describes my relationship to my RSS feeds on Google reader to a tee.  I end up checking my feeds every 5 or 10 minutes looking for something interesting in the sea of ho-hum posts.

Am I alone, or does anyone else feel this way?

[As an aside - do you think I am contributing to the problem with my concept of Micro-Posts?]

Nicerobot’s “Just For Friends” is no more

Personal, Technology — Nathan on July 21, 2008 at 12:00 pm

So it looks like friend of the journal, nicerobot, has had too many problems with WordPress or something and destroyed his “Just for Friends” community blog in a fit of rage.  He has suggested the handful of us who frequented ( or infrequented) there should start up Friendfeed accounts and keep in touch that way.

I don’t know Friednfeed, but it seems kind of Twittery to me.  Nothing against Twitter, but I just can’t get into massive quantities of one sentence phrases coming in fromall directions like an attack of locusts.  It seems like the logical progression of online Attention Deficit Disorder.  Maybe it’s just me – maybe I Just Don’t Get It.  But it seems likemore and more data is coming in with less and less information and context.

I think that’s my biggest issue here – lack of context.  I guess you can make your own context with very short messages. I think I will start a messaging service with a message length limited to one character:

  • nicerobot says: “A”
  • caroliner says: “C”
  • n8 says: “G”

etc.  If enough of these feeds are coming at you at once, I am sure you will begin to see the patterns in the traffic.

My MacBook Pro is finally working

Technology — Nathan on March 14, 2008 at 2:40 pm

For anyone interested, I finally got my refurbished MacBook Pro back from the Apple Store yesterday.  I had a few issues after bringing it home, but everything seems to be right with the world now.  Soon I will post a diagram of my new home network and how my new baby fits in.  In the meantime here is a list of my issues and how they were resolved:

  •  The original problem with the machine had to do with the battery and hard drive.  All they did according to the receipt was replace these two components.  That caused the machine to crash on startup 4 times out of 5.  The bad outcome here – I originally thought I lucked out by getting a 250GB HD instead of the 120GB HD I was promised.  Would have been great if the HD wasn’t hosed.
  • When I got the machine from the store and started it up at my office, there was an admin user configured on the machine, and I didn’t have the password.  The machine had nothing on the HD when I gave it to them (it crashed in the middle of a fresh OS install).  They told me over the phone that they have a tool to clean this up (looks like a shell script called “missingkitty”), but they forgot to run it.  Without the admin password, I couldn’t run the script, and I didn’t feel like sitting in the apple store for another 45 minutes while I waited for someone to help me.  So I reinstalled the OS from the included disks.
  • That night, I tried to use the MacBook for my kids to watch their bedtime ritual – the last 5 minutes of “Froggy Movie” (aka Leap Frog’s “Letter Factory” – which I highly recommend for the little ones), but after a few seconds the picture froze while the sound moved on, then everything went black on the DVD playback.  Luckily this seems to have been resolved by upgrading the OS to 10.5.2
  • Totally unrelated note – I have had a weird issue recently with my G4/533 that I have now relegated to the role of file and print server.  I wanted to change the name of the system HD to Fileserve, but for some reason I couldn’t.  I thought it might have to do with the fact that I access it through VNC only (it’s now a headless machine), so I hooked my monitor up to it while I was configuring the MacBook, but I still couldn’t change the name of the HD.  I then learned the power of “Repair Permissions” in the Disk Utility app.  Nice.

That’s all I am saying about the new machine for now.  I am now making a list of the programs I need to install to get where I want.  Here’s the list – if anyone has suggestions for additional programs or substitutions, let me know.

  • tinyfugue (for text based games)
  • BBEdit (text editor)
  • Games > Adventure
  • Csound (I wrote some tone generating shell scripts for Csound)
  • Cyberduck (FTP client)
  • Chicken of the VNC (for accessing the fileserver)
  • Games > Nethack
  • wget
  • lynx
  • Lilypond (command line music engraving)
  • Games > micropolis
  • Refresh
  • Smultron (text editor in case I don’t buy the upgrade to BBEdit)
  • Mac the Ripper
  • Handbrake

Home Networking and Too Much Caffeine

Technology — Nathan on March 3, 2008 at 7:39 pm

I have finally decided to get a new laptop. I bought one of the 2.2GHz Mac Book Pros from the Apple refurb section, hoping that I will get a brand new machine that was dumped in the refurb pile when the new Pros were released last week. It looks like I am not the only one, since after 6 days they have sold out of the 15″ models.

This forced me to reckon with what I would do with my old reliable G4 533MHz desktop. It has served me well for years, so I decided to make it a household File Server and Print Server. But this decision forced me to re-evaluate my home network, forcing me down the rabbit hole of specifications, napkin network diagrams, and general networking craziness.

I was able to set the G4 up as a headless server using SharePoints (not to be confused with SharePoint), but I am still ironing out the kinks of getting my wife’s PC access. I am accessing the G4 through another PC laptop using SSH and VNC, which I have been doing for years thanks to this handy tutorial. But now I am starting to rethink things that currently work fine, like my discontinued wireless router. The G4 has a built in Gigabit Ethernet connection – should I take advantage of this by buying a Gigabit wireless router? This would also allow me to use the 802.11n wireless capability of the new Mac Book – holy crap, what have I started here?


(c) 2010 Journal of Nathan Bibb | powered by WordPress with Barecity