Skip to content

Instantly share code, notes, and snippets.

View soufianem370's full-sized avatar

soufiane makhloufi soufianem370

View GitHub Profile
@soufianem370
soufianem370 / Mock Exam 1.md
Created October 6, 2024 02:17 — forked from luckylittle/Mock Exam 1.md
Prometheus Certified Associate (PCA)

Mock Exam

1

Q1. The metric node_cpu_temp_celcius reports the current temperature of a nodes CPU in celsius. What query will return the average temperature across all CPUs on a per node basis? The query should return {instance=“node1”} 23.5 //average temp across all CPUs on node1 {instance=“node2”} 33.5 //average temp across all CPUs on node2.

node_cpu_temp_celsius{instance="node1", cpu="0"} 28
node_cpu_temp_celsius{instance="node1", cpu="1"} 19
node_cpu_temp_celsius{instance="node2", cpu="0"} 36
node_cpu_temp_celsius{instance="node2", cpu="1"} 31
@soufianem370
soufianem370 / app-deployment.yml
Created February 28, 2021 23:49 — forked from gmaliar/app-deployment.yml
Auto-renewing secrets using Valut and Kubernetes | app-deployment.yml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: vault-dynamic-secrets-rails
labels:
app: vault-dynamic-secrets-rails
spec:
replicas: 3
template:
metadata:

Installing mailx

yum -y update
yum install -y mailx

We can now start sending e-mails using

@soufianem370
soufianem370 / nginx-tuning.md
Created September 12, 2019 14:50 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@soufianem370
soufianem370 / db_dump.sh
Created August 26, 2019 22:04 — forked from brianredbeard/db_dump.sh
MariaDB / MySQL Backup script
#!/bin/bash
# Simple script to dump the contents of a database into separate files in the directory "/backups/"
# Symlink into /etc/cron.daily/ or add to crontab
# Originally from: https://gist.github.com/brianredbeard
# /usr/local/scripts/db_dump
#mysqldump -x --add-drop-table --all-databases > /backups/mysqldb-`date +%F-%I%p`.sql
/usr/bin/mysql --defaults-extra-file=/root/.my.cnf -e 'show databases' | /bin/awk '{print $1}' | /bin/grep -v "^Database$" | /usr/bin/xargs -i{} /usr/bin/mysqldump --defaults-extra-file=/root/.my.cnf --opt -Q -r /backups/{}-`date +%F-%I%p`.sql {}
version: '3'
services:
master:
build:
context: .
dockerfile: ./master.Dockerfile
working_dir: /root/playbooks
volumes:
- /c/repos/ansible/playbooks:/root/playbooks
- /c/repos/ansible/config:/etc/ansible
@soufianem370
soufianem370 / manage.sh
Created August 18, 2019 12:26 — forked from WhiteBlue/manage.sh
a script install kubernetes master & node on CentOS7
#!/bin/bash
set -e
reset=$(tput sgr0)
green=$(tput setaf 76)
blue=$(tput setaf 25)
red=$(tput setaf 1)
info() {