Skip to content

Instantly share code, notes, and snippets.

@rslonik
rslonik / to_all_sites_ee.sh
Created September 11, 2019 22:39
do something to all sites in easy engine install
for site in `ee site list | grep -v example.com | sort | sed 's/\x1B\[[0-9;]*[JKmsu]//g'`
do
echo $site
#scp host:file.txt /var/www/$site/htdocs/
done
@rslonik
rslonik / Search_Replace_Emails.sql
Last active September 11, 2019 12:36
Search and replace bad domains in email list sql
update wp_mailster_subscribers set email = replace(email, '.comm', '.com');
update wp_mailster_subscribers set email = replace(email, '.combr', '.com.br');
update wp_mailster_subscribers set email = replace(email, 'gmail.com.br', 'gmail.com');
update wp_mailster_subscribers set email = replace(email, 'gamil.com', 'gmail.com');
update wp_mailster_subscribers set email = replace(email, 'hotmal.com', 'hotmail.com');
update wp_mailster_subscribers set email = replace(email, 'homail.com', 'hotmail.com');
@rslonik
rslonik / Installing-Directus-MariaDB-10.1.41.md
Last active September 6, 2019 13:23
Installing Directus

ERROR 1709 (HY000) at line 59: Index column size too large. The maximum column size is 767 bytes.

SET GLOBAL innodb_file_format = Barracuda;
SET GLOBAL innodb_large_prefix=on;
SET GLOBAL innodb_default_row_format = dynamic;
@rslonik
rslonik / cache-onesignal.md
Last active August 28, 2019 18:25
Force OneSignal to not skip cache in EasyEngine
if ($request_uri ~* "onesignal") {
  set $skip_cache 0;
}
@rslonik
rslonik / gist:6e28f5403834a78364081a9501c8a1b1
Created August 27, 2019 23:33
sshd fails to start because missing /var/run/sshd dir (ubuntu)
vim /usr/lib/tmpfiles.d/sshd.conf
# remove the "/var"
d /run/sshd 0755 root root
systemd-tmpfiles --create
now the dir will be created at boot and ssh will show up
-------
https://serverfault.com/questions/941855/why-am-i-missing-var-run-sshd-after-every-boot
-------
@rslonik
rslonik / easyengine-update-php.md
Created August 27, 2019 20:38
Atualizar PHP no easyengine

How to install php7.2-fpm with EasyEngine (Ubuntu)


Add php7.2 repository

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Install php7.2-fpm

@rslonik
rslonik / nginx-geoip.md
Created August 27, 2019 20:37
NGINX GEOIP HEADER

nginx -V Precisa ter o módulo --with-http_geoip_module instalado.

mkdir /etc/nginx/geoip cd /etc/nginx/geoip

Baixar a base GeoIP em CSV e converter pra DAT https://dev.maxmind.com/geoip/geoip2/geolite2/ wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip

@rslonik
rslonik / products_with_category.sql
Created August 27, 2019 20:37
QUERY Woo Products With Price, Name, Category
SELECT
wp_posts.post_title AS Product,
wp_postmeta1.meta_value AS SKU,
wp_postmeta2.meta_value AS Price,
GROUP_CONCAT( wp_terms.name ORDER BY wp_terms.name SEPARATOR ', ' ) AS ProductCategories
FROM wp_posts
LEFT JOIN wp_postmeta wp_postmeta1
ON wp_postmeta1.post_id = wp_posts.ID
AND wp_postmeta1.meta_key = '_sku'
LEFT JOIN wp_postmeta wp_postmeta2
@rslonik
rslonik / ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY.md
Last active September 11, 2019 21:26
ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY
/var/www/site.com/conf/nginx/ssl.conf
https://gist.github.com/kiki67100/f5b421ddac9d500297b0e6471e5ef737

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
@rslonik
rslonik / VideoStories-HomeVideoScript.yml
Last active March 22, 2017 18:19
VideoStories - Home Video
# Video Name - without spaces
name: "HomeVideoStories"
# Square image 40x40
watermark: "https://videostories.co/wp-content/uploads/2017/03/videostories-40-allwhite.png"
# Any size up to 500x500
logo: "https://videostories.co/wp-content/uploads/2017/03/videostories-allwhite.png"
# Used in the ending background