Skip to content

Instantly share code, notes, and snippets.

View fabiotatsuo's full-sized avatar

Fabio Tatsuo fabiotatsuo

View GitHub Profile
@fabiotatsuo
fabiotatsuo / gist:672174ac209ff5160cde
Created March 23, 2016 07:07
Query one to many mysql
use databse;
SELECT
n.id as noticia_id,
n.titulo as post_title,
n.categoria_noticia_id as categoria_noticia_id,
c.nome as tag_name
FROM noticia as n
LEFT JOIN categoria_noticia as c ON c.id = n.categoria_noticia_id
@fabiotatsuo
fabiotatsuo / gist:69b73cb0f9bb407c187a
Created March 3, 2016 21:26
Diagram MySql database
Create a diagram for a mysql db
MySQL Workbench
Menu Database > Reverse Engineer...
@fabiotatsuo
fabiotatsuo / gist:8dd898f0b0fa64d185af
Created March 3, 2016 21:01
Mysqldump export 1000 lines from a mysql database
$ mysqldump --opt --where="1 limit 1000" -u root -p yourdatabase > dump.sql
Test 443
nc -vz localhost 443
curl -v https://www.mywebsite.com/
@fabiotatsuo
fabiotatsuo / gist:0a8c9ac7a538dc4a7dec
Last active October 12, 2015 11:26
Download S3 Bucket using AWS CLI, Mac
$ brew install awscli
Add the following to ~/.bashrc to enable bash completion:
complete -C aws_completer aws
$ aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]:
Default output format [None]: json
@fabiotatsuo
fabiotatsuo / gist:ce0ae1ecb3cdccd09654
Last active August 29, 2015 14:26
Create sftp password access to server Ubuntu 15.04 EC2
List all groups
cut -d: -f1 /etc/group
sudo groupadd sftp
Group Password Authentication
sudo vim /etc/ssh/sshd_config
Match Group sftp
PasswordAuthentication yes
<li class="menu-item menu-item-2 taxonomy loaded mega-menu-item" data-loop="menu" data-type="mega">
<a class="parent-item no-icon" href="#Your url page">
<span class="category-title">Menu Title</span>
<span class="triangle triangle-border"></span>
<span class="triangle"></span>
</a>
<ul class="placeholder mega-loader" style="display: none; top: 110px;">
<li>
<div class="loading">
<span class="theme-icon-spin2"></span>
@fabiotatsuo
fabiotatsuo / Install ElasticSearch 1.6.0 Ubuntu 15.04
Last active December 16, 2016 16:21
Install ElasticSearch 1.6.0 Ubuntu 15.04
Install Java
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo aptitude -y install oracle-java8-installer
java -version
Install ElasticSearch
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.deb
@fabiotatsuo
fabiotatsuo / gist:c843f1495ef5ffa0aa46
Created May 22, 2015 17:56
Imagemagick install revista Server
yum install -y ImageMagick ImageMagick-devel
/usr/share/Imagemagick
@fabiotatsuo
fabiotatsuo / gist:98b8c9d57a322737e25c
Created May 5, 2014 20:24
Query exemplo many to many
SELECT DISTINCT nome, email
FROM usuario u
INNER JOIN entidade e
ON e.usuario_id = u.id
INNER JOIN pessoa_fisica p
ON p.id = e.pessoaFisica_id
WHERE email IS NOT NULL;