Embedded Code on Sharepoint

If you like me and want to have source code examples or just add snipets of text/code added to a WIKI page then here is a great example of making it look good and make it very shareable.

​Whenever I put documentation together the last thing I want to do is work on lots of formating. Rather use syntax highlighting from an editor or use some great javascript libraries that do the work for you. Now I was working on something where I was leveraging a Sharepoint WIKIs for lots of documentation and it has its limitations in using those capabilities.

The other thing I like to be able to do is share the snippets of code so others can use it. Well there is a great service called Gist from Github. It allows you to share a snippet by posting it on Github and then send someone a link.

I wanted to use this concept with Sharepoint where I post it on Github but then display it on a WIKI in a nice formated way. Well Sharepoint has the ability to add Embedded Code, which is essentialy adding Javascript to a WIKI page. Now Github also provides the ability to generate Embedded Code that will allow you to then paste this into the page. A perfect marriage I must say.

So instead of writing down all the steps look at the video and see how this done.

Embedded Code in Sharepoint

Azure Command Line Interface

Most cloud providers have done a good job at putting together a web ui that allows you to manage the cloud assets such as Virtual Machines (vms). But when trying to manage many vms or just wanting to perform some simple tasks as starting a vm command line interfaces #cli can’t be beat.

#Azure is no exception to this and they have provided a couple of means of manazing your account, assets etc via a #cli. They provide two ways of doing this either through #PowerShell or the cross platform cli based on #nodejs. I choose the later as the prefered mechanism as it’s cross platform and it seems the like the simplest way of using it.

To get started 1st download #nodejs http://nodejs.org/download/ for the platform you’re working on. There are number of prebuild packages but you can build it from source code as well. Next you’ll need to use the node.js package manager #npm to install the azure component:

npm install azure-cli -g

Now that you have installed this part you’re ready to link your account to the cli. You do this by downloading the settings and then importing them. Using the azure command download this will start the download. In which your default browser will be loaded, login to azure with the account you want to link and the download starts.


azure account download

After the file is downloaded you can then import the account by using the import command. Below is the example of the file “Visual Studio U-13-2014-credentials.publishsettings” was downloaded by the browser and using the import command we add it to my profile for the cli.


azure account import "C:\Users\yourtruly\Downloads\Visual Studio U-13-2014-credentials.publishsettings"

Now you’re ready to use the azure commands. Here are some example commands:

List your vms:

azure vms list

Create a Ubuntu vm:

azure vm create

b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_4-LTS-amd64-server-20140514-en-us-30GB azureuser password –location “West US” -e 22

Check out the references:
http://azure.microsoft.com/en-us/documentation/articles/command-line-tools/#Commands_to_manage_your_Azure_virtual_machines
http://www.hanselman.com/blog/ManagingTheCloudFromTheCommandLine.aspx