Nginx + SSL setup for DigitalOcean Ubuntu 22.04/24.04.
SSH into your server, then run:
curl -L -o setup_server.sh https://gist.githubusercontent.com/umair-me/3f760da9f209fd589fe5632f83340d44/raw/ServerSetup.sh| trigger: | |
| - main | |
| variables: | |
| solution: '**/*.sln' | |
| buildPlatform: 'Any CPU' | |
| buildConfiguration: 'Release' | |
| stages: | |
| - stage: Build |
| Mock<IConfiguration> configuration = new Mock<IConfiguration>(); | |
| configuration.Setup(c => c.GetSection(It.IsAny<String>())).Returns(new Mock<IConfigurationSection>().Object); |
| cd path/to/project-b | |
| git remote add project-a path/to/project-a | |
| git fetch project-a | |
| git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge | |
| git remote remove project-a |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Microsoft.Extensions.Hosting; | |
| namespace WebApplication24 | |
| { | |
| public abstract class HostedService : IHostedService |
| --This assumes 24 hours to the minute: | |
| DELETE | |
| MyTableWhere | |
| WHERE | |
| MyColumn < DATEADD(day, -1, GETDATE()) | |
| --This assumes yesterday midnight: | |
| DELETE |
| /* Drop all non-system stored procs */ | |
| DECLARE @name VARCHAR(128) | |
| DECLARE @SQL VARCHAR(254) | |
| SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name]) | |
| WHILE @name is not null | |
| BEGIN | |
| SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']' | |
| EXEC (@SQL) |
| ngrok http -host-header=localhost 5000 |
| [Column(TypeName = "nvarchar(24)")] | |
| public SomeEnum Name { get; set; } |
| String strPathAndQuery = HttpContext.Current.Request.Url.PathAndQuery; | |
| String strUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace(strPathAndQuery, "/"); | |
| // OR | |
| Request.Url.GetLeftPart(UriPartial.Authority) | |
| // https://stackoverflow.com/a/10337955/1158845 | |
| // OR | |