Skip to content

Instantly share code, notes, and snippets.

View calebjohnston's full-sized avatar

Caleb Johnston calebjohnston

View GitHub Profile

Keybase proof

I hereby claim:

  • I am calebjohnston on github.
  • I am calebjohnston0 (https://keybase.io/calebjohnston0) on keybase.
  • I have a public key ASBXSzQGO5FQyB2iTxIAtaCxZ52ywLUfxA1bLRA41pu_pwo

To claim this, I am signing this object:

@calebjohnston
calebjohnston / gist:9675166
Created March 20, 2014 22:18
Creates NSString representation of the serial number for an OSX computer
#import <IOKit/IOKitLib.h>
//
// Creates NSString representation of machine serial number
//
NSString *serial = nil;
io_service_t platform = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
if (platform) {
CFTypeRef serialNumberAsCFString =