GithubHelp home page GithubHelp logo

haskell-pair's Introduction

Installation

on a local virtualbox

  1. Clone this repo
  2. Install Vagrant and VirtualBox
  3. vagrant up
  4. vagrant ssh

This will create a clean dev environment with the newest GHC and Cabal. It also includes haskell-vim-now, a vim configured to be a Haskell IDE.

on a public pair programming server

  1. Clone this repo
  2. Install Vagrant
  3. Sign up at DigitalOcean
  4. Fill out your DigitalOcean client ID and API key in Vagrantfile
  5. vagrant plugin install vagrant-digitalocean
  6. vagrant box add digital_ocean https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box
  7. vagrant up --provider=digital_ocean
  8. vagrant ssh

You'll be logged in to a newly created DigitalOcean "droplet."

ps: for some reason I had to create a ssh key with a password otherwise I could not get ssh access to the box

Included software

  1. Ubuntu 16.04
  2. New GHC via Stack
  3. haskell-vim-now
  4. SixArm git config
  5. Firewall, hardened OpenSSH, Fail2ban
  6. Oh My ZSH, Tmux/wemux
  7. Mumble voice chat server (port 64738)

Pairing

To pair program with someone you can give them login access by running

pair github_name

They connect to your server by ssh-add'ing their Github SSH key and running ssh friend@[your-server-ip].

When you're done working with them, run

unpair

Tmux Keybindings

C-a |Split vertically
C-a _Split horizontally
C-hMove to leftward pane
C-lMove to rightward pane
C-jMove to downward pane
C-kMove to upward pane
C-a [Detach cursor to scroll (ENTER stops)
C-a cCreate new window
C-a [0-9]Switch to numbered window

Publishing a bare git repo to export work (safest)

To safely write code in the pairing environment and then export it to some kind of github account, you'll probably want to create a bare-repo locally on the pairing server, push your development to that, and then pull your new work onto your safe local development laptop, where you can then push it to your gitlab/ github server safely.

On Pairing Server
# Creating a bare repo, a safe portal allowing code to flow into safer places
$ sudo mkdir /pairing && sudo chown ${USER} /pairing
$ mkdir /pairing/my_project && cd "$_"
$ git init --bare

On Your Local System
# Push the code to the remote
$ git remote add pairing-server:/pairing/my_project
$ git push pairing-server master
On Pairing Server
# Clone the bare repo, and start hacking
$ mkdir ~/dev && cd ~/dev
$ git clone /pairing/my_project
$ cd my_project

$ echo 'hi' >> README.md && git add . && git commit -m "adds a thing"
$ git push origin master # it's now waiting in the portal :)
On Your Local System
# Collect the new code
$ git pull pairing-server master

SSH agent forwarding (for use with trusted pairs)

If both parties trust each other, then user agent forwarding can be enabled to allow convienient access to your github repos through the pairing server. But if trust has not been established, forwarding your user agent can potentially allow one of the pairs usage of all the private keys in your local machine's user agent, and these keys could potentially be misused to access remote machines or delete github repos, etc, etc.

Understanding the risks, to access your github repos on the pairing server use agent forwarding.

Edit your local ~/.ssh/config file and add an entry for your pair server host.

Host [ip address]
  ForwardAgent yes

Before ssh'ing into the pairing server run

ssh-add ~/.ssh/[keyname]

and it will be available remotely. To test agent forwarding run this remotely

haskell-pair's People

Contributors

begriffs avatar dnnx avatar nrolland avatar qzchenwl avatar thenotary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

haskell-pair's Issues

Necessary changes to Vagrantfile

Thanks for creating haskell-vim-now and haskell-pair.

I was able to get haskell-pair working but the following general changes must be made to the Vagrantfile.

  1. provider.image must be 'ubuntu-14-04-x64'

  2. provider.size must be at least '4GB', otherwise cabal will not build.

.box refresh needed?

I did a vagrant up and vagrant ssh and ran into this:

maintainence

More outputs at the end of the vagrant up:

==> default: --:--:-- --:--:--  4758
==> default: Cloning Oh My Zsh...
==> default: Cloning into '/home/vagrant/.oh-my-zsh'...
==> default: Looking for an existing zsh config...
==> default: Using the Oh My Zsh template file and adding it to ~/.zshrc
==> default: Time to change your default shell to zsh!
==> default: Password: 
==> default: chsh: PAM: Authentication failure
==> default: -----> Customizing .zshrc
==> default: Password: 
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20170521-26057-u66nvg.sh
==> default: -----> Using Sixarm git config
==> default: Cloning into '/tmp/sixarm-gitconfig'...
==> default: Running provisioner: shell...
    default: Running: /tmp/vagrant-shell20170521-26057-1anolak.sh
==> default: -----> Installing mumble chat server
==> default: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
==> default: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
==> default: -----> Configuring mumble chat server
==> default: debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
==> default: debconf: DbDriver "config": could not write /var/cache/debconf/config.dat-new: Permission denied
==> default: cp: cannot create regular file '/etc/mumble-server.ini': Permission denied
==> default: Failed to restart mumble-server.service: Interactive authentication required.
==> default: See system logs and 'systemctl status mumble-server.service' for details.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Disclaimer: There's a slight chance I just don't know how to use zsh =/

Problems with pre-compiled binaries.

.haskell-vim-now/bin [master●] » ./hoogle data
hoogle: /root/.haskell-vim-now/data/x86_64-linux-ghc-7.8.2/hoogle-4.2.33/databases: changeWorkingDirectory: permission denied (Permission denied)

.haskell-vim-now/bin [master●] » strings hoogle| grep '/root'
/root/.haskell-vim-now/data/x86_64-linux-ghc-7.8.2/hoogle-4.2.33
/root/.haskell-vim-now/data/x86_64-linux-ghc-7.8.2/warp-3.0.0.3
/root/.haskell-vim-now/data/x86_64-linux-ghc-7.8.2/shake-0.13.2

.haskell-vim-now/bin [master●] » for file in *; do strings $file | grep '/root' >/dev/null && echo $file ; done
codex
hoogle
shake

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.