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
jaircuevajunior / php5.6_plesk_obsidian_ubuntu18.04.md
Last active Feb 6, 2020
Instalando PHP 5.6 FPM no Plesk Obisidian utilizando Ubuntu 18.04
View php5.6_plesk_obsidian_ubuntu18.04.md

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
jaircuevajunior / setup_guide_aws_instance.md
Last active Feb 12, 2020
A simple guide to help me setup a common LAMP environment on a AWS Ubuntu 18.04 instance
View setup_guide_aws_instance.md

HABILITAR SWAP

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

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
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 Usage.md
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
@jaircuevajunior
jaircuevajunior / mysql_debian_user.md
Last active Feb 10, 2020
Fix logrotate error regarding mysql on Ubuntu
View mysql_debian_user.md

Fix logrotate error regarding mysql on Ubuntu

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

/etc/cron.daily/logrotate:
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.