0 Comments

There are a lot of benefits with managed disks and it is the preferred way to create a new VM. However because of my tight budget, I wanted to move to unmanaged. I did not expect the costs to continue when the VM was stopped. It was because of the managed storage disks(s).

I found this SO answer of Jason Ye - MSFT.

$sas = Grant-AzureRmDiskAccess -ResourceGroupName "[ResourceGroupName]" -DiskName "[ManagedDiskName]" -DurationInSecond 3600 -Access Read  
$destContext = New-AzureStorageContext –StorageAccountName "[StorageAccountName]" -StorageAccountKey "[StorageAccountAccessKey]"
$blobcopy=Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer "[ContainerName]" -DestContext $destContext -DestBlob "[NameOfVhdFileToBeCreated].vhd"

I had to create containers in the storage account but I had copied both the OS and the Data disk to the blob storage as .vhd file.

I used this powershell script and the template to create the vhd from blob storage. The datadisk can be added later in the web gui.

  1. Login-AzureRMAccount
  2. Get-AzureRmSubscription
  3. Set-AzureRmContext -SubscriptionName "my subscription name here"
  4. $sas = Grant-AzureRmDiskAccess -ResourceGroupName "resourcegroup" -DiskName "manageddiskname" -DurationInSecond 45000 -Access Read 
    $destContext = New-AzureStorageContext –StorageAccountName "storageaccount" -StorageAccountKey "myprivatekey"
    $blobcopy=Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer "vhd-containers" -DestContext $destContext -DestBlob "givetheunmanageddiskaname.vhd"
  5. Get-AzureStorageBlobCopyState -Container "vhd-containers" -Blob "givetheunmanageddiskaname.vhd" -Context $destContext –WaitForComplete

My mistake was to use the 3600 value for ‘DurationInSecond’ which is just an hour (60 sec, 60 minutes). The 512 gb datadisk could not be copied to blob storage within an hour (or two). Found out that an hour was also insufficient when I found ‘Get-AzureStorageBlobCopyState’.

Because I already had a vnet from my vm with managed disks, I used this template to create a new vm with the os disk from blob storage: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-specialized-vhd-existing-vnet

If you do not have a vnet yet, you should use https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image The deploy to azure button is a useful tool!

image

Once you have a new vm with an unmanaged disk up and running, close it to add the data disk. Once you have done that and have a remote desktop connection, go to disk management and bring the datadisk online again. It took me some time to get my head around the ASM and ARM differences in the powershell tooling. Also because there is now Azure Cli and a cross plat powershell 6.0

The cloud is moving fast, so hop on. Don’t miss out!


Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

I followed the guide but did not got it to work.

It just failed at step 3 and there was no error at all. I thought it had to do with me changing the project from .net Core 1.x to 2.0

image

But it was partially related to the dropdown below it.

The startup object was not set.

I had to set it to “Neo.Compiler.Program”

But after that, the publish did not work because “neon.dll” was missing in some folder.

This GitHub comment pointed me in the right direction:

https://github.com/neo-project/docs/issues/368#issuecomment-362181887

you should copy “neon.dll” manually in that dir. it’s just one dir below.

after that, the publish succeeded and the neon.exe reference was already in the path variable, so the Visual Studio and manually commandline option both worked!

image

https://github.com/neo-project/neo-compiler/issues/90

Good luck building for the Neo blockchain!

NEO (NEO) cryptocurrency

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

Perhaps it’s because I was still in holiday-mode, but I kept getting a 403 error. Even when I added a `helloworld.html` in the `.well-known` dir. Which was driving me crazy. I even thought it was .net Core 2.x related because all full framework sites were renewing just fine, both MVC and Webform applications.

The answer for my situation was in this comment:

Do you have both http/https binding? http binding is required for it to work.

I did, but I remembered something about forcing to SSL for this website.

I searched my code, but all I could find was commented out:

image

image

So how did I manage to force visitors to the SSL version? I could not remember it. There was also no URL rewriting in the web.config. It was a checkbox in IIS which I forgot that I ever changed that setting! (sorry for the Dutch screenshot of IIS 8.5)

 image

It would be nice if the new version of Let’s Encrypt Win Simple would temporary disable it and afterwards restored it.

Here is the link to the latest version 1.9.6.2


Good luck and best wishes for 2018!

Pin on pinterest Plus on Googleplus Post on LinkedIn

I am currently working on a side-project with the code-first approach. I really like how the framework does migrations and you can use the .sql files in the migration folder etc.

But I am still wrapping my head around the model/poco classes I want to use and the data structure is still changing in this stage of development. I have moved from 1-n relations to n-n etc.

I sometimes stumbled on a situation where there were foreign key constraints which made it (almost) impossible to process a migration. I also did not found how to revert one or cancel one if you have a pending one and cannot update the database.

Because I was still starting with the project I could not bother to loose all the data and start over with a clean/empty database. I have read several blogs about how to do this, but I wanted to blog my situation. Perhaps it’s useful for someone, perhaps it’s just an online note to myself.

Here is how I did it:

  1. Delete the ‘__MigrationHistory’ table
  2. Delete all files in the ‘Migrations’ folder of your project except the ‘Configuration.cs’
  3. Delete all other tables (one by one) in the DB
  4. In the package manager console, select the correct project and ‘Add-Migration <name>’
  5. Update-Database (this will recreate all tables and use the initial data from the configuration file, if you had any)

A lot of blogposts are based on keeping your data. In that case, you should skip step 3 (obvious) and comment out the ‘Up’ method when you have added your migration and have the generated file open.

This is a slightly modified version of this blogpost which uses the brand new SQL Operations Studio 0.23.6


Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn
0 Comments

If your iMac starts with a screen similar to this:

image

don’t worry! There is a solution. Apple admit that they had bad hardware in a certain line of 2011 models. Apple offered to replace the videocard for free. But that offer has expired. I was not even aware it existed.

Never mind, the Apple store says that replacing the videocard will be between 600 and 700 euro.

That’s an expensive solution, so here is a cheaper one:

Bake your video card in the oven

I found this YouTube video about opening the iMac and put the card in the oven.

https://youtu.be/9vPM41ZmLoshttps://images-na.ssl-images-amazon.com/images/I/41wB-fA7TbL._SY355_.jpg

Here are the ingredients for the recipe:

  • Torx T10 (almost all screws are t10)
  • Torx T9 (2 screws holding the video card to the cooling system)
  • Cooling paste
  • regular Phillips screwdriver
  • 2 suction cups
  • a bit of aluminum foil (to make 4 aluminum balls to stabilize the card in the oven on the plate)
  • conventional oven (with bottom and top radiation and a plate)

I also used some alcohol, tissues and q-tips/ cotton bud to remove the old cooling paste

Start by removing the ram modules from the bottom of the iMac.

Follow the steps in the video to remove the glass with the suction cups and remove 4 screws on each side of the panel to tilt the panel and disconnect all 4 connectors. Remove the panel and disassemble the main board/ logic board. The required screws cannot be found in the video. But you can find then in this video:

https://youtu.be/6B4iCYSWlWM?t=4m55s

The link starts the video at 4 minutes and 55 seconds. Which explains the screws you need to remove for the main board. afterwards you need to remove all connectors on the front. Tilt the board and remove the connectors on the back.

Follow that video to the end and then continue with the previous one to remove the cooling from the videocard.

clean the videocard and put it on 4 aluminum balls on a plate and put it in a pre-heated oven for 8 minutes on 200 degrees Celsius.

image

put new thermal/cooling paste on the chips and re-assemble everything. Do not forget the ram modules.

Here are some pictures from my baking experience:

IMG-20171108-WA0001IMG-20171108-WA0002WP_20171108_09_32_11_ProWP_20171108_09_32_19_ProWP_20171108_09_42_30_ProWP_20171108_09_51_20_ProWP_20171108_09_51_25_ProWP_20171108_10_23_18_ProWP_20171108_10_33_18_RichWP_20171108_10_37_19_RichWP_20171108_10_48_19_RichWP_20171108_11_39_23_RichWP_20171108_11_41_24_Rich

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn