Tuesday, December 22, 2020

Virtual Box - Resize existing disk

In cmd 

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd {Name}.vdi --resize {size in MB}

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Friday, December 18, 2020

MS SQL - Db stuck in 'Restoring... '


RUN SQL QUERY ON THE DB:

 RESTORE DATABASE [DATABASENAME] WITH RECOVERY

Monday, December 14, 2020

Ubuntu WSL

Change to Root like this:  "sudo su"

Python set higher version default

 Set Python 3.5 with higher priority

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2

Check the result

sudo update-alternatives --config python
python -V

Wednesday, December 9, 2020

Error handling Episerver - 404 etc..

 

1. <customErrors mode="Off" /> (off - Everyone gets to see your errors guts, On - Everyone gets the Nice error page. remoteonly - only those local to the code get to see the errors guts)


2. Global error handling => false (EPiServers handling of this is problematic. <applicationSettings globalErrorHandling="Off")


3. Set route -> routes.MapRoute("Error_404", "notfound", new { controller = "DefaultPage", action = "Error404" });


4. Use httpErrors to direct to Your 404 action (<error statusCode="404" path="/notfound" responseMode="ExecuteURL" />)


5. Controller:


[BVNetwork.NotFound.Core.NotFoundPage.NotFoundPage]

public ActionResult Error404()

{

var startPage = ContentReference.StartPage.GetPage<StartPage>();

var notFoundPage = startPage.NotFoundPage.GetPage<StandardPage>();

ControllerContext.RequestContext.SetContentLink(startPage.NotFoundPage);



Response.StatusCode = (int)HttpStatusCode.NotFound;

Response.TrySkipIisCustomErrors = true;

var model = CreateModel<StandardPage>(notFoundPage);



return View("~/Views/StandardPage/Index.cshtml", model);

}