Skip to content

Instantly share code, notes, and snippets.

@obfusk
Last active December 17, 2015 17:38
Show Gist options
  • Save obfusk/5646916 to your computer and use it in GitHub Desktop.
Save obfusk/5646916 to your computer and use it in GitHub Desktop.
test VM: vagrant, etckeeper, postgresql, mongodb, ...

[]: {{{1

File        : README.md
Maintainer  : Felix C. Stegerman <[email protected]>
Date        : 2013-05-25

[]: }}}1

Host

[]: {{{1

$ mkdir -p ~/tmp/vagrant/testing && cd ~/tmp/vagrant/testing
$ vim Vagrantfile
$ vagrant up && vagrant ssh

Optional

$ vagrant ssh-config > .ssh-config
$ vim .ssh .ssh-byobu ; chmod +x .ssh .ssh-byobu

Instead of editing Vagrantfile, .ssh, and .ssh-byobu, you can clone this gist or get them using curl.

[]: }}}1

VM

Basics

[]: {{{1

$ cd /opt/VBoxGuestAdditions-4.2.0 && sudo ./uninstall.sh
$ sudo aptitude update && sudo aptitude safe-upgrade
$ sudo aptitude install virtualbox-guest-utils \
  virtualbox-guest-x11-
$ sudo aptitude install build-essential byobu curl git grc htop \
  tree vim
$ sudo aptitude purge nfs-common rpcbind

[]: }}}1

etckeeper

[]: {{{1

$ sudo aptitude install etckeeper
$ sudo vim /etc/etckeeper/etckeeper.conf  # VCS=git

$ cd /etc
$ sudo etckeeper init
$ sudo git status
$ sudo git commit -m init
$ sudo git gc

[]: }}}1

Utils

[]: {{{1

$ mkdir -p ~/opt/src && cd ~/opt/src
$ git clone https://gist.github.com/4260039.git sh-config
$ git clone https://github.com/obfusk/dev-misc.git

$ cd
$ ln -s opt/src/dev-misc/screenrc .screenrc_
$ ln -s opt/src/dev-misc/vimrc .vimrc
$ vim -p .bashrc .profile   # --> sh-config/ + LC_ALL=C

[]: }}}1

Config

[]: {{{1

$ byobu-select-backend && byobu-ctrl-a
$ git config --global user.name "Felix C. Stegerman"
$ git config --global user.email ...
$ git config --global color.ui true

[]: }}}1

MongoDB + PostgreSQL

[]: {{{1

$ sudo aptitude install mongodb postgresql-9.1

$ mongo admin
> db.addUser('admin','password')

$ sudo vim /etc/mongodb.conf  # auth = true; --> etckeeper
$ sudo service mongodb restart

[]: }}}1

TODO

  • remove/add packages ???

[]: ! ( vim: set tw=70 sw=2 sts=2 et fdm=marker : )

#!/bin/bash
ssh -F .ssh-config default "$@"
#!/bin/bash
./.ssh -t byobu bash -l
Vagrant::Config.run do |config|
config.vm.box = 'precise64'
config.vm.customize ['modifyvm', :id, '--memory', 512]
end
Vagrant::Config.run do |config|
config.vm.box = 'precise64'
config.vm.customize ['modifyvm', :id, '--memory', 512, '--cpus', 1]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment