Skip to content

Instantly share code, notes, and snippets.

@LevitatingBusinessMan
Last active November 15, 2022 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LevitatingBusinessMan/540a2ffb48976c9d1b5c84304f9a913a to your computer and use it in GitHub Desktop.
Save LevitatingBusinessMan/540a2ffb48976c9d1b5c84304f9a913a to your computer and use it in GitHub Desktop.
Create juice shops
#!/bin/bash
set -e
lastport=`cat ~/.lastport || echo 4000`
newport=$(($lastport+1))
docker run -d -e "CTF_KEY=juicelympicsgobrrrrr" -e "NODE_ENV=ctf" -p $newport:3000 bkimminich/juice-shop
echo $newport > ~/.lastport
vhost=`echo $RANDOM | md5sum | head -c 5`
cat << END | sudo tee /etc/nginx/vhosts/$vhost.conf
server {
listen 80;
server_name $vhost.levitati.ng;
location / {
proxy_pass http://localhost:$newport;
}
}
END
sudo nginx -s reload
echo $vhost.levitati.ng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment