vagrant up
vagrant ssh
vagrant reload
vagrant halt
vagrant destroy # Just for destroying the image
vagrant port # Shows a list of the ports forwarded from the guest to the host machine
This file contains hidden or 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
| apt-get -y install software-properties-common | |
| apt-add-repository ppa:brightbox/ruby-ng | |
| sudo apt-get update | |
| apt-get install -y ruby2.1 ruby2.1-dev libruby2.1 | |
| gem install fluent-plugin-postgres |
This file contains hidden or 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
| # Use an official Python runtime as a base image | |
| FROM python:2.7-slim | |
| # Set the working directory to /app | |
| WORKDIR /app | |
| # Copy the current directory contents into the container at /app | |
| ADD . /app | |
| # Install any needed packages specified in requirements.txt |
This file contains hidden or 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
| // Load the http module to create an http server. | |
| var http = require('http'); | |
| // Configure our HTTP server to respond with Hello World to all requests. | |
| var server = http.createServer(function (request, response) { | |
| response.writeHead(200, {"Content-Type": "text/plain"}); | |
| response.end("Hello World\n"); | |
| }); | |
| // Listen on port 8000, IP defaults to 127.0.0.1 |
This file contains hidden or 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
| echo "*** Installing nginx packages... ***" | |
| apt-get install -y nginx-core | |
| mkdir /var/www/ | |
| echo "*** Setting stuff up... ***" | |
| STATIC_NGINX_CONF="/etc/nginx/conf.d/static.conf" | |
| echo "<h1>This is a static content server with nginx</h1>" >> /var/www/index.html | |
| echo "server {" > $STATIC_NGINX_CONF | |
| echo " listen 80;" >> $STATIC_NGINX_CONF | |
| echo " location / {" >> $STATIC_NGINX_CONF | |
| echo " root /var/www/;" >> $STATIC_NGINX_CONF |
This file contains hidden or 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
| - name: pull an image | |
| docker_image: | |
| name: pacur/centos-7 | |
| - name: Tag and push to docker hub | |
| docker_image: | |
| name: pacur/centos-7 | |
| repository: dcoppenhagan/myimage | |
| tag: 7.0 | |
| push: yes |
This file contains hidden or 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
| apt-get update | |
| apt-get install -y w3m vim docker nmap ngrep tmux |
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker run -d -p 4000:80 -n containername friendlyname # With the container name
docker run -dit --name apache2 apache2 # Run in the background
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
This file contains hidden or 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
| vagrant up | |
| vagrant ssh | |
| vagrant reload | |
| vagrant halt | |
| vagrant destroy # Never ever... |
This file contains hidden or 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
| proxy_cache_path /var/cache/nginx/sidebar levels=1:2 keys_zone=SIDEBAR:10m inactive=24h max_size=1g; | |
| upstream sidebar { | |
| ip_hash; | |
| server xxx.xxx.xx.xxx:80; | |
| server yyy.yyy.yy.yyy:80; | |
| } | |
| server { |