Skip to content

Instantly share code, notes, and snippets.

@muratayusuke
Last active December 19, 2015 03:28
Show Gist options
  • Save muratayusuke/5890049 to your computer and use it in GitHub Desktop.
Save muratayusuke/5890049 to your computer and use it in GitHub Desktop.
set up ubuntu with chef
#
# in host os
#
# create new box
host-os$ cd ~/projects/chef-repo
host-os$ git pull
host-os$ vagrant up
host-os$ vagrant ssh-config --host ubuntu1404 >> ~/.ssh/config
host-os$ knife configure
host-os$ vi ~/.chef/knife.rb
# sample knife.rb
log_level :debug
log_location STDOUT
node_name 'muratayusuke'
client_key '/Users/muratayusuke/.chef/muratayusuke.pem'
validation_client_name 'chef-validator'
validation_key '/etc/chef/validation.pem'
chef_server_url 'http://localhost:4000'
syntax_check_cache_path '/Users/muratayusuke/.chef/syntax_check_cache'
cookbook_path "site-cookbooks"
role_path "roles"
host-os$ ./run-knife-solo.sh ubuntu1404
#
# in guest os
#
# mount shared folder
sudo mkdir /mnt/projects
sudo vi /etc/rc.local
# add "mount.vboxsf -o rw,exec,uid=1001,gid=1001 projects /mnt/projects"
sudo mount.vboxsf -o rw,exec,uid=1001,gid=1001 projects /mnt/projects
# ssh key
ssh-keygen
cat ~/.ssh/id_rsa.pub
# set ssh-key to github, bitbucket and stash
# ssh settings
vi ~/.ssh/config
# add following:
# Host *
# ProtocolKeepAlives 60
# install ruby
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
exec $SHELL -l
rbenv global 2.1.2
rbenv rehash
exec $SHELL -l
# homesick
gem install homesick
rbenv rehash
homesick clone [email protected]:muratayusuke/dotfiles.git
homesick symlink
# add proxy to .zshrc if needed
# example:
# export http_proxy="hoge"
# use mozc via i-bus
ibus-setup
# change Input Method Switcher in Setting
# start Keyboard Input Method in Setting menu
# if you use dual display
vi ~/.zsh_local
# add "xrandr --output VBOX1 --auto --left-of VBOX0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment