Skip to content

Instantly share code, notes, and snippets.

View lucenarenato's full-sized avatar
🐘
Remoto

Renato Lucena lucenarenato

🐘
Remoto
View GitHub Profile
@lucenarenato
lucenarenato / Jenkinsfile.groovy
Created March 8, 2024 19:54 — forked from andymotta/Jenkinsfile.groovy
Use Terraform latest docker image in Declarative Jenkins Pipeline
pipeline {
agent {
docker {
image 'hashicorp/terraform:latest'
label 'LINUX-SLAVE'
args '--entrypoint="" -u root -v /opt/jenkins/.aws:/root/.aws'
}
}
options {
ansiColor('xterm')
@lucenarenato
lucenarenato / logical-replication-test.sh
Created January 31, 2024 21:11 — forked from ololobus/logical-replication-test.sh
PostgreSQL logical replication + pg_basebackup test
#!/bin/sh -ex
#export PATH=/usr/pgsql-11/bin:$PATH
pg_ctl stop -D /tmp/master || echo "ok"
pg_ctl stop -D /tmp/slave || echo "ok"
rm -rf /tmp/master
rm -rf /tmp/slave
# setup master
initdb -D /tmp/master
@lucenarenato
lucenarenato / pgbench-query.sql
Created January 31, 2024 20:57 — forked from ololobus/pgbench-query.sql
PostgreSQL pgbench schema
\set aid random(1, 100000 * :scale)
\set bid random(1, 1 * :scale)
\set tid random(1, 10 * :scale)
\set delta random(-5000, 5000)
BEGIN;
UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);

Rumo a ZCE

[Rumo a ZCE] Re: Pergunta do dia: 3005 B

Em quinta-feira, 13 de dezembro de 2018 07:51:41 UTC-3, Danielson Xavier escreveu: Se essa pergunta é repetida aqui no grupo, peço desculpas e é só apagar depois. Só lembro de algumas opções da resposta

Qual a saída do código seguinte? php

@lucenarenato
lucenarenato / Install_PHP_on_Arch_Manjaro_Biglinux.md
Created July 7, 2023 20:14
Install multiple PHP versions on Arch / Manjaro Linux / BigLinux

Install Any PHP on Arch / Manjaro / Biglinux

Through the AUR it is possible to install older and newer PHP versions, simultaneously on the same system. I often had trouble installing using pacman and pamac so here's what I did:

mkdir -p $HOME/bin
mkdir ~/src
cd ~/src
git clone https://aur.archlinux.org/php72.git
cd php72
@lucenarenato
lucenarenato / iptables.sh
Created May 31, 2023 20:17 — forked from QNimbus/iptables.sh
Basic iptables configuration
trustedIP="1.2.3.4/32"
cat <<- EOF > /etc/iptables/rules.v4
# Generated by iptables-save v1.8.7 on Wed Mar 29 14:37:32 2023
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
@lucenarenato
lucenarenato / php72-V8JS.md
Last active May 6, 2023 07:59
PHP 7.2 V8JS Installation on Ubuntu 20

Install required dependencies

sudo apt-get install build-essential curl git python libglib2.0-dev

cd /tmp

Install depot_tools first (needed for source checkout)

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
@lucenarenato
lucenarenato / supervisord.conf
Created April 13, 2023 00:09 — forked from dkarchmer/supervisord.conf
Sample supervisord conf for running a python script in the background
; Assumes dockerfile with:
; ENTRYPOINT ["/usr/bin/supervisord", "-c", "/var/app/supervisord.conf"]
[supervisord]
;logfile=/var/app/logs/ ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=5 ; (num of main logfile rotation backups;default 10)
loglevel=debug ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=true ; (start in foreground if true;default false)
@lucenarenato
lucenarenato / .env-Swoole
Created April 5, 2023 18:38 — forked from kiddtang/.env-Swoole
Youtube - Boosts your Laravel Sail
OCTANE_SERVER=swoole
OCTANE_HTTPS=true
@lucenarenato
lucenarenato / alpine_install_telnet.md
Created March 27, 2023 21:31
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]