Skip to content

Instantly share code, notes, and snippets.

@command-tab
command-tab / gist:2370710
Created April 12, 2012 20:17
Extract Certificate Subject from a Provisioning Profile
# Parse a provisioning profile
# Extract the first DeveloperCertificates <data> entry
# Remove any leading whitespace
# Remove any blank lines
# Base64 decode the blob
# Parse the .cer with OpenSSL
# Extract the first line, which is the certificate subject (the rest is the cert blob)
# End up with a string like: subject= /UID=AABBCCDDEE/CN=iPhone Developer: First Last (FFGGHHIIJJ)/C=US
# Note: Uses xmlstarlet to parse the plist, but you could probably use PlistBuddy or grep, too
#import <Foundation/Foundation.h>
#import "AFNetworking.h"
int main(int argc, const char *argv[])
{
@autoreleasepool {
NSURL *url = [NSURL URLWithString:@"https://api.github.com/users/AFNetworking/repos"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"success: %@", JSON);
$ vagrant provision
[default] Running provisioner: VagrantPlugins::Shell::Provisioner...
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ssh/communicator.rb:105:in `initialize': No such file or directory - /Users/collin/Desktop/vagrant-ansible-dev/provisioning/shellx.sh (Errno::ENOENT)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ssh/communicator.rb:105:in `open'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ssh/communicator.rb:105:in `block in upload'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ssh/communicator.rb:311:in `block in scp_connect'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ssh/communicator.rb:248:in `connect'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ssh/communicator.rb:309:in `scp_connect'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/communicators/ss
@command-tab
command-tab / prov-p12-verify.sh
Created April 10, 2013 20:06
Compares fingerprints of certificates in an Apple provisioning profile against that of a PKCS12 (.p12) file. Usage: prov-p12-verify.sh /path/to/prov.mobileprovision /path/to/pkcs.p12 secretpassword
#/bin/bash
prov="$1"
p12="$2"
password="$3"
blue_color="\033[0;36m"
green_color="\033[0;32m"
red_color="\033[0;31m"
end_color="\033[0m"
lipo -create libdevice.a libsimulator.a -output libfat.a
# Navigate to the frontmost Finder window
function navigate_finder
{
osascript -e 'tell application "Finder" to if window 1 exists then if target of window 1 as string is not ":" then get POSIX path of (target of window 1 as alias)'
}
alias f="cd \"\$(navigate_finder)\""
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/
PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.splunk.splunkforwarder</string>
<key>EnvironmentVariables</key>
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<photos page="1" pages="241" perpage="100" total="24022">
<photo id="8879534383" owner="49650603@N07" secret="2dab000a47" server="5336" farm="6" title="CAFLS-5453" ispublic="1" isfriend="0" isfamily="0" url_sq="http://farm6.staticflickr.com/5336/8879534383_2dab000a47_s.jpg" height_sq="75" width_sq="75" url_o="http://farm6.staticflickr.com/5336/8879534383_0d56d24565_o.jpg" height_o="3456" width_o="5184" url_m="http://farm6.staticflickr.com/5336/8879534383_2dab000a47.jpg" height_m="333" width_m="500" dateupload="1369842684">
<description>2013 CAFLS Senior Awards</description>
</photo>
<photo id="8879535271" owner="49650603@N07" secret="54d01a86b0" server="7356" farm="8" title="CAFLS-5452" ispublic="1" isfriend="0" isfamily="0" url_sq="http://farm8.staticflickr.com/7356/8879535271_54d01a86b0_s.jpg" height_sq="75" width_sq="75" url_o="http://farm8.staticflickr.com/7356/8879535271_8acb61e3b3_o.jpg" height_o="3456" width_o="5184" url_m="http://farm8.stat

So You Want to Develop PHP Locally

This guide is intended for developers who want to write and run PHP on their local Mac. It is expected that you have some familiarity with Terminal commands, as well as opening and saving text files with an editor of your choice.

Install Xcode Command Line Tools

Available from the Apple Developer Center, the Xcode Command Line Tools are all that Homebrew needs to build and install software on the Mac. The Xcode app is only needed if you intend to also to OS X or iOS development.

Install Homebrew

$ export VAGRANT_DEFAULT_PROVIDER=vmware_fusion
$ VAGRANT_LOG=DEBUG vagrant up
INFO global: Vagrant version: 1.2.7
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.7/plugins/commands/help/plugin.rb