Skip to content

Instantly share code, notes, and snippets.

@MorrisJobke
Created June 10, 2016 16:41
Show Gist options
  • Save MorrisJobke/79646f88396213e24d08ea7ec8f219fc to your computer and use it in GitHub Desktop.
Save MorrisJobke/79646f88396213e24d08ea7ec8f219fc to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$2" ]; then
echo "Usage: ./add-domain.sh DOMAIN INTERNAL_URL"
exit 1;
fi
DOMAIN=$1
INTERNAL=$2
cp /etc/nginx/sites-available/TEMPLATE /etc/nginx/sites-available/$DOMAIN
sed -i -e "s/EXTERNAL_DOMAIN/$DOMAIN/" /etc/nginx/sites-available/$DOMAIN
sed -i -e "s/INTERNAL_URL/$INTERNAL/" /etc/nginx/sites-available/$DOMAIN
echo $DOMAIN >> /etc/letsencrypt.sh/domains.txt
ln -s ../sites-available/$DOMAIN /etc/nginx/sites-enabled/$DOMAIN
service nginx reload
su letsencrypt -c "~/letsencrypt.sh/letsencrypt.sh -c"
service nginx reload
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: ./create-new-machine.sh NAME"
exit 1;
fi
:
CPUS=1
MEMORY=512
DISK=50
virt-install --connect qemu:///system -n $1 \
--vcpus=$CPUS -r $MEMORY \
-f /var/lib/libvirt/images/$1.img -s $DISK \
--network network=default,model=virtio \
-c /opt/images/ubuntu-14.04.4-server-amd64.iso \
--graphics vnc,listen=0.0.0.0,password=REPLACETHISWITHSOMETHINGSECRET \
--autostart --noautoconsole -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment