Skip to content

Instantly share code, notes, and snippets.

View ronnysuero's full-sized avatar
🏠
Working from home

Ronny Zapata ronnysuero

🏠
Working from home
View GitHub Profile
@ronnysuero
ronnysuero / EncryptSmallData.md
Created November 24, 2023 19:20 — forked from QingpingMeng/EncryptSmallData.md
Encrypt data using JavaScript in browser with RSA public key generated in C# without library

This is an example to demo how you generate the RSA key pair from server side(.NetCore 3.1) and pass the public key to the client(Browser) for encrypting the data that <= 245 bytes.

RSA-2048 can only support to encrypt up to 245 bytes data.

Generate RSA key pair in C# (.Net Core 3.1):

using var rsaProvider = new RSACng();
// spki is used for browser side encryption
var spki = Convert.ToBase64String(rsaProvider.ExportSubjectPublicKeyInfo());
var encodedPrivateKey = Convert.ToBase64String(rsaProvider.ExportPkcs8PrivateKey());
SQL Server 2017
----------------
Enterprise Core - 6GPYM-VHN83-PHDM2-Q9T2R-KBV83
Developer - 22222-00000-00000-00000-00000
Enterprise - TDKQD-PKV44-PJT4N-TCJG2-3YJ6B
Standard - PHDV4-3VJWD-N7JVP-FGPKY-XBV89
Web - WV79P-7K6YG-T7QFN-M3WHF-37BXC
https://www.teamos-hkrg.com/index.php?threads/microsoft-sql-server-english-2017-rtm-teamos.42103/
@ronnysuero
ronnysuero / restore.sql
Created October 2, 2019 20:13
Restore Db
EXEC sp_attach_db @dbname = N'AdventureWorks2012',
@filename1 =
N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Data\AdventureWorks2012_Data.mdf',
@filename2 =
N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Data\AdventureWorks2012_log.ldf';
@ronnysuero
ronnysuero / gist:9d6d924f78f854921451f4a25df59c6f
Last active August 6, 2019 14:03
Diferentes appsettings.json en netcore
-- Colocar esta seccion en Program.cs
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureAppConfiguration((hostingContext, config) =>
{
config.AddJsonFile($"appsettings.release.json", true, true)
.AddJsonFile($"appsettings.test.json", true, true)
.AddJsonFile($"appsettings.json", true, true);
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
@ronnysuero
ronnysuero / ElmahMySql.sql
Created December 26, 2018 18:50
ElmahMySql
-- ELMAH - Error Logging Modules and Handlers for ASP.NET
-- Copyright (c) 2004-9 Atif Aziz. All rights reserved.
--
-- Author(s):
--
-- Nick Berardi, http://www.coderjournal.com
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
@ronnysuero
ronnysuero / ElmahSqlServer.sql
Last active December 26, 2018 18:48
ElmahCore Sql Server
/*
ELMAH - Error Logging Modules and Handlers for ASP.NET
Copyright (c) 2004-9 Atif Aziz. All rights reserved.
Author(s):
Atif Aziz, http://www.raboof.com
Phil Haacked, http://haacked.com
@ronnysuero
ronnysuero / rowtable.sql
Last active October 25, 2018 17:32
Total Rows By Table Sql Server
WITH UnUsedTables (
TableName
,TotalRowCount
,CreatedDate
,LastModifiedDate
)
AS (
SELECT DBTable.NAME AS TableName
,PS.row_count AS TotalRowCount
,DBTable.create_date AS CreatedDate
/*
ELMAH - Error Logging Modules and Handlers for ASP.NET
Copyright (c) 2004-9 Atif Aziz. All rights reserved.
Author(s):
Atif Aziz, http://www.raboof.com
Phil Haacked, http://haacked.com
@ronnysuero
ronnysuero / .gitconfig
Created July 17, 2017 15:08 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com