Skip to content

Instantly share code, notes, and snippets.

View lucasapoena's full-sized avatar
💻

Lucas Apoena lucasapoena

💻
View GitHub Profile
@lucasapoena
lucasapoena / dotnet-efcore-3.1-many-to-many-map.cs
Last active February 21, 2022 12:05
Relacionamento Many-to-Many no Entity Framework 3.1 (EF Core 3.1)
namespace Example.Dotnet
{
public class DatabaseContext : DbContext
{
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
{
}
#region --- DBSets ---
public DbSet<Product> Products { get; set; }
@lucasapoena
lucasapoena / dotnet-efcore-3.1-many-to-many.cs
Last active February 21, 2022 11:56
Relacionamento Many-to-Many no Entity Framework 3.1 (EF Core 3.1)
using System.Collections.Generic;
namespace Example.Dotnet
{
public class Product
{
public long ProductId { get; set; }
public string Name { get; set; }
public virtual ICollection<ProductCategory> ProductCategories { get; set; }
@lucasapoena
lucasapoena / public-stun-list.txt
Created January 10, 2022 23:54 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@lucasapoena
lucasapoena / SQL_Express_Backups.sql
Created October 26, 2021 10:41
SQL_Express_Backups.sql
-- Copyright ? Microsoft Corporation. All Rights Reserved.
-- This code released under the terms of the
-- Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
USE [master]
GO
/****** Object: StoredProcedure [dbo].[sp_BackupDatabases] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
@lucasapoena
lucasapoena / README.md
Created September 21, 2021 18:59 — forked from JaimeStill/README.md
ASP.NET Core Active Directory Integration

Active Directory Authentication

This will provide an example of integrating Active Directory authentication in an ASP.NET Core app.

Note, you'll need to be running on a Windows domain with Visual Studio debugging in IIS Express for this to work.

Setup

In launchSettings.json, you'll want to modify iisSettings by turning on windowsAuthentication:

@lucasapoena
lucasapoena / convert-SVN-To-GIT-Windows.bat
Created July 29, 2021 15:38
Convertendo repositório SVN para o GIT no Windows
SET projeto=NomeProjeto
SET urlPathSVN=https://svn.seuservidor.com.br/svn/%projeto%
SET pathFolderSVN=C:\Projetos\SVNtoGIT
SET git_userName=lucasapoena
mkdir %pathFolderSVN%\%projeto%
cd %pathFolderSVN%\%projeto%
git svn init %urlPathSVN% --no-metadata
name: dotnet5_tests_coverlet_nuget
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CAMINHO_PROJETO_TESTES: ./Groffe.Distancias.Testes
@lucasapoena
lucasapoena / SQLServer_reindex.sql
Created June 22, 2021 23:23
Script para reorganizar/recriar índices no Microsoft SQL Server
DECLARE @tableName nvarchar(500)
DECLARE @indexName nvarchar(500)
DECLARE @percentFragment decimal(11,2)
DECLARE @page_count int
DECLARE FragmentedTableList cursor for
SELECT dbtables.[name] AS 'Table',
dbindexes.[name] AS 'Index',
indexstats.avg_fragmentation_in_percent,
indexstats.page_count
/*
** Incluir nova requisição POST para localhost que será utilizada para incluir os utils
** Incluir na área de Pre-request Script, o script abaixo:
*/
/*------------- UTILS ---------------*/
postman.setEnvironmentVariable("utils", () => {
var gerarCPF = () => {
const geraNumeroRandomico = (n) => Math.round(Math.random() * n);
const mod = (base, div) => Math.round(base - Math.floor(base / div) * div)
@lucasapoena
lucasapoena / install-configure-letsencrypt.sh
Created August 3, 2020 14:00 — forked from hewersonfreitas/install-configure-letsencrypt.sh
Install and configure LetsEncrypt on Ubuntu Server 14.04 & 16.04 (Apache) forked from craigvantonder/install-configure-letsencrypt.sh
#!/bin/bash
# https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04
# Download the Let’s Encrypt Client
cd /usr/local/sbin
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x /usr/local/sbin/certbot-auto
# Set Up the SSL Certificate