├── .gitignore ├── README.org ├── Vagrantfile ├── clojure_emacs.sh └── dotfiles ├── .emacs.d ├── eshell │ └── alias └── init.el ├── .profile └── .tmux.conf /.gitignore: -------------------------------------------------------------------------------- 1 | /.vagrant 2 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | * Vagrant setup for Seajure hack nights. 2 | As an attempt to get a reasonable development environment quickly for Seajure hacknights, I setup a shareable virtualbox via Vagrant. Let's all play along! 3 | ** Setup 4 | - Install [[http://www.virtualbox.org/wiki/Downloads][VirtualBox 4.x]] 5 | - Install [[http://download.virtualbox.org/virtualbox/4.0.8/Oracle_VM_VirtualBox_Extension_Pack-4.0.8-71778.vbox-extpack][VirtualBox Extension Pack]] 6 | - =gem install vagrant= # install rubygems first if necessary 7 | - =vagrant up= # inside the directory containing this readme 8 | ** Usage 9 | Once Vagrant provisions your VM, use =vagrant ssh= to log in. Your 10 | VM will have a Jark swank session running, so you can immediately 11 | start Emacs and do =M-x slime-connect= to port 4005. You can start 12 | a new project with =lein new myproject= or pull down an existing 13 | project to hack on via git. 14 | ** Contents 15 | - Emacs 24 (with starter kit 2 and relevant Clojure modes) 16 | - tmux (with better config) 17 | - [[http://github.com/technomancy/leiningen][Leiningen]] 18 | - [[http://icylisper.in/jark/][Jark]] 19 | ** Troubleshooting 20 | A standard Ubuntu 10.04 install (YMMV for other distros/versions) doesn't have the appropriate ruby setup and needs 21 | some additional =apt-get=-ing to install vagrant. Assuming only that VirtualBox is installed, the following additional 22 | steps need to be performed before you can run =gem install vagrant=: 23 | - Run =sudo apt-get install rubygems1.8 ruby-dev libopenssl-ruby= 24 | - Next do a =sudo gem install rubygems-update= and =sudo /var/lib/gems/1.8/bin/update_rubygems= to get the latest rubygems 25 | At this point you should be able to do a =gem install vagrant= 26 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant::Config.run do |config| 2 | config.vm.box = "natty32" 3 | config.vm.box_url = "http://dl.dropbox.com/u/7490647/talifun-ubuntu-11.04-server-i386.box" 4 | config.vm.provision :shell, :path => "clojure_emacs.sh" 5 | end 6 | -------------------------------------------------------------------------------- /clojure_emacs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | shopt -s dotglob 4 | 5 | # Thanks to @bretthoerner for the ubuntu mirror of emacs 24 6 | wget -q -O - http://emacs.naquadah.org/key.gpg | sudo apt-key add - 7 | echo "deb http://emacs.naquadah.org/ natty/ 8 | deb-src http://emacs.naquadah.org/ natty/" >> /etc/apt/sources.list.d/naquadah.list 9 | sudo apt-get update 10 | sudo apt-get install -y emacs-snapshot git-core rlwrap openjdk-6-jdk tmux \ 11 | curl tree unzip 12 | 13 | # dotfiles 14 | mkdir -p ~/bin/ 15 | for i in /vagrant/dotfiles/*; do 16 | cp -r $i $HOME/ 17 | done; 18 | emacs --batch -l .emacs.d/init.el -f package-updates 19 | 20 | # Leiningen 21 | if [ ! -r ~/bin/lein ]; then 22 | wget -O ~/bin/lein https://github.com/technomancy/leiningen/raw/stable/bin/lein 23 | chmod +x ~/bin/lein 24 | ~/bin/lein self-install 25 | fi 26 | 27 | # Jark 28 | if [ ! -r ~/bin/jark ]; then 29 | wget -O ~/bin/jark https://github.com/downloads/icylisper/jark/jark-0.3 30 | chmod +x ~/bin/jark 31 | ~/bin/jark install 32 | fi 33 | 34 | chown -R vagrant ~ 35 | -------------------------------------------------------------------------------- /dotfiles/.emacs.d/eshell/alias: -------------------------------------------------------------------------------- 1 | alias gerp grep 2 | alias top proced 3 | alias client-jvm export JAVA_CMD=/usr/lib/jvm/ia32-java-6-sun/bin/java 4 | alias server-jvm export JAVA_CMD=/usr/lib/jvm/java-6-openjdk/bin/java 5 | alias lcdt lein clean && lein deps && lein test 6 | alias lcd lein clean && lein deps 7 | alias emacs find-file $1 8 | alias jake jruby -S rake 9 | alias lh ls -l -h $* 10 | alias ll ls -l $* 11 | alias la ls -a $* 12 | alias l ls -a -l $* 13 | alias sapti sudo apt-get install $* 14 | alias saptc apt-cache search $* 15 | alias sapts apt-cache show $* 16 | alias saptr sudo apt-get remove $* 17 | alias saptu sudo apt-get upgrade $* 18 | alias saptd sudo apt-get update $* 19 | alias sagi sudo gem install $* 20 | alias sagr sudo gem uninstall $* 21 | alias sagd sudo gem source -u 22 | alias sagc gem search --remote $* 23 | alias gst git status 24 | alias gb git branch $* 25 | alias gbv git branch -v $* 26 | alias gcm git commit -a -v 27 | alias gco git checkout $* 28 | alias clojars lein jar && lein pom && scp pom.xml *jar clojars@clojars.org: 29 | alias jdk7 export JAVA_CMD=/usr/lib/jvm/java-7-openjdk/jre/bin/java 30 | alias cdf mkdir -p 31 | alias glt git log -n 10 32 | alias kni knife ssh $* -a ec2.public_hostname 33 | alias kniu knife ssh $* uptime -a ec2.public_hostname 34 | alias knis knife ssh "role:safe*" $* -a ec2.public_hostname 35 | alias knisu knife ssh "role:safe*" uptime -a ec2.public_hostname 36 | -------------------------------------------------------------------------------- /dotfiles/.emacs.d/init.el: -------------------------------------------------------------------------------- 1 | (require 'package) 2 | (add-to-list 'package-archives 3 | '("marmalade" . "http://marmalade-repo.org/packages/") t) 4 | (package-initialize) 5 | 6 | (setq slime-net-coding-system 'utf-8-unix) 7 | 8 | (global-set-key (kbd "C-c C-j") 'clojure-jack-in) 9 | 10 | (set-face-foreground 'vertical-border 11 | (face-attribute 'vertical-border :background)) 12 | 13 | (eval-after-load 'hl-line 14 | '(set-face-background 'hl-line "darkseagreen2")) 15 | 16 | (add-hook 'eshell-mode-hook 17 | '(lambda () (fmakunbound 'eshell/sudo) 18 | (fmakunbound 'eshell/su))) 19 | 20 | (defun package-updates () 21 | (interactive) 22 | (package-refresh-contents) 23 | (dolist (p '(clojure-mode slime slime-repl clojure-test-mode magit 24 | paredit starter-kit starter-kit-lisp 25 | scpaste idle-highlight-mode)) 26 | (when (not (package-installed-p p)) 27 | (package-install p)))) 28 | -------------------------------------------------------------------------------- /dotfiles/.profile: -------------------------------------------------------------------------------- 1 | export PATH=$HOME/bin:$PATH 2 | jark > /dev/null || jark vm start > /dev/null 3 | jark swank start > /dev/null 4 | -------------------------------------------------------------------------------- /dotfiles/.tmux.conf: -------------------------------------------------------------------------------- 1 | setw -g xterm-keys on 2 | set -g status-bg colour111 3 | 4 | bind C-d detach 5 | bind C-e neww 'exec emacs -nw' 6 | bind r source-file ~/.tmux.conf 7 | 8 | # C-b as the default sequence? not much better than screen =( 9 | set -g prefix C-z 10 | unbind C-b 11 | bind C-z send-prefix 12 | bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'" 13 | 14 | set -g status-bg black 15 | set -g status-fg green 16 | set -g status-left-length 15 17 | set -g status-left ' #[fg=cyan,bright]#10H#[fg=green]:#[fg=white]#S#[fg=green] | #[default]' 18 | set -g status-right '| #[fg=yellow]%Y-%m-%d %H:%M ' 19 | set -g status-justify centre 20 | setw -g window-status-current-fg cyan 21 | setw -g window-status-current-attr bright 22 | --------------------------------------------------------------------------------