New Updates to VSCode. Code Minimap

Preview: Minimap
A Minimap gives you a high level overview of your source code which is very useful for quick navigation and code understanding. To enable VS Code’s Minimap, set editor.minimap.enabled: true to turn on the rendering of a Minimap for the current file.

https://code.visualstudio.com/updates/v1_10#_preview-minimap

Share on Facebook

Setup True RDP on another port in Azure ARM for a single VM

How to Secure a VM’s RDP.
Not every bear out there is Winnie the Pooh, and we have caught some interesting bears caught in our honeypots.

One of the most hit aspects of security is RDP on the default ports with poor password governance.
– “But doesn’t everyone use 40-100 char passwords that change every 3 days and user names that would confuse C3PO?”.

The answer from the average security person is. “Heck yea everyone should”, but we all know the truth. A username of “admin” and a password of “password” only keeps your kids and the neighbors from getting into your router. It doesn’t do much good against brute force attacks.

… Let’s get started. This demo assumes you have already setup a virtual machine in ARM in Azure with Remote Desktop Protocol already working on the default IP and port.

Part 1: Create Load Balancer

-“Ok Done! We are with you but what is with all the tomfoolery! What is this magic you speak of?”

The magic comes in with the Load Balancer. First things first, let’s create that.

Add New Load Balancer.

Give the Load balancer a public IP. This will allow it to be seen on the “interwebs”.

Name the IP address and make it static. (Unless you want Dynamic, but you will need to get your Load Balancers IP when it changes.)

We then make sure everything is properly assigned and set the Resource Group to the same one as the Virtual Machine.

 

Open the Load Balancer you just created.

Add New Inbound Nat Rule to the Load balancer.

-“Hey this isn’t magic or gnomes! I set this up in my router in the 90’s, you know back when IRC was cool and my email address ended in compuserve”.

You got me, this is just like that.

Figure out the Port you want to connect to on the external Load Balancer

Forward that to 3389 internally.

Step 1.

Set NAT Rule you can point to an AS or just a single VM..

 

This should make it so you can hit the Load balancers IP:PORT and get into RDP.

*Port would be something like 4000 or 10001. If your IP were 169.0.0.1. Then your RDP line would read 169.0.0.1:4000 or 169.0.0.1: 10001. Those would translate to the 3389 port internally and still connect you to the VM via RDP.

– For all you kids raising your hands out there. Yes 169. addresses usually mean no DHCP could be contacted and that IP should never happen. – Overachievers!

Any other ports that need to make it through here you can also set up 1 rule per. HTTP, HTTPS etc. You can keep the PORTS the same if you just want a pass through. You can keep them or NAT translate them.

Part 2: Removing Public IP from VM.

Hold my ‘coffee’. We’ve got this, and if not, there is always support. Right?

  • “Wait, are you selling support hours? ”

You will never know, or maybe you will in 5.

Go to your Virtual machine, click network interfaces. Then double click on the record with NAME -PUBLIC IP ADDRESS

Click on IPCONFIGURATION then double click the appropriate Name for the configuration.

Disable the public IP.

 

Hit save.
Your traffic will now be forced to go through load balancer where you can change IP’s etc. You should no longer be able to hit your machine through the externalIP:3389.

NOTE: Your Network Security Group will not change, it will still need access to ALL on 3389 if you wish to connect from everywhere.

 

Part 3: Don’t like only having an IP address?

  • “My phone keeps all my numbers in it, if I can’t remember those… How about a name for this monstrosity?”

Easy Peasy, well easy as a few UI clicks. Back to the Portal!

Select your Virtual machines from the Virtual machine menu.



Double click under Public IP Address/DNS name label

 

Set the DNS Name in the Textbox. This will Give your Load Balancer Endpoint that DNS location.

You should now be able to get to your VM through the LB!


NOTE: Security groups are still required on your VM or your subnet in order for data to pass through.

 

Thanks again for all the work Matt Garing and Sumeet Kumar in helping hash this out.

Questions? (About this article)

Mark Rowe Mark.Rowe@Microsoft.com

 

Share on Facebook

If you lose RDP access after setting a Inbound Rule to change port in Azure

If you lost RDP access after setting your inbound rule to another IP.  You can get it back by setting the RDP back to 3389 and then “redeploying” You can get the box to give you access again.   This is a work around to get access back only if you tried using the Inbound rule to “port forward as a different port” through the Azure Security Group and didn’t change it internally on the VM itself.

Inbound Rule
Can’t connect
Cannot Connect
RDP
3389
Azure Security Group
ARM Azure Resource Manager

Share on Facebook

String efficient methods for things like “case insensitive contains”.

public static bool StartsWithAndContains(this string toSearch, string startsWith, string contains)
 {
 return toSearch.StartsWithIgnoreCase(startsWith) && toSearch.ContainsIgnoreCase(contains);
 }public static bool EqualsIgnoreCase(this string toSearch, string equals)
 {
 return string.Equals(toSearch, equals, StringComparison.OrdinalIgnoreCase);
 }

public static bool StartsWithIgnoreCase(this string toSearch, string startsWith)
 {
 return toSearch.StartsWith(startsWith, StringComparison.OrdinalIgnoreCase);
 }

public static bool ContainsIgnoreCase(this string toSearch, string contains)
 {
 return (contains == string.Empty || toSearch.IndexOf(contains, StringComparison.OrdinalIgnoreCase) != -1);
 }
Share on Facebook

Some of the new Attendant type SDK’s from Microsoft – Cortana and BOT.

For Cortana!
Cortana Devices SDK:
Cortana Skills Kit:
https://blogs.windows.com/buildingapps/2016/12/13/cortana-skills-kit-cortana-devices-sdk-announcement/#PJwh3kkso647IhgB.97

For Chat Bots.
Microsoft Bot Framework:
Bot Framework SDK
New Azure BOT service!
Azure Bot Services

Share on Facebook

Breaking your WordPress.

Problem: After adding Plugin “Share to Facebook”, the entire site crashes. Works ok in PHP 5.5 but not 7.

Fatal error: ‘break’ not in the ‘loop’ or ‘switch’ context in 

like-box.php on line 84

Change break to return Like so:

new-bitmap-image

try {
$page_info = Facebook_WP_Extend::graph_api_with_app_access_token( '/fql', 'GET', array( 'q' => 'SELECT page_url FROM page WHERE ' . $where ) );
} catch ( WP_FacebookApiException $e ) {
return;
}
Share on Facebook

Get OxyPlot to work with WPF.

Download Examples:
https://github.com/oxyplot/documentation-examples/tree/master/HelloWorld/WpfApplication1

 

Find the DLL”s used with the WPF sample application and go “Old School”.

ixyplot1

I copied them into a third party DLL and referenced them with browse.

 

ixyplot2

Then I was able to use:

xmlns:oxy=”http://oxyplot.org/wpf”

ixyplot3

or like this fora plot.

<oxy:Plot Title=”Some Title>
<oxy:Plot.Axes>
<oxy:LinearAxis Position=”Bottom” Minimum=”-10″ Maximum=”10″ />
<oxy:LinearAxis Position=”Left” Minimum=”-10″ Maximum=”10″ />
</oxy:Plot.Axes>
</oxy:Plot>

 

ixyplot4

Everything else left errors.

Could not find missing assembly

Share on Facebook

Better IOT Board – Dragon Board – I like it.

http://makezine.com/2015/10/29/microsoft-windows-iot-support-arduino-dragonboard/

I was very happy to see that there is finally some alternatives with built in WIFI!
These should come in handy for all sorts of engineering designs as it has less “loose part” than you would see with a PI in general.

I like the look too.

Share on Facebook

IOT Interface?

Looking to see fi some UI behind the boards makes sense.
oemseletc

Share on Facebook

HDInsight Rough notes.

HD insgiht is hadoop?

WTF? Hadoop is not a ms product, well yes it is.
Hadoop is open source. MapReduce.

Flume and scoop import and export data out of hadoop.

Domain specialists and write a program and distribute processing across all nodes, apply structure then add.
Azure Data factory, its to be SSIS in teh cloud.

What is the differece between Scoop, Flume and Azure Data Factory. We’ve recommened Scoop in teh past, Flume Log data, scoop data can react with. scoop is schema driven.
Describe the schema and import it.

Why would you use Hadoop or hdinsight ?
Money… its cheaper to deal with large amounts of data on cheap hardware. Now we do it in the cloud and hte compute instance are valid.

TO have hadoop and blob storage – HDInsight.

To not charge you money, delete it. rather than spin down.

Job scheduling service – UZI
HIVE – SQL like query ontop of data.
Those can store metadata in the database.

These columns are related to directory in storage you can store it in an external database. You can store Metadata in SQL then you can use that metadata against the blobs
Base is a no sql data store. (Great access time), has management API
Storm – real time event processing plug components together or a graph, inputs and as stream between parts. Using glasses. If you never take the cluster down you don’t want to do the offset again. Made in Java you can extend it to work with any programming language.
Storm in Python.

Spark is a cluster type, just came out of preview, for windows. NEAR REAL TIME BATCH PROCESSING

SPARK is the new one. <------ Hotness. Java is the base for Hadoop you can do JVM. 80% it java. Spark is Scala compared to Java. R is popular with Data science, you can install R components in Hadoop we want to install R not eh Hadoop cluster. \ Azure machine learning, we use it for learning, we analyze data through a neural network. PowerShell command libel Azure CLI (implemented in node JS). SDK's .NET /Python/Node.js Cluster is a group and you can feed that tot the azure service and it will "make that happen". I can then create my template and use it how I want it. How do you feed template? You can feed it through command lines or SDK's or Raw Restful API. Wire it up to a button and then it will get the prams and then start. We have a GitHub repository, Azure Quick start templates. All of them Readme and then you can click and deploy to azure. GitHub look for HDInsight Then you can get the templates. You can spin up a predefined cluster. HDInsight can be up and running in less than 15 minutes. (Usually 15 minutes). Watch Hadoop spin up. Click on a cluster. Cluster is its own entity. If I want eon query logs from heck. Chuck ne and egg problem. You need data in a cloud to do data analysis. It would take you millennia. HDInsight can query for both. If you have data locally, HDINSIGHT app gateway even if you have that data you still ahv to deliver tot he cloud. How do I create a solution to HDInsight. Eclipse, Maven or gradle. VISUAL STUDIO <-- no im not partial Extractions versus MapReduce, sql like query over Hadoop. You need to be able to assign rows and columns, If you were a sql developer you may want to write in sql. This is just base hive. There isn’t a hive over spark. There is a spark sql. The data is still stored in a blob. The way hive works and then you can create table over this database. It’s a CSV file T1 as string t2 as integer. X Compressed fast, then you can’t read it outside that hive unless it has a abstraction of MapReduce. Pig is mapping. You will have to recreate the cluster. Hive -> changes to MapReduce.
Jupiter tries to run everything in memory so its faster.

Use data factory to get data to the cloud.

Share on Facebook