Skip to content

Instantly share code, notes, and snippets.

View jhowbhz's full-sized avatar
🦾
Um programador apaixonado pelo que faz

Jhon jhowbhz

🦾
Um programador apaixonado pelo que faz
View GitHub Profile
@jhowbhz
jhowbhz / clamav.sh
Last active May 16, 2024 23:38
Install clamav ubuntu 22.04
# 1. Adiciona o usuário
groupadd clamav
useradd -g clamav -s /bin/false -c "Clam Antivirus" clamav
# 1.1 Instalar o ClamAV
sudo apt update && sudo apt install clamav clamav-daemon -y
# 2. Configurar o ClamAV
sudo nano /etc/clamav/clamd.conf
@jhowbhz
jhowbhz / install.md
Last active April 9, 2024 18:20
Install PHP 8.3 - FPM Nginx Ubuntu 22.04

Add Ondrej's PPA

sudo add-apt-repository ppa:ondrej/php 
sudo apt update
@jhowbhz
jhowbhz / install.sh
Last active April 9, 2024 17:24
Install docker ubuntu 22.04
sudo apt update && sudo apt install apt-transport-https ca-certificates curl software-properties-common &&
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg &&
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && apt update -y
sudo apt install docker-ce -y
sudo systemctl status docker
@jhowbhz
jhowbhz / supervisor.sh
Created March 8, 2024 18:38
Supervisor config file
# how to install supervisor
apt install supervisor
# how to create config file supervisor
nano /etc/supervisor/conf.d/laravel-worker.conf
# set text in file, save and restart service
# service supervisor restart
[program:laravel-worker]
@jhowbhz
jhowbhz / find.sh
Created March 7, 2024 02:41
Find big files in linux terminal
find / -type f -size +1G -exec du -h {} + | sort -rh | head -n 1
@jhowbhz
jhowbhz / clear docker
Last active April 6, 2025 05:04
Clear all docker overlays
docker rm -vf $(docker ps -aq)
docker rmi -f $(docker images -aq)
docker volume prune -f
docker-compose down -v
// DOT NOT USE IS COMMAND IN PRODUCTION //
// IS ERASE YOUR FILES! AND VOLUMES! //
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
@jhowbhz
jhowbhz / monitoring.sh
Created January 6, 2024 04:04
Monitoring script for apibrasil
#! /bin/bash
MEMORY=$(free -m | awk 'NR==2{printf "%6.2f%%", $3*100/$2 }')
DISK=$(df -h | awk '$NF=="/"{printf "%6s", $5}')
CPU=$(top -bn1 | grep load | awk '{printf "%6.2f%%", $(NF-2)}')
MESSAGE="*Servidor*\n-----\n*Servidor:* APIS\n*Memória*: $MEMORY\n*Disco*:$DISK\n*CPU:*$CPU"
curl --location 'https://gateway.apibrasil.io/api/v2/whatsapp/sendText' \
--header 'Content-Type: application/json' \
--header 'DeviceToken: YOUR_DEVICE_TOKEN' \
@jhowbhz
jhowbhz / firewall.sh
Created December 29, 2023 19:28
Liberar firewall SaveIncloud Todas as Portas
# instala persiste
sudo apt-get install iptables-persistent
# lista portas
sudo iptables -L
# libera tudo
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
@jhowbhz
jhowbhz / wif+bluetooth.io
Created December 21, 2023 22:33
Wifi + Bluetooth ESP32-CAM
/*
* This sketch demonstrates how to scan WiFi networks.
* The API is almost the same as with the WiFi Shield library,
* the most obvious difference being the different file you need to include:
*/
#include "WiFi.h"
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
@jhowbhz
jhowbhz / load-wifi.ino
Created December 21, 2023 22:32
Load wifi ESP32-CAM
#include "WiFi.h"
void setup()
{
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);