Last active
April 18, 2020 23:51
Basic bootstrap script for vagrant.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gti="git" | |
alias gst="git status" | |
alias gbr="git branch" | |
alias glg="git log" | |
alias gfu="git fetch upstream" | |
alias gfo="git fetch origin" | |
alias gpo="git push origin" | |
alias gpu="git push upstream" | |
alias gd="git diff" | |
alias gdc="git diff --cached" | |
alias gs="git show" | |
alias gg="git grep" | |
alias be="bundle exec" | |
alias bs="bundle show" | |
alias bo="bundle open" | |
alias reloadbash="echo 'source ~/.bashrc'; source ~/.bashrc" | |
alias e="emacs" | |
alias publishblog="s3cmd sync --delete-removed --acl-public --no-preserve --cf-invalidate _site/ s3://yukinishijima-blog/ --verbose" | |
if [ -f ~/.bash_yuki24 ]; then | |
. ~/.bash_yuki24 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ -s ~/.bashrc ]] && source ~/.bashrc | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
function prompt { | |
local BLACK="\[\033[0;30m\]" | |
local BLACKBOLD="\[\033[1;30m\]" | |
local RED="\[\033[0;31m\]" | |
local REDBOLD="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local GREENBOLD="\[\033[1;32m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local YELLOWBOLD="\[\033[1;33m\]" | |
local BLUE="\[\033[0;34m\]" | |
local BLUEBOLD="\[\033[1;34m\]" | |
local PURPLE="\[\033[0;35m\]" | |
local PURPLEBOLD="\[\033[1;35m\]" | |
local CYAN="\[\033[0;36m\]" | |
local CYANBOLD="\[\033[1;36m\]" | |
local WHITE="\[\033[0;37m\]" | |
local WHITEBOLD="\[\033[1;37m\]" | |
local RESETCOLOR="\[\e[00m\]" | |
export PS1="$GREEN\u$RESETCOLOR:$BLUE\w$RESETCOLOR$ " | |
} | |
prompt | |
eval "$(rbenv init -)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Squash the following warning: | |
# perl: warning: Setting locale failed. | |
# perl: warning: Please check that your locale settings: | |
# LANGUAGE = "en_US:", | |
# LC_ALL = (unset), | |
# LC_CTYPE = "UTF-8", | |
# LANG = "en_US.utf8" | |
# are supported and installed on your system. | |
# perl: warning: Falling back to the standard locale ("C"). | |
# locale: Cannot set LC_CTYPE to default locale: No such file or directory | |
# locale: Cannot set LC_ALL to default locale: No such file or directory | |
# | |
# More details here: http://stackoverflow.com/questions/2499794/how-can-i-fix-a-locale-warning-from-perl | |
export LANGUAGE="en_US.utf8" | |
export LANG="en_US.utf8" | |
export LC_ALL="en_US.utf8" | |
export LC_MESSAGES="en_US.utf8" | |
# Load RVM into a shell session *as a function* | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
# This loads NVM | |
[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh | |
git config --global user.name "Yuki Nishijima" | |
git config --global user.email mail@yukinishijima.net | |
git config --global core.editor emacs | |
git config --global push.default matching | |
git config --global alias.co checkout | |
git config --global alias.ci commit | |
git config --global alias.st status | |
git config --global alias.br branch | |
git config --global alias.tags 'tag -l' | |
git config --global alias.hist 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short' | |
git config --global alias.type 'cat-file -t' | |
git config --global alias.dump 'cat-file -p' | |
git config --global alias.amend 'commit --amend -Chead' | |
export EDITOR=emacs | |
# Cask needs this | |
export PATH="/root/.cask/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cask/ | |
.vagrant/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Add MongoDB repository | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y git emacs build-essential silversearcher-ag tree tcl8.5 memcached mongodb-org | |
# nokogiri requirements | |
apt-get install -y libxslt-dev libxml2-dev | |
# pg gem requirements | |
apt-get install -y postgresql postgresql-server-dev-9.3 postgresql-contrib | |
# Installs nvm. picked up from: | |
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server | |
curl https://raw.githubusercontent.com/creationix/nvm/v0.25.1/install.sh | sh | |
source ~/.profile | |
# Installs rvm | |
curl -sSL https://get.rvm.io | bash | |
/usr/local/rvm/bin/rvm reload | |
/usr/local/rvm/bin/rvm install ruby | |
/usr/local/rvm/bin/rvm use ruby --default | |
chown -R vagrant /usr/local/rvm | |
# Installs phantomjs | |
cd /usr/local/share | |
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 | |
tar xjf phantomjs-1.9.8-linux-x86_64.tar.bz2 | |
ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs | |
ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs | |
ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/bin/phantomjs | |
# Installs redis | |
cd /tmp | |
wget http://download.redis.io/releases/redis-3.0.1.tar.gz | |
tar xzf redis-3.0.1.tar.gz | |
cd redis-3.0.1 | |
make | |
make install | |
cd utils | |
./install_server.sh | |
cd /home/vagrant | |
ln -s /GitHub/Vagrant/.bash_aliases /home/vagrant/.bash_aliases | |
ln -s /GitHub/Vagrant/.bash_yuki24 /home/vagrant/.bash_yuki24 | |
# installs cask | |
curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python | |
export PATH="/home/vagrant/.cask/bin:$PATH" | |
# sets up emacs for me | |
cd /GitHub | |
git clone git://github.com/yuki24/emacs.el.git site-lisp | |
cd site-lisp && git checkout vagrant | |
ln -s /GitHub/site-lisp/.emacs.el /home/vagrant/.emacs.el | |
mkdir /home/vagrant/.emacs.d | |
ln -s /GitHub/Vagrant/Cask /home/vagrant/.emacs.d/Cask | |
cd /home/vagrant/.emacs.d | |
cask install | |
chown vagrant -R /home/vagrant | |
# postgres config | |
su - postgres -c "createuser vagrant -d -r -s" | |
echo "Change /etc/postgresql/{version}/main/pg_hba.conf to always trust local connection:" | |
echo " http://stackoverflow.com/questions/5421807/set-blank-password-for-postgresql-user" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(source gnu) | |
(source melpa) | |
(depends-on "bind-key") | |
(depends-on "cask") | |
(depends-on "dash") | |
(depends-on "drag-stuff") | |
(depends-on "exec-path-from-shell") | |
(depends-on "expand-region") | |
(depends-on "f") | |
(depends-on "flycheck") | |
(depends-on "flycheck-cask") | |
(depends-on "htmlize") | |
(depends-on "idle-highlight-mode") | |
(depends-on "magit") | |
(depends-on "multiple-cursors") | |
(depends-on "nyan-mode") | |
(depends-on "pallet") | |
(depends-on "popwin") | |
(depends-on "prodigy") | |
(depends-on "projectile") | |
(depends-on "projectile-rails") | |
(depends-on "s") | |
(depends-on "smartparens") | |
(depends-on "smex") | |
(depends-on "use-package") | |
(depends-on "web-mode") | |
(depends-on "sass-mode") | |
(depends-on "scss-mode") | |
(depends-on "less-css-mode") | |
(depends-on "haml-mode") | |
(depends-on "coffee-mode") | |
(depends-on "rainbow-mode") | |
(depends-on "markdown-mode") | |
(depends-on "enh-ruby-mode") | |
(depends-on "auto-complete") | |
(depends-on "ag") | |
(depends-on "robe") | |
(depends-on "inf-ruby") | |
(depends-on "rinari") | |
(depends-on "yasnippet") | |
(depends-on "multiple-cursors") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "puppetlabs/ubuntu-14.04-64-puppet" | |
config.vm.network :forwarded_port, guest: 3000, host: 3000 | |
# config.vm.network :private_network, ip: "192.168.33.10" | |
# config.vm.network :public_network | |
config.ssh.forward_agent = true | |
config.vm.synced_folder "~/GitHub", "/GitHub" | |
config.vm.provider "vmware_fusion" do |v| | |
v.vmx["memsize"] = "2048" | |
v.vmx["numvcpus"] = "4" | |
end | |
config.vm.provision :shell, path: "bootstrap.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment