Skip to content

Instantly share code, notes, and snippets.

@fvosberg
Created December 10, 2015 21:15
Show Gist options
  • Save fvosberg/02a090f405a3b4ed4d93 to your computer and use it in GitHub Desktop.
Save fvosberg/02a090f405a3b4ed4d93 to your computer and use it in GitHub Desktop.
for i in $(docker-machine ls | grep digitalocean | awk '{print $1}'); \
do printf "\x1B[01;33m\n$i\n\x1B[0m" && docker-machine ssh $i ls /swapfile || \
docker-machine ssh $i -- \
"fallocate -l 1G /swapfile && chmod 600 /swapfile && mkswap /swapfile && \
echo -e '\n/swapfile none swap defaults 0 0' >> /etc/fstab && swapon -a && free -htl"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment