Skip to content

Instantly share code, notes, and snippets.

View jonaskahn's full-sized avatar
🇩🇪
I'm on it

Jonas jonaskahn

🇩🇪
I'm on it
View GitHub Profile

Let & const

let and const are the block scoped

A block is a chunk of code bounded by {}. A block lives in curly braces. Anything within curly braces is a block.

  • Ex1:
let greeter = "hey hi";

if (1) {

VAR

Scope essentially means where these variables are available for use. var declarations are globally scoped or function/locally scoped.

  • Ex1
var greeter = "hey hi";

if (1) {
    var hello = "hello";
    console.log(hello);
    console.log(greeter);
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')) {
@jonaskahn
jonaskahn / SSL-certs-OSX.md
Created December 12, 2022 14:22 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

#! /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

Practice Consul, Nomad in Production Part 2 - Setup DNS and Make Basic Jobs

Complete the 1st part before you go on SET UP CLUSTER

DEPLOY TRAEFIK

  1. Create service Policy
cd ~ &&  echo "

Practice Consul, Nomad in Production Part 1- Setup Cluster

This cluster will be set up for 3 servers, each server will run (Nomad server/client + Consul server/client)

Follow my new instruction here

#!/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
#!/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/