Containers, Cloud and DevOps (88 hours).
Virtualization and containers, Docker, DevOps, cloud technologies and platforms. Exercises with Docker, Azure and GitHub Actions.
let elliptic = require('elliptic'); | |
let sha3 = require('js-sha3'); | |
let ec = new elliptic.ec('secp256k1'); | |
// let keyPair = ec.genKeyPair(); | |
let keyPair = ec.keyFromPrivate("97ddae0f3a25b92268175400149d65d6887b9cefaf28ea2c078e05cdc15a3c0a"); | |
let privKey = keyPair.getPrivate("hex"); | |
let pubKey = keyPair.getPublic(); | |
console.log(`Private key: ${privKey}`); | |
console.log("Public key :", pubKey.encode("hex").substr(2)); |
ffmpeg version 2020-11-29-git-f194cedfe6-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers | |
built with gcc 10.2.0 (Rev5, Built by MSYS2 project) | |
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable |
def modular_sqrt(a, p): | |
def legendre_symbol(a, p): | |
""" Compute the Legendre symbol a|p using | |
Euler's criterion. p is a prime, a is | |
relatively prime to p (if p divides | |
a, then a|p = 0) | |
Returns 1 if a has a square root modulo | |
p, -1 otherwise. |
const aes = require("aes-js"); | |
const argon2 = require("argon2"); | |
const crypto = require("crypto"); | |
const cryptoJS = require("crypto-js"); | |
// Encrypt using AES-256-CTR-Argon2-HMAC-SHA-256 | |
async function aes256ctrEncrypt(plaintext, password) { | |
let argon2salt = crypto.randomBytes(16); // 128-bit salt for argon2 | |
let argon2Settings = { type: argon2.argon2di, raw: true, | |
timeCost: 8, memoryCost: 2 ** 15, parallelism: 2, |
import org.bouncycastle.util.encoders.Hex; | |
import org.web3j.crypto.*; | |
import java.math.BigInteger; | |
public class ECCExample { | |
public static String compressPubKey(BigInteger pubKey) { | |
String pubKeyYPrefix = pubKey.testBit(0) ? "03" : "02"; | |
String pubKeyHex = pubKey.toString(16); | |
String pubKeyX = pubKeyHex.substring(0, 64); |
import { sleep, group, check } from "k6"; | |
import http from "k6/http"; | |
export let options = { | |
thresholds: { | |
// 95% of requests must finish within 500 ms & 99% within 1500 ms | |
http_req_duration: ['p(95) < 500', 'p(99) < 1500'], | |
}, | |
}; |
Shelly.call( | |
"HTTP.GET", | |
{"url": "https://api.zippopotam.us/us/90210"}, | |
function (response) { | |
if (response && response.code && response.code === 200) { | |
print(JSON.stringify(response.body)); | |
Shelly.emitEvent("HTTP-result", response.body); | |
} | |
else { | |
print("Error: HTTP request failed."); |
function shellyPlugSChangeLEDColor(red, green, blue, brightness) { | |
let config = { | |
"config": { | |
"leds": { | |
"colors": { | |
"switch:0": { | |
"on": { | |
"rgb": [red, green, blue], | |
"brightness": brightness | |
} |
Num (standard): 123.131000 | |
Num (no trailing zeros): 123.131 |