Andrew Pennebaker
https://github.com/mcandre/cheatsheets/blob/master/lucene.md
Lucene is a programmable search engine, used by elasticsearch and Kibana to search public and private data collections.
================================================================ | |
Step 1 - Install Docker | |
================================================================ | |
$ sudo apt-get install ca-certificates curl gnupg lsb-release | |
$ sudo mkdir -p /etc/apt/keyrings | |
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
$ sudo apt-get update | |
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin |
===================================================== | |
Step 1 - Install icinga2 in Agent Server | |
===================================================== | |
8 apt update | |
9 apt -y install apt-transport-https wget gnupg | |
10 wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg | |
11 . /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi; echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/ubuntu icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list | |
12 apt update | |
13 apt install icinga2 | |
14 apt install monitoring-plugins |
object Host NodeName { | |
/* Import the default host template defined in `templates.conf`. */ | |
import "generic-host" | |
/* Specify the address attributes for checks e.g. `ssh` or `http`. */ | |
address = "127.0.0.1" | |
address6 = "::1" | |
/* Set custom variable `os` for hostgroup assignment in `groups.conf`. */ | |
vars.os = "Linux" |
<?php | |
// Moodle configuration file inclusion - adjust the path as needed | |
require('/path/to/your/moodle/config.php'); | |
// User data | |
$email = 'example@example.com'; // Assume this comes from your form | |
$username = 'newusername'; // Assume this comes from your form | |
$password = 'newpassword'; // Assume this comes from your form, needs to be hashed | |
// Hash the password using bcrypt, compatible with Moodle's password hashing |
Andrew Pennebaker
https://github.com/mcandre/cheatsheets/blob/master/lucene.md
Lucene is a programmable search engine, used by elasticsearch and Kibana to search public and private data collections.
# Application Deployment | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: my-app | |
namespace: default | |
spec: | |
selector: | |
matchLabels: | |
app: my-app |
# Application Deployment | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: web-app | |
namespace: default | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: |
# Docker | |
# Build a Docker image | |
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker | |
trigger: | |
- main | |
resources: | |
- repo: self |
import boto3 | |
import os | |
def sync_s3_bucket_to_local(bucket_name, local_directory): | |
# Initialize S3 client | |
s3_client = boto3.client('s3') | |
# Create local directory if it does not exist | |
if not os.path.exists(local_directory): | |
os.makedirs(local_directory) |
# pip install unittest-parallel | |
# tests/test_parallel_execution.py | |
# In this code, we have a unittest test case class TestParallelExecution with three test methods representing tasks that can run concurrently. | |
import time | |
import unittest | |
class TestParallelExecution(unittest.TestCase): | |
def test_task_1(self): |