Skip to content

Instantly share code, notes, and snippets.

View nul800sebastiaan's full-sized avatar
🔥

Sebastiaan Janssen nul800sebastiaan

🔥
View GitHub Profile
@nul800sebastiaan
nul800sebastiaan / gist:1553316fda85011270ce2bde35243e5b
Created October 15, 2021 13:07
Fully unattended Umbraco 9 + Starter Kit install with automatic DB creation in SQL server
dotnet new umbraco -n UmbracoUnattended --connection-string "Server=GORDON\SQLExpress;Database=UmbracoUnattended;User Id=sa;Password=abc123;"
cd UmbracoUnattended
Set-Item Env:\UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE true
Set-Item Env:\UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED true
Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME "Test"
Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL "test@test.com"
Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD "test123456"
dotnet add package Umbraco.TheStarterKit
@nul800sebastiaan
nul800sebastiaan / README.md
Created November 4, 2021 09:19
Install VS templates for multiple frameworks

Go into a folder, let's say C:\MyTest Run: dotnet new globaljson This will create a global.json file with your current version of the dotnet CLI in it, for example:

{
  "sdk": {
    "version": "6.0.100-rc.2.21505.57"
  }
}
@nul800sebastiaan
nul800sebastiaan / BlogOverviewController.cs
Created October 5, 2021 09:39
BlogOverviewController.cs
using System;
using System.Linq;
using Cultiv.Site.Models;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Web;
using System;
using Hangfire;
using Hangfire.Console;
using Hangfire.SqlServer;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Web.BackOffice.Authorization;
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1
$domain = "mydomain.com"
$certificiatePassword = "abcd1234"
$email = "letsencrypt@mydomain.com"
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $vault
cd $vault
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/
New-ACMERegistration -Contacts mailto:$email
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language alias="vi_vn" intName="Vietnam (Vietnamese)" localName="Vietnam (Vietnamese)" lcid="" culture="vi-VN">
<creator>
<name>The Umbraco community</name>
<link>https://our.umbraco.com/documentation/Extending-Umbraco/Language-Files</link>
</creator>
<area alias="actions">
<key alias="assignDomain">Culture and Hostnames</key>
<key alias="auditTrail">Audit Trail</key>
<key alias="browse">Browse Node</key>
using System.Web.Routing;
using Umbraco.Core;
namespace RemoveRoutes
{
public class RemoveRoutesStartupHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
// Reference: https://github.com/umbraco/Umbraco-CMS/issues/5206
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Hosting;
using System.Web.Http;
using Umbraco.Web.WebApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Umbraco.Forms.Core.Enums;
using System.Net;
using System.Collections.Specialized;
using Umbraco.Core.Logging;
using Umbraco.Forms.Core.Providers.Models;
### Keybase proof
I hereby claim:
* I am nul800sebastiaan on github.
* I am cultiv (https://keybase.io/cultiv) on keybase.
* I have a public key ASAauWBO4XaKeymtplaJ1_H_AutCKhCYBSAvnEI9lIr5ZQo
To claim this, I am signing this object: