Skip to content

Instantly share code, notes, and snippets.

View cristiancorreau's full-sized avatar

Cristian Correa cristiancorreau

View GitHub Profile
@cristiancorreau
cristiancorreau / update_domain_wp.sql
Last active July 17, 2017 00:23
Update links site Wordpress change domain
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@cristiancorreau
cristiancorreau / wpfix.sh
Created January 5, 2021 15:39
Fix wordpress file permissions CentOS
#!/bin/bash
#
WP_OWNER=apache # <-- wordpress owner
WP_GROUP=apache # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
WS_GROUP=apache # <-- webserver group
# reset to safe defaults
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
find ${WP_ROOT} -type d -exec chmod 755 {} \;
@cristiancorreau
cristiancorreau / gist:77cfef9409383096a548ad308ad24e81
Created September 22, 2021 12:22
fix flutter doctor not detecting android studio plugins on mac
#ln -s ~/Library/Application Support/Google/AndroidStudio[VERSION]/plugins ~/Library/Application\ Support/AndroidStudio[VERSION]
#Example for AndroidStudio2020.3
ln -s ~/Library/Application Support/Google/AndroidStudio2020.3/plugins ~/Library/Application\ Support/AndroidStudio2020.3
@cristiancorreau
cristiancorreau / gist:afec3bad8bb165ef0efe897ea0d13cd2
Created September 22, 2021 13:01
.zshrc Android Studio MAC
export ANDROID_SDK_ROOT=/Users/{USER}/Library/Android/sdk
export ANDROID_HOME=/Users/{USER}/Library/Android/sdk
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"
@cristiancorreau
cristiancorreau / site.conf
Created December 15, 2022 01:17 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null