Tag: mac os x

Mounting USB drives on an Ubuntu VirtualBox guest on Mac OS X host

If you’ve come across this already then this might be obvious, but in order to mount a USB external drive on an Ubuntu VirtualBox guest running on a Mac OS X host, you need to unmount the drive in Mac’s Finder first. Then using either click the USB icon in the status bar in your Ubuntu guest and you’ll see the drive un-greyed out (when it’s mounted on the Mac it appears greyed out and you can’t select it) – click it and it will mount automatically. Or you can do the same thing from the VirtualBox menu, Devices/USB.

(Page views: 34)

Mac OS X: Adding to your PATH

If you install an app that runs from the shell and you want to add the path to the executable to your PATH env var, just add it to PATH in a .bash_profile file in your user’s home dir – this will be run every time you start a new terminal session:

export PATH=$PATH:your_path_here

(Page views: 42)

Writing an SD card disk image for the Pi on Mac OS X

The last time I installed a new disk image on an SD Card for the Pi I had to use the Win32DiskImager util on Windows. Since I primarily use a Mac that took a few additional steps to get a working SD Card.

Looks like now though someone has scripted the steps to make this easier on a Mac. I used the RPiSDCardBuilder util and this seems to work fine.

(Page views: 606)

Browsing (and deleting) old Time Machine Backups from another Mac

In general, most things on the Mac are pretty intuitive and easy to find/use/work out. Now and then though I come across some feature that seems to have been buried and only find it via someone else talking about it online. for example, how to browse Time Machine backups on an external drive from an older Mac.

I have an external drive that I use for my Time Machine backups, and used it from my older MacBook Pro, and also use it for my newer MBP. The drive filled up, so I was trying to work out a) how to browse my older backups, because by default they weren’t browsable via the Time Machine UI, and b) how to delete some of them.

Turns out, thanks to these tips, if you hold Option while the Time Machine dropdown menu is displayed from your toolbar, the option ‘Browse other backup disks…’ appears – from there you can select the Time Machine backup from another Mac.

While in the Time Machine UI, to delete a whole backup from a prior date, click the ‘cog’ icon and you have the option to delete backup.

(Page views: 183)

Unmounting Bootcamp to use as a drive for Virtual Box

Part of the instructions for setting up Virtual Box to boot from your Bootcamp drive on Mac OS X walk you through setting up a permanent approach to unmounting your Bootcamp drive. I didn’t follow those instructions, instead created a script that I can use to run manually to unmount and open the permissions when needed, i.e. when I want to boot from VirtualBox:

diskutil umount /Volumes/BOOTCAMP
sudo chmod 777 /dev/disk0s4

The instructions on some sites also assume that your Bootcamp drive is partition disk0s3, but on my machine it’s disk0s4. If you run ‘diskutil list’ you can get a list of your partitions to work out which is your Bootcamp partition.

(Page views: 143)

Booting your Windows Bootcamp partition in VirtualBox

I have XP in my Bootcamp partition which I occasionally boot to run apps that I don’t have on Mac OS X, usually it’s for a Windows game. It annoys me to switch between Mac OS X and booting Windows from Bootcamp, as it takes a while to switch back and forth. The only reason I’ve ever considered buying Fusion or Parallels is to be able to boot from the Bootcamp partition and avoid having two Windows installs – one in Bootcamp and one on a virtual disk. Sometimes it’s fine to boot in a virtual machine, but othertimes you really want to boot natively to make full use of the graphics card and DirectX etc. Turns out you can set up VirtualBox to easily boot from a Bootcamp partition, and avoid having two installs.

I followed the instructions here, and after a bit of fiddling with with VirtualBox settings for my new VM, it booted fine. The instructions are for booting Windows 7 from Bootcamp in VirtualBox, but it works the same for XP too.

(Page views: 1319)

Setting up a Git server on Ubuntu, accessing from Mac OS X

This wiki post walks you through the key steps configuring a Git server on Ubuntu.

Edit 4/3/12: there’s a lot of other articles on how to setup gitosis on linux – here’s some I followed, but they all have slight variations in the approach: here, here, and here. It seems somewhat hit and miss whether it works or not (as you’ll find if you google for related articles). For me, I could only get this approach working for the user in the gitosis-admin group, and I could not get access for any other users, despite how many variations of the setup instructions I worked through. There’s numerous comments that gitosis is also no longer supported and to use gitolite instead, so I’m going to try installing gitolite instead and will write another post on using this approach . See here for my notes on setting up gitolite, which by the way I got setup with no issues at all.

The setup steps in the wiki article walk you through setting up a gitosis user through which you connect using an ssh public key – since I was trying to follow the instructions but not really sure what I was doing, the key steps (once you’ve already done the above setup) are:

  • if you already have an ssh public key, copy it to your remote server and then add it for the gitosis user with this step:
sudo -H -u gitosis gitosis-init < your.pub_file

If you don’t have a .pub file in your ~/.ssh dir, create one with the steps¬†here. This step is only done one time, for your admin user to get the gitosis-conf project setup.

To add new projects and users is via the gitosis-admin project which you clone from your new server. Once you’ve pulled the project local, all admin of adding new projects is done via making changes to the gitosis.conf file and then pushing the change back to the server.

To add a new group/team add a new section like this:

[group group_name_here]
members = dev1@host1 dev2@host2 dev3@host3
writable = Project1 Project2

Notice the members and writable list of source project are space separated, not comma.

For each new user, add their .pub ssh file to the gitosis-admin/keydir directory, named user@host.pub, where user@host matches their id and host at the end of the key details in the file.

Add, commit and push them to the server:

git add .
git commit -m "added new key files"
git push

To push a new project for the first time, eg’Project1′

  • cd into the project you’re adding for the first time and add your remote:
git remote add origin gitosis@your_server_name:Project1.git
  • Add, commit and then push your code on the master branch:
git add .
git commit -m "commit message"
git push origin master

Subsequent pushes, you can just do ‘git push’

(Page views: 4558)