Mark Thompson

C# / .NET Developer, Certified Scrum Master, Fan of Team Foundation Server

Welcome to BlogEngine.NET

If you see this post it means that BlogEngine.NET is running and the hard part of creating your own blog is done. There is only a few things left to do.

Write Permissions

To be able to log in, write posts and customize blog, you need to enable write permissions on the App_Data and Custom folders. If your blog is hosted at a hosting provider, you can either log into your account’s admin page or call the support.

If you wish to use a database to store your blog data, we still encourage you to enable this write access for an images you may wish to store for your blog posts.  If you are interested in using Microsoft SQL Server, MySQL, SQL CE, or other databases, please see the BlogEngine docs to get started.

Security

When you`ve got write permissions set, you need to change the username and password. Find the sign-in link located either at the bottom or top of the page depending on your current theme and click it. Now enter "admin" in both the username and password fields and click the button. You will now see an admin menu appear. It has a link to the "Users" admin page. From there you can change password, create new users and set roles and permissions. Passwords are hashed by default so you better configure email in settings for password recovery to work or learn how to do it manually.

Configuration and Profile

Now that you have your blog secured, take a look through the settings and give your new blog a title.  BlogEngine.NET is set up to take full advantage of many semantic formats and technologies such as FOAF, SIOC and APML. It means that the content stored in your BlogEngine.NET installation will be fully portable and auto-discoverable.  Be sure to fill in your author profile to take better advantage of this.

Themes and Plugins

One last thing to consider is customizing the look and behavior of your blog. We have themes and plugins available right out of the box. You can install more right from admin panel under Custom.

On the web

You can find news about BlogEngine.NET on the official website. For tutorials, documentation, tips and tricks visit our docs site. The ongoing development of BlogEngine.NET can be followed at Github. You can also subscribe to our Youtube channel.

Good luck and happy writing.

The BlogEngine.NET team

Force facebook to use a specifc image when someone posts a link to your website

Just been asked how to force facebook to use a specific image when posting.

Facebook appears to select an image at random (I'm not sure what the algorithm is).

Quite often this isn't the best image to use or even completely wrong like Twitter Tweet now logo.


Firstly, you can check which image facebook will use for an given url at:
https://developers.facebook.com/tools/debug/

To force facebook to use a specific Image you need to reference it in the head section.

For example:
<link rel="image_src" href="http://www.markthompson.me.uk/Custom/Themes/Standard/images/markthompson_thumbnail.jpg">




Useful Hyper-V Configuration


Enabling Remote Desktop

If you installed Hyper-V Core, run this to enable remote desktop:

cscript C:\Windows\System32\Scregedit.wsf /ar 0


To Enable Connections from Non Server 2012 Hosts (Less secure) run:

cscript C:\Windows\System32\Scregedit.wsf /cs 0

(Note - This isn't needed with So You Start Hyper V Core installations)


Enable remote Desktop through the firewall

From Powershell

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"


Setting up a Virtual Hosting Environment for £30 a month with So You Start (OVH) and Hyper V

Recently I was asked if I get help set up Hyper V Core 2012 on a so you start dedicated server.

Firstly – So You Start (www.soyoustart.co.uk) are part of OVH.  Their dedicated servers are really cheap. 
Their network is fast, the dedicated server performs well.
However as you might expect for the money, their support is lacking to say the least.

I spent a good two days trying to figure out  how on earth to setup a public switch on a server with one NIC, which is also used to remotely administer the box.
Every time you try using a GUI the NIC is disconnected and you lose all contact with the box.  Even restarting wont help you.

Below are my steps to get a fully working Hyper V server with unlimited traffic for about £30 a month.  Bargain.

Usual Disclaimer– No Warranties/ Guarantees,  Don’t blame me if it doesn’t work, bursts into flames or steals your dog.  This worked for me, once.


1.) Install some software

Hyper V Core, while excellent and Free doesn’t have much of a UI (Think Dos / Powershell).

We’re going to use chocolatey package installer to save us a lot of time.
For the latest commands and to find out   more head over to www.chocolatey.org.


From the command prompt run:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

This installs the chocolatey package manager.

Now some other useful bits and pieces we may need (Remove any trailing whitespace if copying and pasting)
choco install googlechrome
choco install filezilla.server

  (This didn’t work for me.  Instead I launched Chrome and downloaded it from File Zilla).


Google Chrome – A web browser (If you don’t know this you probably shouldn’t be following these steps  ).  This will allow us to download other installers as needed.  See the notes on File Zilla Server below for an example.  Files will be downloaded to c:\users\root\downloads.

File Zilla Server – A solid FTP server allowing us to send files (Like Iso images for windows to our server and download backups of our VM’s as needed).



2.) Configure File Zilla


Add a user.
Highly Recommended – Configure FTP over SSL

Now we need to allow

Now Create a firewall rule allowing connections to filezilla through the windows firewall.
From a power shell prompt run (Type PowerShell:
New-NetFirewallRule -DisplayName "FTP In" -Direction Inbound -Protocol TCP –Enabled True –Action Allow -Profile Any -Program "c:\program files (x86)\filezilla server\filezilla server.exe" -Service Any -LocalPort 20,21,1024-65535 -EdgeTraversalPolicy Allow

Make sure you enable SSL (Click Generate new certificate to get started)

Happy days.  You can now start uploading a windows ISO to your shiny server.  While that’s going on, we’ll configure Hyper V.


3.) Set up 5Nine Hyper V Manager

Hyper V Core doesn’t come with any kind of management UI.  Out of the box your options are:
• Manage it with power shell
• Enable Remote Management and start opening up more ports in your firewall.

Neither of these appealed to me. Fortunately a company called 5 Nine provides a Hyper V Remote Management Tool for free (I.e. no money).


Using Google Chrome, head over to 5Nine and download it (Registration required) from www.5nine.com.

Unfortunately it comes as a zip file.
I downloaded portable 7 zip (No Install) to Expand it.
7Zip Portable can be downloaded from:
http://portableapps.com/apps/utilities/7-zip_portable


Install it and run it.


Fantastic – You now have a tool to manage your Hyper Server.  Whatever you do at this point do not create an external switch.  The One and only NIC your server has would be used for the switch and a new virtual NIC created using DHCP.  You lose all connectivity with your dedicated server.  The only way to get it back I found was to reimage it.  Let’s not do this okay?



4.) Create an External Switch from the command line

This is the hard part that really had me banging my head of the wall.  If you create an external switch you lose connectivity.


You need to determine the Adapter name to use.  Do to this from a Power Shell prompt run:


Get-NetAdapter

This will list the name of your adapters.  Figure out which one you want to use for your switch.
In my case it was Ethernet 2.

Save the Power Shell Script below to a ps1 file (say c:\MakeSwitch.ps1).  You can run:
Notepad c:\makeswitch.ps1
To do this.  Update it with the correct name determined above.

<#
Make Switch for So You Start Dedicated Server
Usaage:
execute the command Get-NetAdapter
This lists the ethernet adatpers.
Replace "ethernet 2" below with the name of your connected physical adapter
Adapted from:
http://blogs.technet.com/b/heyscriptingguy/archive/2013/10/09/use-powershell-to-create-virtual-switches.aspx
#>

Import-Module Hyper-V
$ethernet = Get-NetAdapter -Name "ethernet 2"
New-VMSwitch -Name externalSwitch -NetAdapterName $ethernet.Name -AllowManagementOS $true -Notes 'Parent OS, VMs, LAN'
New-VMSwitch -Name privateSwitch -SwitchType Private -Notes 'Internal VMs only'
New-VMSwitch -Name internalSwitch -SwitchType Internal -Notes 'Parent OS, and internal VMs'

This actually creates three switches, one of each type.   (external, internal and private).

Done.  You now have a working hyper V server.  Now Launch 5 Nine Manager and start creating your VMs.


Read my next blog post on setting up a Hosting VM on a So You start Hyper V Server.