- Install VSCode _ Install C# Extensions _ Install Auto-Using
- Install dotnet sdk 2.2.402 -> https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-2.2.402-windows-x64-installer
- Install msbuild 2019 -> Build Tools for Visual Studio 2019 (Down on bottom) -> https://visualstudio.microsoft.com/downloads/
- Install dbeaver to be able to view sqlite dbs or use this for simple option: https://sqlitebrowser.org/blog/portableapp-for-3-11-2-release-now-available/
- From cli run: dotnet dev-certs https
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
| version: 1.0.{build} | |
| image: Visual Studio 2015 | |
| build_script: | |
| - cmd: PowerShell -Version 2.0 .\build.ps1 | |
| test: off |
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
| SELECT | |
| cast(r.total_elapsed_time as decimal(18,2)) / 1000 / 60, | |
| r.session_id | |
| ,st.TEXT AS batch_text | |
| ,SUBSTRING(st.TEXT, statement_start_offset / 2 + 1, ( | |
| ( | |
| CASE | |
| WHEN r.statement_end_offset = - 1 | |
| THEN (LEN(CONVERT(NVARCHAR(max), st.TEXT)) * 2) | |
| ELSE r.statement_end_offset |
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
| Mock<IValidator<Suggestion>> validator = new Mock<IValidator<Suggestion>>(); | |
| validator.Setup(v => v.Validate(It.IsAny<ValidationContext>())).Returns(new FluentValidation.Results.ValidationResult()); |
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
| CREATE LOGIN {{username}} WITH PASSWORD = '{{strong_password}}'; | |
| CREATE DATABASE {{database_name}}; | |
| ALTER DATABASE {{database_name}} SET RECOVERY SIMPLE; | |
| ALTER AUTHORIZATION ON DATABASE::{{database_name}} TO {{username}}; | |
| SELECT suser_sname (owner_sid), * FROM sys.databases ORDER BY name WHERE name = '{{database_name}}'; | |
| --FOR WINDOWS LOGIN | |
| create login [<<DOMAIN\USERNAME>>] from windows; | |
| -- For older versions of SQL Server: |
Creating nuspec file
Go to the path with the .csproj file
Run the following command:
nuget spec
Filling out assembly info
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
| using System; | |
| using System.Net; | |
| class Webby | |
| { | |
| public string Request(string url, string processName) | |
| { | |
| try | |
| { | |
| WebClient client = new WebClient(); |
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
| WebRequest request = WebRequest.Create("https://splunkserver/services/collector"); | |
| request.Method = "POST"; | |
| request.Headers.Add("Authorization", "Splunk YOUR_GUID"); | |
| ASCIIEncoding encoding = new ASCIIEncoding(); | |
| var requestBody = JsonConvert.SerializeObject(new | |
| { | |
| @event = new |
OlderNewer