We’ll configure one MySQL instance as the source database and another as its replica. Replication allows data synchronization between these separate databases.
- Obviously install MySQL on 2 servers.
const nlp = require("compromise"); | |
const nameParser = require("name-parser"); | |
// Function to determine the name format | |
function determineNameFormat(name) { | |
// Patterns to match different name formats | |
const firstLast = nlp(name).match("#Honorific #FirstName #LastName").out("array"); | |
const lastFirst = nlp(name).match("#LastName, #FirstName #Honorific").out("array"); | |
const middleName = nlp(name).match("#FirstName #MiddleName #LastName").out("array"); | |
const middleInitial = nlp(name).match("#FirstName #MiddleInitial #LastName").out("array"); |
Here is an example of using JavaScript generators to handle multiple HTTP requests in a sequential manner:
const fetch = require("node-fetch");
function* fetchUsers() {
const user1 = yield fetch("https://jsonplaceholder.typicode.com/users/1");
const user2 = yield fetch("https://jsonplaceholder.typicode.com/users/2");
#!/bin/bash | |
sudo apt install sssd heimdal-clients msktutil | |
sudo mv /etc/krb5.conf /etc/krb5.conf.default | |
COMP=$HOSTNAME | |
read -p 'What is the domain name? (example: URLFINANCIAL without the .local) ' DOMAIN | |
LCASEDOMAIN=`echo "$DOMAIN" | tr '[:upper:]' '[:lower:]'` |
FROM ubuntu:latest | |
RUN apt-get update \ | |
&& apt-get install -y python3-pip python3-dev \ | |
&& cd /usr/local/bin \ | |
&& ln -s /usr/bin/python3 python \ | |
&& pip3 install --upgrade pip | |
# INSTALL DEPENDENCIES | |
RUN apt-get install -y curl unzip openjdk-8-jre-headless xvfb libxi6 libgconf-2-4 |
#!/bin/bash | |
find . -type d -empty -exec rm -i -R {} \; |
sudo apt autoremove | |
sudo apt clean | |
sudo apt-get autoclean | |
sudo journalctl --vacuum-time=3d | |
rm -rf ~/.cache/thumbnails/* | |
set -eu | |
snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
snap remove "$snapname" --revision="$revision" |
#/usr/bin/bash | |
# strings to look for in our file | |
# Note: you could just parse the whole file. But if you put in a bad password your IP | |
# could end up on the bad guy list | |
declare -a badstrings=("Failed password for invalid user" | |
"input_userauth_request: invalid user" | |
"pam_unix(sshd:auth): check pass; user unknown" | |
"input_userauth_request: invalid user" | |
"does not map back to the address" | |
"pam_unix(sshd:auth): authentication failure" |