Skip to content

Instantly share code, notes, and snippets.

View carsonmcdonald's full-sized avatar

Carson McDonald carsonmcdonald

View GitHub Profile
@carsonmcdonald
carsonmcdonald / swift-amzn-ami.sh
Created January 11, 2016 04:35
Build Swift on an Amazon Linux AMI
#
# Notes:
#
# I used the following AMI:
# "Amazon Linux AMI 2015.09.1 (HVM), SSD Volume Type - ami-60b6c60a"
# Running on AMI: amzn-ami-hvm-2015.09.1.x86_64-gp2 (ami-60b6c60a)
#
# You probably want to use an instance type with a large amount of memory. My first
# attempt was with a c4.2xlarge but it rant out of memory without using -j option to
# limit the parallel build.
@carsonmcdonald
carsonmcdonald / test.json
Created September 22, 2015 21:41
AVS curl example
{"messageHeader":{"deviceContext":[{"name":"playbackState", "namespace":"AudioPlayer", "payload":{"streamId":"", "offsetInMilliseconds":"0", "playerActivity":"IDLE"}}]}, "messageBody":{"profile":"doppler-scone", "locale":"en-us", "format":"audio/L16; rate=16000; channels=1"}}
@carsonmcdonald
carsonmcdonald / mpverify.sh
Created April 4, 2014 02:22
A script that will validate a P12 certificate/key pair with an iOS mobile provisioning profile.
#!/bin/sh
CERT=$1
PROFILE=$2
if [ ! -f "$CERT" ] || [ ! -f "$PROFILE" ]
then
echo "Usage: mpverify.sh <cert p12> <profile>"
exit
fi
@carsonmcdonald
carsonmcdonald / ec2pebblesetup.sh
Created July 7, 2013 11:07
Set up the pebble build environment on an EC2 node using Amazon's Linux distro.
sudo yum groupinstall development
sudo yum install libmpc dpkg-devel python-devel python-pip git curl flex bison texinfo autoconf gmp-devel mpfr-devel elfutils-libelf-devel ncurses-devel libmpc-devel python27 python27-devel python-virtualenv freetype-devel zlib-devel libjpeg-devel libtiff-devel httpd
sudo chkconfig httpd on
sudo service httpd start
sudo chown $USER.$USER /var/www/html/
git clone https://github.com/pebble/arm-eabi-toolchain.git
PREFIX=$HOME/arm-cs-tools PROCS=16 make install-cross
@carsonmcdonald
carsonmcdonald / osxbuildvalgrind.sh
Created May 26, 2013 12:59
Build script that will download and install valgrind.
mkdir installroot
INSTALLROOT=`pwd`/installroot
curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xvzf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --prefix=$INSTALLROOT --with-internal-glib
make
make install
@carsonmcdonald
carsonmcdonald / missingbowerrepos.txt
Created April 22, 2013 16:24
A list of missing bower repos
zoe
yourpackagename
urturn-expression-css
underscoreDeepExtend
ui-calendar
typeahead
twangular
toolkit
time
testingStash
@carsonmcdonald
carsonmcdonald / libimobiledevicecompileosx.sh
Last active September 29, 2023 16:28
Compile libimobiledevice and every it needs in one script.
#!/bin/sh
mkdir installroot
INSTALLROOT=`pwd`/installroot
echo "Downloading and installing pkg-config"
curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xvzf pkg-config-0.28.tar.gz
cd pkg-config-0.28
@carsonmcdonald
carsonmcdonald / buildmrubyforosx.sh
Last active December 14, 2015 03:28
Grabs the current version of mruby and builds it as a framework that will work for embedding in OS X apps.
#
# Grab the latest mruby
#
git clone git://github.com/mruby/mruby.git
cd mruby
make clean
make
make test
cd ..
@carsonmcdonald
carsonmcdonald / cupsprintofile.py
Last active July 29, 2018 06:13
Quick python script to print to a file with cups.
#!/usr/bin/python
# sudo lpadmin -p printer-name-here -E -v socket://localhost:12000 -m raw
import socket
fpsock = socket.socket()
fpsock.bind(('127.0.0.1', 12000))
fpsock.listen(5)