Skip to content

Instantly share code, notes, and snippets.

View alexandre2602's full-sized avatar

Alexandre Machado alexandre2602

View GitHub Profile
@alexandre2602
alexandre2602 / oci_ubuntu_to_debian.multiarch.sh
Created April 15, 2024 21:07 — forked from ishad0w/README.md
Debian 12 on Oracle Cloud (Free Tier) - (AMD64/ARM64)
#!/bin/bash
echo -e "\nHost:"
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -p 22 ubuntu@$1 \
'uname -a && arch && uptime && sudo touch /home/ubuntu/.hushlogin /root/.hushlogin'
echo -e "\nAdding temporary SSH-key for Ubuntu root user..."
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -p 22 ubuntu@$1 \
'sudo cat /home/ubuntu/.ssh/authorized_keys | sudo tee /root/.ssh/authorized_keys'
echo -e "\nSystem trimming..."
@alexandre2602
alexandre2602 / gist:0095aeaab625ebcbc523c2e65c89d3ab
Created September 17, 2021 15:54 — forked from sergiosvieira/fluxo-trabalho-git.md
Fluxo de Trabalho do Git para Pequenas Equipes
Fluxo de Trabalho no Git
========================
Primeiro crie um branch de desenvolvimento no seu repositório local:
$ git checkout --track origin/development
1. Trabalhe em sua tarefa, continuamente comitando em intervalos regulares para manter
o rastro daquilo que você fez.
@alexandre2602
alexandre2602 / docker-compose.advanced.yml
Created September 17, 2021 13:30 — forked from w33ble/docker-compose.advanced.yml
Using jwilder/nginx-proxy with multiple compose files
version: '3'
services:
nginx-proxy:
image: nginx:alpine
container_name: proxy-nginx
environment:
- DEFAULT_HOST=hello.local
ports:
- 80:80
https://github.com/dgkanatsios/CKAD-exercises
https://medium.com/@atharvac.cloud/kubernetes-deep-dive-part-3-generators-for-quick-poc-6cac698f08eb
https://github.com/lucassha/CKAD-resources
https://medium.com/@harioverhere/ckad-certified-kubernetes-application-developer-my-journey-3afb0901014
https://en.sokube.ch/post/kubernetes-tips-for-your-ckad-exam-by-cncf-1
https://github.com/rchidana/CKAD-Prep-Guide-Preview
https://faun.pub/be-fast-with-kubectl-1-18-ckad-cka-31be00acc443
https://thospfuller.com/2020/11/09/answers_to_five_kubernetes_ckad_practice_questions_2021/
https://medium.com/bb-tutorials-and-thoughts/practice-enough-with-these-questions-for-the-ckad-exam-2f42d1228552
https://www.udemy.com/course/certified-kubernetes-application-developer/learn/lecture/26608008?start=1#overview
@alexandre2602
alexandre2602 / docker-compose.yml
Created December 8, 2020 16:57 — forked from pyrou/docker-compose.yml
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.0.2
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
1 hostname elliot-01
2 echo elliot-01 > /etc/hostname
3 bash
4 vim /etc/modules-load.d/k8s.conf
5 curl -fsSL https://get.docker.com | bash
6 docker version
7 docker ps
8 apt-get update && apt-get install -y apt-transport-https
9 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
10 echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
@alexandre2602
alexandre2602 / nginx-tuning.md
Created August 26, 2020 23:23 — 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.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
name: app-ingress
spec:
rules:
- host: 'k8s-vagrant-parallels-machine1-1590958663790-68391'
http:
@alexandre2602
alexandre2602 / nginx.conf
Created July 14, 2020 23:56 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@alexandre2602
alexandre2602 / limpacacheram.sh
Created June 6, 2020 15:18 — forked from rmsaitam/limpacacheram.sh
Script para limpar memória cache do Linux
#!/bin/sh
#!/bin/sh
# https://blog.remontti.com.br/92
PATH="/bin:/usr/bin:/usr/local/bin"
# Porcentagem maxima (mude se vc achar q deve) eu deixo em 85%
percent=85
# Total da memoria: