Skip to content

Instantly share code, notes, and snippets.

View bashizip's full-sized avatar
🌍

Patrick Bashizi bashizip

🌍
View GitHub Profile
@bashizip
bashizip / devopsToDevsecops.md
Created November 17, 2024 15:36
Devops to DevSecOps

What is DevSecOps?

DevSecOps integrates security into every phase of the DevOps lifecycle. It ensures that security is a shared responsibility among development, operations, and security teams, rather than being an isolated stage at the end of the development process.

The goal is to identify and fix security issues early, automate security tasks, and maintain a secure infrastructure and codebase throughout the software delivery pipeline.


Core Principles of DevSecOps

  1. Shift Left on Security:
  • Security practices are integrated early in the development lifecycle, starting from the planning and coding stages.
@bashizip
bashizip / del_cluster.sh
Last active February 17, 2025 19:00 — forked from btamayo/del_cluster.sh
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
killall pmxcfs
@bashizip
bashizip / generate_traffic.sh
Created September 24, 2024 01:59
generate_traffic with curl
timeout 120 bash -c -- 'while true; do curl localhost; sleep $((RANDOM % 4)) ; done'

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements

@bashizip
bashizip / install-docker.md
Created September 27, 2023 11:26 — forked from zulhfreelancer/install-docker.md
Install Docker oneliner script

Just install Docker

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Install Docker and Rancher Server

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh && sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

## Cluster
### Cluster info
kubectl cluster-info
kubectl get nodes
kubectl describe node
### Listar os eventos
kubectl get events
@bashizip
bashizip / mysql-docker.sh
Created January 15, 2023 12:44 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
spring.datasource.url=jdbc:postgresql://localhost:5432/springbootdb
spring.datasource.username=postgres
spring.datasource.password=postgres@123
spring.datasource.driver-class-name=org.postgresql.Driver
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle=true
@bashizip
bashizip / psql-with-gzip-cheatsheet.sh
Created April 29, 2022 11:09 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@bashizip
bashizip / postgres-cheatsheet.md
Created April 18, 2022 22:36 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)