Skip to content

Instantly share code, notes, and snippets.

View fabiotatsuo's full-sized avatar

Fabio Tatsuo fabiotatsuo

View GitHub Profile
@fabiotatsuo
fabiotatsuo / gist:6109973
Last active December 20, 2015 09:40
mongodb
show dbs
use db_name
show collections
#display tables
db.testData.find()
var c = db.testData.find()
>>> from django.contrib.sites.models import Site
>>> site = Site()
>>> site.domain = 'example.com'
>>> site.name = 'My website'
>>> site.save()
>>> site.id
@fabiotatsuo
fabiotatsuo / gist:6373342
Created August 29, 2013 01:30
install PIL
http://www.sandersnewmedia.com/why/2012/04/16/installing-pil-virtualenv-ubuntu-1204-precise-pangolin/
@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;
@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 / 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
<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 / 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
@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
Test 443
nc -vz localhost 443
curl -v https://www.mywebsite.com/