- Ex 1:
let year = prompt('In which year was the ECMAScript-2015 specification published?', '');
if (year == 2015) {
alert( 'You guessed it right!' );
} else {
alert( 'How can you be so wrong?' ); // any value except 2015
| function exportData() { | |
| const table = $('.table').children("div") | |
| for (let i = 1; i < table.length; i++) { | |
| const rowData = table[i].childNodes | |
| let rank = ''; | |
| let name = '' | |
| let country = '' | |
| for (let j = 0; j < rowData[0].childNodes.length; j++) { | |
| const data = rowData[0].childNodes[j] | |
| if ($(data).hasClass('rank')) { |
| #! /bin/bash | |
| sudo apt-get install -yq dnsmasq | |
| sudo systemctl disable systemd-resolved.service | |
| echo "DNSStubListener=no" | sudo tee --append /etc/systemd/resolved.conf | |
| sudo systemctl restart systemd-resolved | |
| sudo rm /etc/resolv.conf | |
| echo "nameserver 127.0.0.1" | sudo tee /etc/resolv.conf | |
| echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf | |
| echo ' | |
| port=53 |
Complete the 1st part before you go on SET UP CLUSTER
cd ~ && echo "This cluster will be set up for 3 servers, each server will run (Nomad server/client + Consul server/client)
| #!/bin/bash | |
| sudo apt install -y unzip zip | |
| export CONSUL_VERSION=1.13.4 | |
| printf "Download & install consul ${CONSUL_VERSION}\n" | |
| export CONSUL_URL="https://releases.hashicorp.com/consul" | |
| curl --silent --remote-name \ | |
| ${CONSUL_URL}/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip | |
| unzip consul_${CONSUL_VERSION}_linux_amd64.zip | |
| sudo chown root:root consul | |
| sudo mv consul /usr/bin/ |
| #! /bin/bash | |
| sudo apt install -y unzip zip | |
| export NOMAD_VERSION=1.4.3 | |
| printf "Download & install nomad v${NOMAD_VERSION}\n" | |
| curl --silent --remote-name https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip | |
| unzip nomad_${NOMAD_VERSION}_linux_amd64.zip | |
| sudo chown root:root nomad | |
| sudo mv nomad /usr/local/bin/ | |
| nomad version | |
| nomad -autocomplete-install |