Investigating unexplained disk activity on Mac OS Lion

Recently I became frustrated with the amount of inexplicable disk access going on on my old iMac – something was thrashing the hard disk relentlessly and blocking other apps.

Using sudo fs_usage I found that the main activity after login was Dropbox (which was fair enough), the Akamai background downloader for Adobe Creative Cloud (which wasn’t) and Spotify’s background web service (which was just bizarre) 

So I found and deleted the akamai downloader for Adobe Creative Cloud:

/Applications/Akamai/admintool uninstall -force

Then told Spotify not to open at startup and not to allow itself to be started from the web:Image

sudo fs_usage then reported a lot of access from the launch services daemon which seemed to be thrashing th disk for no reason, so dumped and rebuilt its database:

sudo /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user

And now, touch wood-coloured plastic, it all seems to be much improved. Launch services and spotify still do a lot after login but it settles down after a minute or two instead of this constant thrashing it was doing. 

So that’s all good then.

Hiding local changes in git

So I found myself needing to make some local customisations to database.yaml and didn’t want to commit these. Turns out the solution is twofold

You don’t want to gitignore the whole file because that removes it from VCS for everyone. Instead, add the file to your local excludes file

 

vi .git/info/exclude
add config/database.yaml
:wq
 
Then run 
 
git update-index –assume-unchanged config/database.yaml
 
And voila – git status no longer includes the local mods

Adding a new repo to github – quick steps

Quick notes on adding an existing project to github

Check you’ve got public key auth set up properly on github:

ssh -T git@github.com
# Attempts to ssh to github

You may see this warning:

# The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?
Don’t worry, this is supposed to happen. Verify that the fingerprint matches the one here and type “yes”.

# Hi username! You’ve successfully authenticated, but GitHub does not
# provide shell access.
If that username is correct, you’ve successfully set up your SSH key. Don’t worry about the shell access thing, you don’t want that anyway.

In the local project, assuming it’s not under any VCS at the moment:

git init
git add .
git commit -m "initial commit"

Create a new repository on the command line

On github, create a new empty repo

Note the lines it tells you under “Push an existing repository from the command line” – or edit these ones:

git remote add origin git@github.com:Polsonby/test.git
git push -u origin master

Do those in the new working directory, which will add the github repo as an upstream origin repository for your local one, then push the entire history up to the master branch on there, synchronising them.

Then do

git pull
or
git push

as needed to sync between local and remote.