Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Based on http://jswiki.lab-01.com/wiki/doku.php?id=install-couch
echo "Downloading Linux build tools and Erlang"
sudo apt-get install libmozjs185-1.0 build-essential libicu-dev libcurl4-gnutls-dev libtool erlang-dev erlang zip -y
#sudo /sbin/ldconfig
#echo "Spidermonkey installed."
# Work on tmp directory
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*
* Collapsible JSON Formatter - Formatter and colorer of raw JSON code
*
* jQuery Json Formatter plugin v0.1.3
*
* Usage
* -----
*
* $('#target').jsonFormat('#source'); // or
* $('#target').jsonFormat('#source', {options override defaults}); // see jf.config
set user to "PIA-USERNAME"
set pass to "PIA-PASSWORD"
set macAddHash to do shell script "/sbin/ifconfig en0 | /usr/bin/awk '/ether / {print $2}' | /usr/bin/tr -d ':' | md5 "
set vpn_ip to do shell script "ifconfig tun0 | grep inet | awk '{print $2}'"
set vpn_port to do shell script "curl -d \"user=" & user & "&pass=" & pass & "&client_id=" & macAddHash & "&local_ip=" & vpn_ip & "\" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment | grep -oE \"[0-9]+\""
do shell script "defaults write org.m0k.transmission BindPort " & vpn_port & ""