Skip to content

Instantly share code, notes, and snippets.

View jaircuevajunior's full-sized avatar
:octocat:
Hello there!

Jair Cueva Júnior jaircuevajunior

:octocat:
Hello there!
View GitHub Profile
setfacl -R -d -m u:artisanuser:rwx storage
setfacl -R -d -m g:www-data:rwx storage

@jaircuevajunior
jaircuevajunior / change_wordpress_domain.md
Last active July 20, 2019 10:43
Change/Migrate wordpress domain in MySQL

Find/Replace within dump method

This is a very simple method, and for me (as a SysAdmin) it's very practical as I usually make things through SSH terminal.

It's important to say that everything (including text inside posts) that matches the find string WILL BE REPLACED!

For me it's never been a problem so far, but one never knows

First we generate the dump itself, for example:

mysqldump -umyuser -pmypass mydatabase > mydumpfile.sql
@jaircuevajunior
jaircuevajunior / plesk_php_composer.md
Created February 6, 2018 12:32
PLESK - PHP CLI + COMPOSER

PHP

Available versions:

  • 5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1

Example:

/opt/plesk/php/7.1/bin/php

COMPOSER

@jaircuevajunior
jaircuevajunior / mysql_debian_user.md
Last active March 4, 2024 15:13
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:

/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! :)

@jaircuevajunior
jaircuevajunior / Apache Average Memory Usage.md
Created February 19, 2018 14:59
Apache Average Memory Usage
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'

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 / fix_certbot.md
Last active January 29, 2019 12:54
Fix certbot TLS-SNI-01 deprecation
@jaircuevajunior
jaircuevajunior / csr_key_gen.sh
Created March 26, 2019 16:22
Generate CSR and Private Key for SSL Certificate Request
#!/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 / aws-ec2-setup-guide.md
Last active April 17, 2024 15:08
A simple guide to help myself setup a common LAmP environment on a AWS Ubuntu 18.04 instance with things that I should not forget

AWS EC2 Setup Guide

Enable Swap File (2GB)

fallocate -l 2G /swapfile &&\
chmod 600 /swapfile &&\
mkswap /swapfile &&\
swapon /swapfile &&\
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab &&\
free -h