Skip to content

Instantly share code, notes, and snippets.

Jair Cueva Júnior jaircuevajunior

Block or report user

Report or block jaircuevajunior

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jaircuevajunior /
Last active Feb 6, 2020
Instalando PHP 5.6 FPM no Plesk Obisidian utilizando Ubuntu 18.04

Instalando PHP 5.6 FPM no Plesk Obisidian utilizando Ubuntu 18.04

add-apt-repository ppa:ondrej/php &&\
apt-get update &&\
apt-get install php5.6-fpm php5.6-curl php5.6-gd php5.6-mbstring php5.6-mysql php5.6-xml php5.6-zip -y

mkdir -p /opt/plesk/php/5.6/{bin,etc,sbin} &&\
ln -s /etc/php/5.6/fpm/pool.d /opt/plesk/php/5.6/etc/php-fpm.d &&\
jaircuevajunior /
Last active Feb 12, 2020
A simple guide to help me setup a common LAMP environment on a AWS Ubuntu 18.04 instance


fallocate -l 4G /swapfile &&\
chmod 600 /swapfile &&\
mkswap /swapfile &&\
swapon /swapfile &&\
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab &&\
free -h
jaircuevajunior /
Created Mar 26, 2019
Generate CSR and Private Key for SSL Certificate Request
if [ -z "$DOMAIN" ]
echo "Favor digitar o domínio como primeiro parâmetro após o comando"
exit 1
echo "Utilizando domínio $DOMAIN"
jaircuevajunior /
Last active Jan 29, 2019
Fix certbot TLS-SNI-01 deprecation

Alias para alguns comandos comuns no docker-compose

Aonde colocar esses códigos?

Se você possui MAC, provavelmente no arquivo ~/.zshrc.

Se você possui Linux, provavelmente ~/.bashrc.

Se você possui Windows, clique aqui

jaircuevajunior / .htaccess
Created Sep 19, 2018
HTTP`to HTTPS + let's encrypt
View .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
View gist:fc26dce31d92521ce6e7e7adfde9e375
View Apache Average Memory
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
jaircuevajunior /
Last active Feb 10, 2020
Fix logrotate error regarding mysql on Ubuntu

Fix logrotate error regarding mysql on Ubuntu

Sometimes if you are mailed of cronjobs, will may got an error like this:

error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Well, don't panic! Also don't ignore it! :)

You can’t perform that action at this time.