Skip to content

Instantly share code, notes, and snippets.

@migcosta
migcosta / php-versions-installed
Created March 20, 2018 15:11
find the php versions installed
#find php versions installer
locate bin/php
@migcosta
migcosta / .htaccess
Created March 19, 2018 10:02
redirect local folder to remote folder on a different server
<IfModule mod_rewrite.c>
#redirect local folder to remote folder on a different server
RedirectMatch "^/[local-folder-name]/(.*)" "https://[remote-domain]/[remote-folder-name]/$1"
</IfModule>
@migcosta
migcosta / gist:3ddc7f15038ff242647970f36b7724e8
Last active March 15, 2018 11:18
virtual hosts location on apache
#to find your virtual hosts location on apache On (CentOS,Fedora, RHEL)
#1 - Find the httpd location
find / -name "httpd"
#2 - Dump the hosts
httpd -S
#(-S stands for: "synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG" )
<!--[if (gte mso 9)|(IE)]>
<center style=" background-color:red">
<table>
<tr>
<td width="280">
<![endif]-->
<div style="max-width:180px; margin:0 auto; background-color:blue">
<p>this will create a 280px on outlook/IE and a 180px on the other</p>
</div>
<!--[if (gte mso 9)|(IE)]>
@migcosta
migcosta / max_width_email_template.html
Created December 11, 2017 15:14 — forked from stoyanvi/max_width_email_template.html
HTML Email Template: max-width hack for MS Outlook
<!--[if (gte mso 9)|(IE)]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<div style="max-width: 600px; margin: 0 auto;">
<p>This text will be centered and constrained to 600 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@migcosta
migcosta / compare_2_mysql_dbs
Last active December 5, 2017 13:46
compre the db structure of 2 mysql databases
#https://stackoverflow.com/a/26384329/4970584
#for a quick solution
mysqldump --skip-comments --skip-extended-insert -d --no-data -u root -p dbName1 | sed 's/ AUTO_INCREMENT=[0-9]*\b//'>file1.sql
mysqldump --skip-comments --skip-extended-insert -d --no-data -u root -p dbName2 | sed 's/ AUTO_INCREMENT=[0-9]*\b//'>file2.sql
diff file1.sql file2.sql
#for a more complex solution use https://github.com/dlevsha/compalex