This challenge will test the following skills:
- Kubernetes orchestration
- CI systems
- REST APIs
- Scripting
// https://nodejs.org/docs/v12.22.10/api/perf_hooks.html | |
const { | |
performance | |
} = require('perf_hooks'); | |
//#1 -- For loop in Javascript. | |
const fish = ['dory', 'bruce', 'marlin', 'nemo']; | |
const nemo = ['nemo']; | |
const everyone = ['dory', 'bruce', 'marlin', 'nemo', 'gill', 'bloat', 'nigel', 'squirt', 'darla', 'hank']; | |
const large = new Array(10).fill('nemo'); |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/bionic64" | |
config.vm.define "docker-1" do |node| | |
node.vm.hostname = "docker-1" | |
config.vm.box_check_update = false | |
config.vm.network "public_network" | |
config.vm.provider "virtualbox" do |vb| | |
vb.name = "docker-1" | |
vb.memory = "2048" |
import random | |
def get_char(chars): | |
random_char = random.choice(chars) | |
if random.randrange(2): | |
return random_char.upper() | |
return random_char | |
def gen(length): | |
password = "" |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"os" | |
) | |
var hostname string |
#!/bin/bash | |
yum update -y | |
sudo amazon-linux-extras install nginx1 -y | |
sudo systemctl start nginx.service | |
sudo systemctl enable nginx.service |
from flask import Flask, render_template, session, copy_current_request_context, jsonify | |
from flask_socketio import SocketIO, emit, disconnect | |
from threading import Lock | |
async_mode = None | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = 'ceafa6fe-f968-4d7d-8583-4252c5ab54a4' # change me | |
socketio = SocketIO(app, async_mode=async_mode) | |
thread = None |
import docker | |
import os | |
def run_container(container_name): | |
client = docker.from_env() | |
client.containers.run(container_name, ports={8080:8080}, detach=True) | |
def get_id(container_name): | |
client = docker.from_env() |
from collections import Counter | |
def withdraw_one(amount): | |
bills = [100,50,20] | |
memo = [amount + 1] * (amount + 1) | |
bills_results = [[]] * (amount+1) | |
d = {100:0, 50:0, 20:0} | |
memo[0] = 0 |
version: '3' | |
services: | |
# Database | |
db: | |
image: mariadb:latest | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: |