Skip to content

Instantly share code, notes, and snippets.

@paxperscientiam
Forked from jaywilliams/install-mosh.sh
Created October 1, 2017 18:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxperscientiam/ce0652e2f4f3a879be2e4712ed7148e5 to your computer and use it in GitHub Desktop.
Save paxperscientiam/ce0652e2f4f3a879be2e4712ed7148e5 to your computer and use it in GitHub Desktop.
Compiling and running mosh on Dreamhost (Updated - 2017)
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.2.6
# Create Source Directory
mkdir -p $PREFIX/src
cd $PREFIX/src
# Install Protocol Buffers
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar -xf protobuf-2.6.1.tar.gz
cd protobuf-2.6.1
./configure --prefix=$PREFIX
make
make install
cd ..
# You'll need this setting to have mosh find the Protocol Buffer lib
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
export PATH=$PREFIX/bin:$PATH
# Install mosh
wget https://mosh.org/mosh-$VERSION.tar.gz
tar -xf mosh-$VERSION.tar.gz
cd mosh-$VERSION
./configure --prefix=$PREFIX
make
make install
# Post-Install Notes
echo 'To connect to the mosh server, run this on your local machine:'
echo " $ mosh --server=\"LD_LIBRARY_PATH=$PREFIX/lib $PREFIX/bin/mosh-server\" $USER@$(hostname -f)"
echo 'Or add following lines to your ~/.bashrc (or other applicable shell) file:'
echo " export LD_LIBRARY_PATH=$PREFIX/lib"
echo " export PATH=$PREFIX/bin:\$PATH"
echo 'Afterwards, you can simply run this on your local machine:'
echo " $ mosh $USER@$(hostname -f)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment