Skip to content

Instantly share code, notes, and snippets.

View dublado's full-sized avatar
📭
Send me a Telegram

Thiago Machado dublado

📭
Send me a Telegram
View GitHub Profile
@dublado
dublado / Secureboot + Ubuntu + VirtualBox Signing kernel modules.md
Last active April 19, 2024 01:28
Secureboot + Ubuntu + VirtualBox Signing kernel modules

Install the virtualbox manually

sudo apt-get update  
sudo apt-get install virtualbox-6.1  

Sign the modules for secureboot

sudo -i  
mkdir /root/module-signing  
cd /root/module-signing  
@dublado
dublado / gist:f584cdd895eb6db0b74c199d532d2ac8
Created May 25, 2017 21:33
Nomes das Tabelas do Protheus/TOTVS
Nomes das Tabelas
SX1 Manutenção de Perguntas de parametrização (movimentações, consultas e relatórios)
SX2 Manutenção dos Arquivos
SX3 Manutenção dos Campos
SX4 Configuração de Agenda de Relatórios e Processos
SX5 Manutenção de Tabelas
SX6 Manutenção de Parâmetros
SX7 Manutenção de Gatilhos de Campos (SX3)
SX9 Manutenção de Relacionamento entre Arquivos (SX2)
SXA Manutenção de Pastas Cadastrais dos Arquivos (SX2)
@dublado
dublado / gist:269f45a09667dcd4b0eddafdb96d6010
Last active April 13, 2024 21:09
How can I tell Ubuntu to do nothing when I close my laptop lid?
sudo -H gedit /etc/systemd/logind.conf
sudo restart systemd-logind
sudo service systemd-logind restart
or
IgnoreLid=true in /etc/UPower/UPower.conf
service upower restart
or
1.When on AC Power, do nothing when laptop lid is closed:
@dublado
dublado / gist:cf8c4fbe359c686266eb7723a0a08c55
Created March 6, 2018 14:58
Apache Bench (ab) to POST JSON to an API
$ cat test.json
json='{ "timestamp" : 1484825894873, "test" : "test"}'
ab -c 10 -n 1000 -p test.json -T application/x-www-form-urlencoded https://example.com/test
#https://prabuddha.me/apache-bench-ab-post-json-api/
@dublado
dublado / ubuntu microphone output to speaker.md
Created March 14, 2024 14:23
ubuntu microphone output to speaker

install

apt install pavucontrol -y

discover the source

pactl list sources

enable

pactl load-module module-loopback source=alsa_input.pci-0000_00_1b.0.analog-stereo

disable

@dublado
dublado / images-names.md
Created November 21, 2022 12:33
docker image names Alpine, Slim, Stretch, Buster, Jessie, Bullseye qual a diferença ?

Alpine, Slim, Stretch, Buster, Jessie, Bullseye qual a diferença ?

stretch/buster/jessie são releases do debian

Bullseye e Bookworm são versões de desenvolvimento, não estáveis

-slim são versões com o mínimo possivel para rodar o que é proposto no Dockerfile

-alpine são versões baseadas no sistema operacional Alpine (se for utilizar algumas compilações que dependem de glibc talvez queira olhar o musl nesse ambiente, pois é a biblioteca usada

How to log real user’s IP address with Nginx in log files

How to log the real user’s IP instead of the proxy server?

You need use the ngx_http_realip_module module. It is used to change the client address and optional port to the one sent in the specified header fields. Edit your nginx.conf or default.conf file:

$ sudo vi /etc/nginx/conf.d/default.conf

And set the following two directives:

@dublado
dublado / compose.yml
Created February 6, 2024 15:43
docker swarm test in docker host
version: '3.8'
services:
docker_host_1:
image: docker:dind
privileged: true
volumes:
- docker_host_1_data:/var/lib/docker
networks:
- docker_network

Adjusting child processes for PHP-FPM (Nginx)

Problem:

The following warning message appears in the logs:

[26-Jul-2012 09:49:59] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 8 idle, and 58 total children  
[26-Jul-2012 09:50:00] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it  
It means that there are not enough PHP-FPM processes. 
@dublado
dublado / sshfs.md
Last active January 19, 2024 04:40
How to Mount Remote Linux Filesystem or Directory Using SSHFS Over SSH

What Is SSHFS?

SSHFS stands for (Secure SHell FileSystem) client that enable us to mount remote filesystem and interact with remote directories and files on a local machine using SSH File Transfer Protocol (SFTP).

SFTP is a secure file transfer protocol that provides file access, file transfer and file management features over Secure Shell protocol. Because SSH uses encryption while transferring files over the network from one computer to another computer and SSHFS comes with built-in FUSE (Filesystem in Userspace) kernel module that allows any non-privileged users to create their file system without modifying kernel code.

In this article, we will show you how to install and use SSHFS client on any Linux distribution to mount remote Linux filesystem or directory on a local Linux machine.

Step 1: Install SSHFS Client in Linux Systems

By default sshfs packages does not exists on all major Linux distributions, you need to enable epel repository under your Linux systems to install sshfs w