Skip to content

Instantly share code, notes, and snippets.

@jbeda
Last active September 8, 2023 07:47
Show Gist options
  • Save jbeda/621fe2680e570861af722ee2f00b0397 to your computer and use it in GitHub Desktop.
Save jbeda/621fe2680e570861af722ee2f00b0397 to your computer and use it in GitHub Desktop.
Unison install
# linux
UNISON_VERSION=2.48.4
sudo apt-get -y install inotify-tools ocaml-nox build-essential
curl -L https://github.com/bcpierce00/unison/archive/${UNISON_VERSION}.tar.gz | tar zxv -C /tmp
cd /tmp/unison-${UNISON_VERSION}
sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c
make UISTYLE=text NATIVE=true STATIC=true
cp src/unison src/unison-fsmonitor ~/bin
# You should modify your path to include ~/bin
# macOS
brew install unison
curl "https://raw.githubusercontent.com/hnsl/unox/master/unox.py" -o "/usr/local/bin/unison-fsmonitor"
chmod +x /usr/local/bin/unison-fsmonitor
pip install macfsevents
# This goes in ~/.unison
# automatically accept default (nonconflicting) actions
auto = true
# batch mode: ask no questions at all
batch = true
# Keep going based on watching files
repeat = watch
# Don't try and sync OSX resource forks
rsrc = false
log = false
terse = true
ignore = Name ._*
ignore = Regex .*/kubernetes/build
ignore = Regex (^|/)go/(pkg|bin)
# Activate with `unison gcp-ws`
# Assumes you have an entry in your ~/.ssh/config set up for `gcp-ws`
include auto-base
root = /Users/jbeda/unison/gcp-ws
root = ssh://gcp-ws//home/jbeda/src
# this is part of ~/.ssh/config
Host gcp-ws
User jbeda
HostName 1.2.3.4
IdentityFile ~/.ssh/google_compute_engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment