Skip to content

Instantly share code, notes, and snippets.

View aristidesneto's full-sized avatar

Aristides Neto aristidesneto

View GitHub Profile
@aristidesneto
aristidesneto / create_user_mariadb
Last active November 18, 2017 22:31
Criação de banco de dados e usuário MariaDB/MySql
## Criar database
CREATE DATABASE name_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
## Criar usuario
CREATE USER 'userbd'@'localhost' IDENTIFIED BY 'password';
## Adicionando privelegios
GRANT ALL PRIVILEGES ON name_database.* TO 'userbd'@'localhost';
## Listar usuários criados e seus respectivos bancos
@aristidesneto
aristidesneto / source.list
Created November 18, 2017 22:30
Source.list Debian 8
### ------------------
### Debian 8 "Jessie"
### ------------------
deb http://http.debian.net/debian/ jessie main contrib non-free
deb-src http://http.debian.net/debian/ jessie main contrib non-free
### -----------------------------------
### Debian 8 Jessie Security "Updates"
@aristidesneto
aristidesneto / sources.list
Created November 18, 2017 22:31
Source.list Debian 9 - Stretch
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://deb.debian.org/debian/ stable main contrib non-free
deb-src http://deb.debian.org/debian/ stable main contrib non-free
deb http://deb.debian.org/debian/ stable-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stable-updates main contrib non-free
@aristidesneto
aristidesneto / default.conf
Created November 18, 2017 22:34
Configuração de site Nginx
server {
# Port that the web server will listen on.
listen 80;
listen [::]:80;
# Host that will serve this project.
server_name localhost;
# Useful logs for debug.
access_log /var/log/nginx/localhost_access.log;
@aristidesneto
aristidesneto / install-server.sh
Created November 18, 2017 22:36
Script para instalação Servidor Web
### Script para instalação e configuração de um servidor LEMP
### Dist. Debian 9 (Strech)
### Esse script é utlizado em uma instalação nova do Debian Stretch na Linode
### Nada impede alterar e utilizar conforme suas necessidades
### Atualizado em 18/11/2017
### Por Aristides Neto
### Salvar o script em um diretório de sua preferência
### Dar permissão de execução
@aristidesneto
aristidesneto / example.com.br
Last active December 15, 2017 23:57
Configuração Nginx SSL
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com.br www.example.com.br;
return 301 https://$server_name$request_uri;
}
server {
ssl_certificate /etc/letsencrypt/live/example.com.br/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com.br/privkey.pem;
# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
<?php
// Dados de conexao com o banco
define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'user_db');
define('MYSQL_PASSWORD', 'pass_db');
define('MYSQL_DB_NAME', 'name_db');
define('HOME', 'http://example.com');
try
@aristidesneto
aristidesneto / source.list
Created December 12, 2017 17:04
Source List - Debian 9 Stretch
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
# deb http://deb.debian.org/debian/ stable main contrib non-free
# deb-src http://deb.debian.org/debian/ stable main contrib non-free
# deb http://deb.debian.org/debian/ stable-updates main contrib non-free
# deb-src http://deb.debian.org/debian/ stable-updates main contrib non-free