This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install latest composer | |
cd ~ | |
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php | |
HASH=`curl -sS https://composer.github.io/installer.sig` | |
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
# If the output says "Installer corrupt", you’ll need to repeat the download and verification process until you have a verified installer. | |
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit goes to: https://stackoverflow.com/users/3708472/peter-s | |
# Taken from: https://stackoverflow.com/questions/73380791/kafka-kraft-replication-factor-of-3 | |
# 1. built custom image with the latest version of Kafka, Scala and openjdk 17: | |
FROM openjdk:17-bullseye | |
ENV KAFKA_VERSION=3.3.1 | |
ENV SCALA_VERSION=2.13 | |
ENV KAFKA_HOME=/opt/kafka | |
ENV PATH=${PATH}:${KAFKA_HOME}/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat vault.yml | |
Secret information | |
# Protect vault.yml with vault | |
ansible-vault create vault.yml | |
# | |
https://spacelift.io/blog/ansible-variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Ansible: Add IPs from inventory to /etc/hosts of all nodes: | |
- name: Add IP address of all hosts to all hosts | |
lineinfile: | |
dest: /etc/hosts | |
regexp: '.*{{ item }}$' | |
line: "{{ hostvars[item].ansible_host }} {{item}}" | |
state: present | |
when: hostvars[item].ansible_host is defined | |
with_items: "{{ groups.all }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
""" | |
Must run the `pip install docpoc` before run this script | |
generate_mplot_logs.py logfile | |
Usage: | |
generate_mplot_logs.py [options] | |
Options: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
vars: | |
#System Settings | |
php_modules: [ 'php-curl', 'php-gd', 'php-mbstring', 'php-xml', 'php-xmlrpc', 'php-soap', 'php-intl', 'php-zip' ] | |
#MySQL Settings | |
mysql_root_password: "mysql_root_password" | |
mysql_db: "wordpress" | |
mysql_user: "sammy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#──────────────────────────────────────────── | |
# LEMP on Ubuntu 18.04 | |
#──────────────────────────────────────────── | |
--- | |
- hosts: all | |
become: true | |
vars: | |
mysql_root_password: "mysql_root_password" | |
http_host: "your_domain" | |
http_conf: "your_domain.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are four main parts in a Kafka system: | |
Broker: | |
Handles all requests from clients (produce, consume, and metadata) and keeps data replicated within the cluster. | |
There can be one or more brokers in a cluster. | |
Zookeeper: | |
Keeps the state of the cluster (brokers, topics, users). | |
Producer: | |
Sends records to a broker. | |
Consumer: | |
Consumes batches of records from the broker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Directory structure: | |
kubernetes-lab | |
Vagrantfil | |
bootstrap.sh | |
master.sh | |
worker.sh | |
──────────────────────────────────────────────── cat Vagrantfile ──────────────────────────────────────────────── | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
ENV['VAGRANT_NO_PARALLEL'] = 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grab MongoDB logs from the server | |
1. SSH into the server and become root user | |
2. Go to /data folder | |
3. Go to the application folder | |
4. Sort the logs by date (ls -lrt) | |
5. Copy the bottom of the logs to the /tmp folder (cp logs.log /tmp) | |
6. Exit from root user and go to /tmp folder | |
7. Change ownership to current user (sudo chown $USER:$USER logs.log) | |
8. Compress the logs file (sudo gzip logs.log) | |
9. Download/Upload to bucket: |
NewerOlder