Skip to content

Instantly share code, notes, and snippets.

View phatblat's full-sized avatar

Ben Chatelain phatblat

View GitHub Profile
@arobb
arobb / sierra-virtualbox-install.md
Last active November 24, 2020 13:15
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
@jhansche
jhansche / watch-fds.sh
Created October 28, 2016 20:39
Simple script to monitor the number open file descriptors for an Android application.
#!/bin/sh
# Usage: ./watch-fds.sh <application_id> [delay_secs = 5]
APP_ID=${1:?missing application id}
DELAY=$(( ${2:-5} ))
DEVICE_LIMIT=$(( $(adb shell ulimit -n) ))
WARN_THRESHOLD=$(( ${DEVICE_LIMIT} / 3 ))
echo "Will warn at ${WARN_THRESHOLD}"
@davetrux
davetrux / build.gradle
Created August 3, 2016 17:15
Gradle-Openbakery BundleId Switch
if(buildType == "AppStore") {
infoplist {
bundleIdentifier = "com.hpe.appstore"
}
signing {
mobileProvisionURI = 'file://' + currentPath + appStoreProfile
certificateURI = "file://" + currentPath + appStoreCert
certificatePassword = certPassword
}
@tobias
tobias / setjdk.fish
Created July 12, 2016 18:16
Manage multiple java versions on the mac from the fish shell
function setjdk
if test -n "$JAVA_HOME"
removeFromPath "$JAVA_HOME/bin"
end
set -gx JAVA_HOME (/usr/libexec/java_home -v $argv[1])
set -gx PATH $JAVA_HOME/bin $PATH
end
function removeFromPath
set -l idx 0
{
"name": "ObjectiveGit",
"version": "0.8.7",
"summary": "Objective-C bindings to libgit2.",
"homepage": "https://github.com/libgit2/objective-git",
"license": "MIT",
"authors": {
"Tim Clem": "timothy.clem@gmail.com",
"Josh Abernathy": "josh@github.com"
},
@evands
evands / combine_static_libraries.sh
Created January 14, 2015 20:40
Combine multiple .a static libraries, which may each have multiple architectures, into a single static library
#!/bin/sh
# Combined all static libaries in the current directory into a single static library
# It is hardcoded to use the i386, armv7, and armv7s architectures; this can easily be changed via the 'archs' variable at the top
# The script takes a single argument, which is the name of the final, combined library to be created.
#
# For example:
# => combine_static_libraries.sh combined-library
#
# Script by Evan Schoenberg, Regular Rate and Rhythm Software
@mculp
mculp / voices.txt
Created December 3, 2014 00:14
List of voices available by the `say` command on OS X
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.
#!/usr/bin/env bash
size=1024 # MB
mount_point=$HOME/tmp
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
}
@chrisdarroch
chrisdarroch / idea
Created October 17, 2013 03:40
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@xconnecting
xconnecting / build.gradle
Created November 8, 2012 06:30
Gradle: print buildscript dependencies
apply plugin: 'eclipse'
apply plugin: 'maven'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.apache.commons:commons-email:1.2'
}