Skip to content

Instantly share code, notes, and snippets.

@msayan
Created April 6, 2017 12:52
Show Gist options
  • Save msayan/797a31e10a0ee5a47257d3dbb8a52803 to your computer and use it in GitHub Desktop.
Save msayan/797a31e10a0ee5a47257d3dbb8a52803 to your computer and use it in GitHub Desktop.
STF Ubuntu Installer
# Add RethinkDB key
. /etc/lsb-release
echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
# Install packages
sudo apt-get update
sudo apt-get install -y git nodejs nodejs-legacy npm rethinkdb android-tools-adb python autoconf yasm automake libtool build-essential ninja-build libzmq3-dev libprotobuf-dev git graphicsmagick
# Install additional packages via npm
npm install -g bower karma gulp
# Install ZeroMQ
cd /opt
sudo wget http://download.zeromq.org/zeromq-4.1.2.tar.gz
sudo tar -zxvf zeromq-4.1.2.tar.gz
cd zeromq-4.1.2
sudo ./configure --without-libsodium
sudo make
sudo make install
# Install Google protobuf
cd /opt
sudo git clone https://github.com/google/protobuf.git
cd protobuf
sudo ./autogen.sh
sudo ./configure
sudo make
sudo make install
# Optional cleaning
sudo apt-get clean
#Install STF
npm install -g stf
# ADB Settings
eval $(wget -qO - "https://android.googlesource.com/platform/tools/base/+/master/sdklib/src/main/java/com/android/sdklib/repository/SdkRepoConstants.java?format=text" | base64 -d | tr '\n;' ' \n' | sed -e "s/\(NS_LATEST_VERSION\|URL_GOOGLE_SDK_SITE\|URL_FILENAME_PATTERN\)/\n\1/g" -e "s/%1\$d/\$NS_LATEST_VERSION/" | tr -d ' ' | grep "^[A-Z_]*=" | sort)
wget -qO - "$URL_GOOGLE_SDK_SITE$(wget -qO - "$URL_GOOGLE_SDK_SITE$URL_FILENAME_PATTERN?format=text" | xml2 | grep "/sdk:platform-tool/" | grep "\-linux\.zip$" | tail -n 1 | cut -d= -f2)" | funzip 2> /dev/null 1> ./adb
chmod 755 ./adb
sudo dpkg --add-architecture i386 2>/dev/null
sudo apt-get -qqy update
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386
/adb devices
#ZeroMQ Error
sudo touch /etc/ld.so.conf
sudo ldconfig
#STF Start
rethinkdb&
adb devices
/adb devices
stf local
echo "Stf running at http://localhost:7100"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment