文件结构
.
|--bootstrap.sh
|--Vagrantfile
该代码用于安装一个centos虚拟机,并安装Docker
| // ==UserScript== | |
| // @name Visit Google Map with Japanese | |
| // @namespace https://gist.github.com/caliburn1994/ef993f676111627b9023f02d191c5d13 | |
| // @version 0.2 | |
| // @description Visit Google Map with Japanese | |
| // @author caliburn1994 | |
| // @match https://*.google.com/maps* | |
| // @exclude https://*.google.com/maps*hl=ja* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com | |
| // @updateURL https://gist.githubusercontent.com/caliburn1994/ef993f676111627b9023f02d191c5d13/raw/google-map-with-japanese.js | 
| user=www | |
| mkdir data keys public | |
| # copy public key to current dir, for safe. | |
| cp ${HOME}/.ssh/id_rsa.pub public/ | |
| docker run -ti -p 2222:22 \ | |
| -v $(pwd)/public/id_rsa.pub:/etc/authorized_keys/$(user) \ | |
| -v $(pwd)/keys/:/etc/ssh/keys \ | 
| mkdir data keys public | |
| # copy public key to current dir, for safe. | |
| cp ${HOME}/.ssh/id_rsa.pub public/ | |
| docker run -ti -p 2222:22 \ | |
| -v $(pwd)/public/id_rsa.pub:/root/.ssh/authorized_keys \ | |
| -v $(pwd)/keys/:/etc/ssh/keys \ | |
| -v $(pwd)/data/:/data/ \ | |
| -e SSH_ENABLE_ROOT=true \ | 
| mkdir entrypoint.d keys | |
| # for set password | |
| user=user1 | |
| password=pass123456 | |
| salt="KdN5Re3X2X18" | |
| hash_password=$(echo ${password} | mkpasswd --stdin --method=sha-512 --salt ${salt}) | |
| cat << EOF > entrypoint.d/setpasswd.sh | |
| #!/usr/bin/env bash | 
| Vagrant.configure("2") do |config| | |
| config.vm.box = "centos/7" | |
| # config.vm.network "public_network", ip: "192.168.0.180",bridge:"ens33" | |
| config.vm.provision :shell, path: "bootstrap.sh" | |
| config.vm.provision "shell",run: "always", inline: <<-SHELL | |
| ntpdate asia.pool.ntp.org | |
| SHELL | |
| // ==UserScript== | |
| // @name New Userscript | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match *www.google.com/* | |
| // @grant none | |
| // ==/UserScript== | 
| sudo curl --location https://raw.githubusercontent.com/hashicorp/vagrant/master/contrib/bash/completion.sh -o /etc/bash_completion.d/vagrant.sh | |
| source /etc/bash_completion.d/vagrant.sh | 
| # 依赖工具 | |
| # 参考:https://github.com/pyenv/pyenv/wiki/common-build-problems | |
| echo "下载依赖工具" | |
| sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
| libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ | |
| xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | |
| # ↑和平台有关 | |
| # ↓与平台无关 | |
| echo "安装pyenv" | 
文件结构
.
|--bootstrap.sh
|--Vagrantfile
该代码用于安装一个centos虚拟机,并安装Docker