mysql – Is MariaDB easier and better suited for a WordPress website?

I had problems with MySQL 8.0.20 on Ubuntu 18.04, and because I don't have a lot of knowledge about databases, I was thinking of switching to MariaDB because I heard that It had better parameters and performance out of the box.

So:

  1. Is MariaDB a better solution for someone who is still learning the database?

  2. Can I just bring the MySQL database to MariaDB without any conversion or anything else (just drag and drop)?

  3. Can I run mariadb with apache 2.4 and php 7.4?

design patterns – How to make the powershell script easier to manage and read? – Best practices?

I'm looking for information on how to improve a PowerShell script that I wrote.
I am particularly looking for suggestions, which I could also apply to future projects. Like the (anti) patterns that I don't know and such.
General things like "too many small functions" vs "use more functions" or "better collect all the information in a certain type of object" and stuff like that, that's what I'm looking for.
If anyone has experience with the Cmd-Lets that I use and would like to share, more specific suggestions are also welcome.

The script is used in a cluster of 4 HyperV hosts which each run around 30 virtual machines.
There is the concept of replication in Hyper-V. It works like this:
You can create a replication of a virtual machine running on a Hyper-V server and have this replication running (in a stopped state) on another Hyper-V server in the cluster.
I will call them both production-vm and the failover-vm . If the switchover is made, the old production-vm becomes the switch-vm and vice versa.
In theory, there can be replications of replications, etc. The script should be scheduled to run from time to time, because the location of vms (and their replications) is somewhat dynamic – changes occur several times a year.

The script is executed on a 5th server outside the cluster.

The script should accomplish the following tasks:

  • take the name of a production-vm and find out what the corresponding failover-vm is.
    It must also work the other way!
  • create a VMGroup on all Hyper-V hosts with a name that looks like the virtual machine we were looking for
  • add both production-vm and failover-vm to their groups.
    • since VMGroups are local on a Hyper-V host, they can have the same name on all hosts but usually must contain either the production-vm where the failover-vm or no vm at all.

Here is the code:

# This script looks up VMs and their corresponding failover-vms (usually named xxx_replika) and adds them to VMGroups called LTR_.
#

$LTR_VMs = $LTR_VMs = "VM-ELO01", "VM-FILE01", "VMs03", "VMs71", "VMs72", "VM-SBO02" 
$HVhosts = "hv01.example.com", "hv02.example.com", "hv05.example.com", "hv06.example.com"

function Get_VM_and_Replica_by_name_remote((array)$HVhosts, (String)$VMname) {
            $searchedVM = Get-VM -name $VMname -ComputerName $HVHosts
            $searchedReplica = Get-VMReplication -VM $searchedVM  ## can't get failoverVM directly since VM-HVn cannot authenticate vs VM-HVm
            #construction of an array to return both vm-objects to the caller:
            $searchedVM2 = Get_VM_by_VMReplication_remote -VMReplication $searchedReplica
            $bothVMs = @()
            $bothVMs += $searchedVM
            $bothVMs += $searchedVM2
            return ,$bothVMs
            ## returning to caller will 'deserialize' the vms in the array. This will be problematic later when we add those vm-objects to a VMGroup
        }

function Get_VM_by_VMReplication_remote($VMReplication) {
        # if this VMReplication-Object is a Primary, then get the VM-Object from the Replication Server (where the failover vm runs)
        if ($VMReplication.Mode -eq "Primary") {
            Invoke-Command -ComputerName $VMReplication.ReplicaServerName -ScriptBlock {
                $VM = Get-VM -Id $Using:VMReplication.Id
                $VM
            }
        }
        # if this VMReplication-Object is a Replica, then get the VM-Object from the Primary Server (where the production VM runs)
        if ($VMReplication.Mode -eq "Replica") {
            Invoke-Command -ComputerName $VMReplication.PrimaryServerName -ScriptBlock {
                $VM = Get-VM -Id $Using:VMReplication.Id
                $VM
            }
        }
}

function Create_GroupName((String)$VMName){
    $prefix = "LTR_"
    $Groupname = $prefix + $VMName 
    return $Groupname
}

function RemoveVMs_from_Group_remote((array)$HVhosts, (String)$GroupName) {

    foreach ( $HVhost in $HVhosts) {
        Invoke-Command -ComputerName $HVhost -ScriptBlock {

            $vms = (Get-VMGroup -Name $Using:GroupName).VMMembers
            foreach ($vm in $vms) {
                Remove-VMGroupMember -Name $Using:GroupName -VM $vm
            }
        }
    }
}

# add all VMs to group on their respective HVhost:
# must use Invoke-Command because of deserialization issue with vms in our array
function Add_VMs_to_VMGroup_remote((array)$VMs, (String)$Groupname) {
    foreach ( $VM in $VMs) {
        Invoke-Command -ComputerName $VM.ComputerName -ScriptBlock {
            $thisVM = Get-VM -Id $Using:VM.VMId
            Write-Host "adding $($thisVM.VMName) to Group $($Using:Groupname) on $($Using:VM.ComputerName)."
            Add-VMGroupMember -Name $Using:Groupname -vm $thisVM
        }
    }
}



foreach ($name in $LTR_VMs) {
    $vmPair = (Get_VM_and_Replica_by_name_remote -HVHosts $HVHosts -VMname $name )
    $myGroupName = Create_GroupName -VMName $name

    # make sure group exists on all HyperV-hosts:
    foreach ($HVhost in $HVHosts) {
        $VMGroupX = Get-VMGroup -Name $myGroupName -ComputerName $HVhost
        if (!$VMGroupX) {
            New-VMGroup -Name $myGroupName -ComputerName $HVhost -GroupType VMCollectionType
            Write-Host "Created group $myGroupName on $($HVhost)."
        }
    }

    RemoveVMs_from_Group_remote -HVHosts $HVHosts -Groupname $myGroupName
    Add_VMs_to_VMGroup_remote -VMs $vmPair -Groupname $myGroupName
}

#careful with vms with more than 1 replication like VMs33. Doesn't work fine because if you lookup the replicaname, you may get back two replicas and not the primary vm.

javascript – Any suggestion to make this code more understandable to beginners and easier

let animals 
let animalCols = ('Animal', 'Animal 2') 
let peopleCols = ('Person', 'Person 2') 
 
function myFunction() { 
  paivitys(animals, animalCols) 
} 
 
function paivitys(dataa, arvvoja) { 
  console.log(dataa); 
  //---- 
  if (dataa.hasOwnProperty("animal")) { 
    document.getElementById("1name").innerHTML = dataa.animal; 
  } else { 
    document.getElementById("1name").innerHTML = dataa.person; 
  } 
  //----   
  if (dataa.hasOwnProperty("animal2")) { 
    document.getElementById("2name").innerHTML = dataa.animal2; 
  } else { 
    document.getElementById("2name").innerHTML = dataa.person2; 
     
  } 
 
  document.getElementById("1name1").innerHTML = arvvoja(0); 
  document.getElementById("2name1").innerHTML = arvvoja(1); 
 
  //-----  
  document.getElementById("id").innerHTML = dataa.id; 
} 
 
function paivitaselekt(araytassa, arvvoja) { 
 
var i, j;
for (i = 0; i < araytassa.length; i++) { 
    var ssellecct = document.getElementById("Select"); 
    var oppttion = document.createElement("option"); 
    for (j = 0; j < arvvoja.length; j++) { 
       oppttion.textContent += araytassa(i)(arvvoja(j)) + " "; 
    } 
    ssellecct.appendChild(oppttion); 
}  
} 
 
animals = { 
  "animal": "tiger", 
  "animal2": "lion", 
  "id": "54321", 
  "dole": { 
    "Key": "fhd699f" 
  } 
} 
 
paivitys(animals, animalCols); 
let infoarray; 
 
people = ({ 
    "person": "kaka", 
    "person2": "julle", 
    "id": "9874", 
  }, 
  { 
    "person": "Ronaldo", 
    "person2": "jussi", 
    "id": "65555", 
  } 
) 
infoarray = people; 
paivitaselekt(infoarray, ("person", "id")); 
 
document.getElementById("Select").addEventListener("change", function(event) { 
  const chosenid = event.target.value.split(" ")(1); 
  const choseninfo = infoarray.filter((dataa) => dataa.id === chosenid)(0); 
  paivitys(choseninfo, peopleCols); 
}); 
 
 
   
     
     
     
     
     
   
   
  
Animal Animal id

Does knowing the file type of an encrypted file make decryption easier?

If I encrypt, say, a .pdf file, does knowing that it is a .pdf file make decryption easier?

in other words, could the well-known structure of the file act as a predictable part of the encrypted bytes?

Are there any quality of life add-ons for the content administration page? Sorting, searching, etc. easier

I think the words make it vague for a Google search because I really can't find anything. You're looking for improvements to the Content screen in Admin (which lists all of your content items). You can search for things and sort by a few selected fields, but seek to expand that and make it more specific to our types of content. Thank you!

dnd 5th – How can I make my player's job easier in an individual campaign from Baldur & # 39; s Gate: Decent into Avernus?

I am therefore launching a new campaign on Roll20, via the Baldur & # 39; s Gate WotC module released a few months ago.
It’s the first time I’ve launched a campaign many years old, so I'm a little rusty.
It is also the first time that I have seriously used Roll20 for anything – all of my previous campaigns have been in-person table experiences.
Whenever I use the website, it is limited to a player role.

my Major the problem is that it's just me and another person (at the moment).
He's been playing two characters since he wanted to experiment, and I started them on the 3rd level for gameplay reasons, but I'm having combat issues.
I have studied different solutions, but I hope that creating an article will get more specific results.

These are the problems:

  • The fight becomes a slog and slows down the campaign.
  • His characters easily become overwhelmed, even if I:
    • Reduce the life of NPCs,
    • Reduce the number of mobs,
    • Reduce special attacks,
  • We are forced to take short / long breaks every other room.
  • The simple act of going through simple encounters becomes tactical nightmares and resource management mini-games as he tries to min / max the battle and maintain momentum.

I probably imagine it sounds worse, as we are just getting started, but I can see how it will progress later in the campaign.
For the moment, his characters outperform the enemies, but this advantage will disappear in the next sessions, then it will become an abrupt version.
This is made worse when we get to places like Avernus and the environment starts active work against player recovery.

I hope people will have suggestions for me, maybe even those related to the module itself.
I tinkered with things like "scare the enemies" when their BBEG is killed or the boss is defeated. Competency check allowed for bullying to reduce the number of NPCs, etc.
I don't really know of any other easy and scalable ways to balance CR and not to completely remove the difficulty and pleasure of combat, but to prevent combat from blocking the story .

I plan to create my own DMPC to help add to the list, but since this is the first time I have been controlling the game in a while, I don't want to overshoot or lose focus – things that are too easy to do when you both rule and participate in the world.

Are the Russians helping Bernie because they think it will make Trump's re-election easier?

I would say it is simply to create doubt with the results!

Division between people – this can be a more powerful weapon than any war machine!

Even more confusion when they help both Rump and Bernie!

U [DATE: BIG difference, Bernie recognizes this and has publicly asked Russia to remove the s *! T – Rump REFUSES to accept the fact, and WELCOMES anyway – as long as it is; he is in his favor!

Can someone tell me if there is an easier or more correct way to call two different table selections?

using BRQ_Jobs.Modelo;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BRQ_Jobs.DAL
{
    public class PesquisaDALComandos
    {
        string conecta = @"Integrated Security = SSPI; Persist Security Info=False;Initial Catalog = BRQ_JOBS; Data Source = NBBV027097";
        SqlConnection conexao = null;
        SqlCommand comando;

        CadastroRecrutador recrutador = new CadastroRecrutador();
        CadastroVagas vaga = new CadastroVagas();

        //Método para listar os dados do banco
        public DataTable Listar()
        {           
            try
            {
                using (conexao = new SqlConnection(conecta))                    
                {                   
                    if (!recrutador.Equals(vaga))
                    {
                        comando = new SqlCommand("select distinct COD_REC,NOME,SITUACAO from RECRUTADOR", conexao);                                     
                    }
                    else if (!vaga.Equals(recrutador))
                    {
                        comando = new SqlCommand("select distinct COD_VAGA,NOME,DESCRICAO,SALARIO,SITUACAO from VAGA", conexao);
                    }
                    SqlDataAdapter da = new SqlDataAdapter();
                    DataTable dt = new DataTable();
                    da.SelectCommand = comando;
                    da.Fill(dt);
                    return dt;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }

        //Método para pesquisar ao digitar
        public DataTable Pesquisar(PesquisaModel pesquisa)
        {
            try
            {
                using (conexao = new SqlConnection(conecta))
                {
                    SqlDataAdapter da = new SqlDataAdapter();
                    DataTable dt = new DataTable();

                    if (!recrutador.Equals(vaga))
                    {
                        comando = new SqlCommand("select distinct COD_REC,NOME,SITUACAO from RECRUTADOR where NOME like '%' + @nome + '%' order by NOME", conexao);                   
                    }
                    else if (!vaga.Equals(recrutador))
                    {
                        comando = new SqlCommand("select distinct COD_VAGA,NOME,DESCRICAO,SALARIO,SITUACAO from VAGA where NOME like '%' + @nome + '%' order by NOME", conexao);
                    }

                    comando.Parameters.AddWithValue("@nome", pesquisa.Nome);
                    da.SelectCommand = comando;
                    da.Fill(dt);
                    return dt;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                conexao.Close();
            }
        }   
    }
}

Finding Facebook ads from your competitors is easier than you think

If you're intimidated at the idea of ​​doing market research, don't be. It’s much easier than you think, we promise. Thanks to the electoral scandal, Facebook has offered to be more transparent with regard to advertisements and customer data. And that means that they have given us a powerful tool in the sense that we can now click on the competitors & # 039; announcements in less time than it takes to ask if this is possible. The first step is to access your competitor's Facebook page. You will see a button on the …

Finding Facebook ads from your competitors is easier than you think

Is graphic design (UI / UX) easier than web development?

When I started my career as Web developer I think it is a little difficult because it requires the knowledge of too many languages ​​(programming or markup), you must be very fast to cooperate with new technologies (that I don't like).

So I decided will pass graphic design (UI / UX designer) for the following reasons:

  1. You don't need to keep learning new technologies.

    for example:
    You learn Indesign or glow or any other good software, and you're ready to go for almost years (when you have a designer eye)
    It's like learning once and doing more.

  2. Most of the time, I don't understand user requirements (especially during
    independent
    ).

So I go to another difficult area (graphic design) where it is a little easier than web development.

Your kind suggestions are greatly appreciated!