Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jaywilliams
Forked from palexander/gist:2975305
Last active January 3, 2024 17:16
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5 to your computer and use it in GitHub Desktop.
Save jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5 to your computer and use it in GitHub Desktop.
Compiling and running mosh on Dreamhost (Updated - 2024)
#!/usr/bin/env bash
set -e
# Dreamhost Mosh Install Script
# Jay Williams (https://gist.github.com/jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5)
# Based on the gracious work of:
# Paul R Alexander (https://gist.github.com/palexander/2975305)
# Sami Samhuri https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.4.0
# 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 ..
echo Removing source code...
rm -r protobuf-2.6.1
# Install Ncurses
wget https://invisible-mirror.net/archives/ncurses/ncurses-5.9.tar.gz
tar -xf ncurses-5.9.tar.gz
cd ncurses-5.9
wget https://invisible-mirror.net/archives/ncurses/5.9/patch-5.9-20141206.sh.gz
gunzip patch-5.9-20141206.sh.gz
chmod +x patch-5.9-20141206.sh
./patch-5.9-20141206.sh
./configure --prefix=$PREFIX --with-shared --without-debug --without-normal
make
make install
cd ..
echo Removing source code...
rm -rf ncurses-5.9
# 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 (Link to our curses library)
wget https://mosh.org/mosh-$VERSION.tar.gz
tar -xf mosh-$VERSION.tar.gz
cd mosh-$VERSION
./configure --prefix=$PREFIX --with-curses=$PREFIX
make
make install
cd ..
echo Removing source code...
rm -r mosh-$VERSION
# 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)"
@jaywilliams
Copy link
Author

Executed as is, you'll have a "local" directory under $HOME, like this:

local
├── bin
│   ├── mosh
│   ├── mosh-client
│   ├── mosh-server
│   └── protoc
├── include
│   └── google
├── lib
│   ├── libprotobuf-lite.a
│   ├── libprotobuf-lite.la
│   ├── libprotobuf-lite.so -> libprotobuf-lite.so.9.0.1
│   ├── libprotobuf-lite.so.9 -> libprotobuf-lite.so.9.0.1
│   ├── libprotobuf-lite.so.9.0.1
│   ├── libprotobuf.a
│   ├── libprotobuf.la
│   ├── libprotobuf.so -> libprotobuf.so.9.0.1
│   ├── libprotobuf.so.9 -> libprotobuf.so.9.0.1
│   ├── libprotobuf.so.9.0.1
│   ├── libprotoc.a
│   ├── libprotoc.la
│   ├── libprotoc.so -> libprotoc.so.9.0.1
│   ├── libprotoc.so.9 -> libprotoc.so.9.0.1
│   ├── libprotoc.so.9.0.1
│   └── pkgconfig
├── share
│   └── man
└── src
    ├── mosh-1.2.6
    ├── mosh-1.2.6.tar.gz
    ├── protobuf-2.6.1
    └── protobuf-2.6.1.tar.gz

Copy link

ghost commented May 6, 2018

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment