This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Problem | |
Illuminate\Database\QueryException: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from `tasks`) in file C:\estudos\apiRestLaravel\todo\vendor\laravel\framework\src\Illuminate\Database\Connection.php on line 670 | |
# Solution | |
alter user 'user'@'%' identified with mysql_native_password by 'MyPassword'; | |
flush privileges; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$errors = [ | |
'a' => ['1', '2'], | |
'b' => ['3'] | |
]; | |
$reducer = function ($accumulator, $key) use ($errors) { | |
$payload = $errors; | |
if (is_array($errors[$key])) { | |
$payload = implode(', ', $errors[$key]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Família Debian, Ubuntu | |
systemctl [comando] apache2.service | |
service apache2 [comando] | |
/etc/init.d/apache2 [comando] | |
Família HadHat, CentOS | |
systemctl [comando] httpd.service | |
service httpd [comando] | |
/etc/init.d/httpd [comando] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hoje a dica é sobre como esconder a versão do HTTPD Apache, você deve estar se perguntando o porque de esconder a versão de seus Softwares. Bem acontece que sabendo a versão correta do seu httpd fica bem fácil achar algum exploit para explorar falhas da versão, aumentando bastante a chance de sucesso do atacante. Esta dica não serve como proteção, mais podemos usá-la como complemento, aumentando a significativamente a segurança. | |
Se você instala seu httpd através dos fontes, você pode alterar seu src/include e editar o httpd.h | |
Localize as linhas: | |
SERVER_BASEPRODUCT | |
SERVER_ BASEREVISION | |
Você pode usar sua imaginação, por exemplo mentir que o daemon httpd é um IIS. | |
Agora vamos mudar algumas linhas no httpd.conf. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Criando a chave composta: | |
migration | |
====================================================================== | |
public function up() | |
{ | |
Schema::create('seller_areas', function (Blueprint $table) { | |
$table->string('codven',4); | |
$table->string('setzon',4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Observers; | |
use App\Festa; | |
class FestaObserver | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes | |
Para resolver isso siga os passos abaixo: | |
Edite o arquivo app\Providers\AppServiceProvider.php | |
Adicione o namespace use Illuminate\Support\Facades\Schema; | |
Dentro do método boot adicione Schema::defaultStringLength(191); | |
Resultado final do arquivo: | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ... } | |
created() { | |
if (this.packageTypeIndex) { this.buscaEmbalagem() } | |
if (this.clearanceIndex) { this.buscaDesembaraco() } | |
}, | |
{ ... } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="modal fade" v-bind:id="nome" tabindex="-1" role="dialog"> | |
<div :class="defineModal" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<h4 class="modal-title">{{titulo}}</h4> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
</div> | |
<div class="modal-body"> | |
<slot></slot> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Modal nome="editar_imposto" :titulo="'N° '+ $store.state.auth.item.id " tipo='lg' > | |
<Formulario @errors="e($event)" @resetaritens="resetarItens($event,'imposto')" :dados="$store.state.auth.item" method="put" id="formEditar_Imposto" :item="$store.state.auth.item.id" url="v1/imposto/"> | |
<div class="row"> | |
<div class="form-group col-md-3"> | |
<label for="valorPrevisto">Valor Previsto</label> | |
<money v-model="$store.state.auth.item.valor_previsto" name="valorPrevisto" v-bind="money" class="form-control form-control-sm" readonly></money> | |
</div> | |
</Formulario> | |
<span slot="botoes"> | |
<button form="formEditar_Imposto" class="btn btn-success" type="submit">Atualizar</button> |
NewerOlder