Saturday, 24 June 2017

Running SQL Server Configuration Manager without SQL Server installed

I like to have SQL Server Management Studio (SSMS) installed as part of my standard development environment. Usually this is because I also have an instance of SQL Server Developer or Express Edition installed, but not always.

One thing I noticed with the separate distribution of SSMS is that it also includes all the other management tools that used to be bundled with the server, like SQL Server Configuration Manager.

I wanted to change the SQL Client configuration settings and Configuration Manager is the tool I’d use to do that. But when I fired it up (it’s named SQL Server vNext CTP2.0 Configuration Manager in the latest release of SSMS), I’ve been greeted with this message:

Error dialog from SQL Server Configuration Manager

I don’t see this problem when an instance of SQL Server is installed though.

The fix is documented in KB 956013. I ran the following from an elevated command prompt:

mofcomp "%programfiles(x86)%\Microsoft SQL Server\140\shared\sqlmgmproviderxpsp2up.mof"

Now SQL Server Configuration Manager starts up without error

Oh, and the easiest way to install SSMS is to use Chocolatey!

choco install sql-server-management-studio

Monday, 15 May 2017

TypeScript tsconfig.json being ignored in C# project

TL;DR - Make sure your tsconfig.json file has the Build Action set to Content

I have some TypeScript files included in a .NET project. I added the Microsoft.TypeScript.MSBuild NuGet package to the project to enable the TypeScript compiler to transpile the .ts files to JavaScript. All was good until I wanted to set some compiler options using the tsconfig.json file. I created this file but every time I compiled the project it didn’t do anything different.

I almost pulling out my hair in frustration, so I decided to dig in deeper to find out why this was happening.

First, I ran msbuild with detailed logging. That showed up the following line just before the CompileTypeScript target was run:

Target "PreComputeCompileTypeScriptWithTSConfig" skipped, due to false condition; ('@(ConfigFiles)' != '') was evaluated as ('' != '').

A bit more digging led me to packages\Microsoft.TypeScript.MSBuild.2.3.1\tools\net45\Microsoft.TypeScript.targets – This defines that PreComputeCompileTypeScriptWithTSConfig target which is looking for @(ConfigFiles), which in turn is set in target FindConfigFiles. That target calls the FindConfigFiles task that is in TypeScript.Tasks.dll.

Firing up JetBrains dotPeek to reflect on the code for FindConfigTasks shows that it uses the ContentFiles property to look for existing tsconfig.json files, and that property is set to @(Content) in the targets file.

Jumping back to my project, I notice this:

Screenshot of tsconfig.json and Build Action set to None

Ah haa! Let’s set that Build Action to Content and try again..

Yes! Building the project shows tsc.exe being passed the --project parameter pointing to the tsconfig.json file!

Friday, 5 May 2017

Speaking at NDC Sydney 2017

Well this happened!

Congratulations message

Yes, my talk “Life is like a Box of Chocolate(y)” was accepted for NDC Sydney!

I’ll be speaking about using Chocolatey and BoxStarter as a way of scripting out the configuration of your developer workstation. You might think of these as more “IT” tools, but I want to show developers how easy they are to use.

Combined with Windows 10’s Reset, this means you can rebuild your Windows environment in a matter of minutes, allowing you to apply the “cattle, not pets” approach to your own PC.
NDC Sydney banner

Last year I attended NDC as a volunteer crew member and afterwards said that “this is THE developer event in Australia”.

So go have a look at the speakers and sessions. I reckon it’s a pretty compelling line-up, and if you register before Sunday 14th May, you can take advantage of early bird prices.

I hope to see you there!

Sunday, 16 April 2017

Someone has created a Facebook profile using your name and photo

One in a series of posts on Facebook Security and Privacy

First off, don’t panic! Unless you have a really poor password, it’s unlikely that you have been hacked. Instead an annoying person has just created a new Facebook account, copied your profile picture and name, and is presumably now going through your friend list asking to become friends, and confusing all your friends who thought you were already their friend.

What can you do?

Use the Facebook “Report” function to ask Facebook to delete the fake account.

  1. Open the fake profile page (Just click on the name)
  2. Click on the ‘…’ button (to the right of the Message button), then click Report.
    Facebook-Report_thumb
  3. Select Report this profile and click Continue
  4. Select They're pretending to be me or someone I know and click Continue
  5. Select Me and click Continue
  6. Select Submit to Facebook for Review
  7. Usually within a matter of hours, someone at Facebook will review the details and shut down the offending account.

How can you reduce the risk of this happening?

Review your Facebook privacy and sharing settings to stop non-friends from seeing your friends list and your profile photo.

Enable Two Factor Authentication to reduce the risk of your actual Facebook account being really compromised.

Setting your Facebook privacy and sharing

One in a series of posts on Facebook Security and Privacy

If you use Facebook, you should take the time to review your privacy settings and be deliberate about what details you share with the public (as distinct from just your friends). Setting this appropriately can help prevent annoying people from creating fake Facebook accounts that have the same profile photo and name as you, and that then try to trick all your Facebook contacts into become friends with them.

There’s no one answer to setting privacy settings. Some people might be quite happy to share everything with everyone whereas others will prefer to keep things strictly between friends. The important thing is that you understand and are comfortable with what you’re sharing to whom.

To review your general privacy settings

  1. Click on the drop-down menu on the top right in Facebook in your web browser
  2. Click Settings
  3. On the left, click Privacy
  4. Review the settings and change to your preference if necessary.

To restrict who can see your profile picture

  1. Go to your Facebook profile (click on your name in the top menu bar in Facebook in your web browser)
  2. Click on your profile photo
  3. To the right of the photo, click on the icon next to the date
    Reviewing profile picture sharing settings
  4. Review the current setting and change to your preference if necessary. Choosing a non-public option will reduce the risk of someone copying your profile photo. On the other hand it will make it harder for potential friends to find you.

To restrict who can see your friends

  1. Go to your Facebook profile
  2. Click on Friends
  3. Click on the ‘Pencil’ icon (Manage)
  4. Click Edit Privacy
    Facebook Friend Privacy
  5. Review the current settings. Choosing a non-public option will reduce the risk of someone pretending to be you trying to contact all your friends.

Don’t just accept the defaults, be deliberate and intentional about exactly how much and to who you are sharing your Facebook information with.

Securing your Facebook account with Two Factor authentication

One in a series of posts on Facebook Security and Privacy

You should consider enabling Two Factor Authentication (often shortened to 2FA) for logging in to Facebook. This means in addition to having a unique password for Facebook (that you don’t use for any other online services), you also have to enter a (usually) 6 digit code (or receive a SMS text message) to confirm that it really is you signing in.

The two factors in “two factor” are 1) your password and 2) the 6 digit code.

The clever thing is that the 6 digit code changes every 30 seconds, so it’s no good writing it down as it will be out of date very quickly.

If you have a smart phone or tablet

  1. Install an authenticator app on your device.
    I recommend (and use) the Microsoft Authenticator app (which is available for iOS, Android and Windows Phone), but there’s other options including Google Authenticator and Authy.
  2. Open Facebook in your web browser (preferably on a different device to your smartphone)
  3. Go to Settings, then Security and then Login Approvals
    Facebook Security Settings
  4. In the Code Generator section, click on third-party app.
  5. A QR Code (like a barcode) appears.
  6. On your smartphone, open the Microsoft Authenticator app
  7. Click on ‘+’ to add a new account
  8. Choose Other
  9. Hold your smartphone in front of your computer’s web browser so that the phone’s camera can scan the QR Code.
  10. It should automatically scan the code and add a new account entry for Facebook. eg.
    Microsoft Authenticator
  11. Note the 6 digit number now being displayed on your phone.
  12. Also notice there’s a countdown timer displayed next to this number. When this timer reaches zero, the number will expire and a new number will be displayed.
  13. Switch back to your web browser and enter this number in the confirmation field and press Confirm
  14. Click Enable to allow Login Approvals.
  15. Click on Get Codes
  16. Enter your password
  17. Print out these codes and keep them in a safe place. You can use these codes as a last resort if you lose access to the Authenticator app (eg. your phone drops in the toilet)
  18. It is also a good idea to provide your mobile phone number as a fall back in case you lose access to the Authenticator app (eg. you accidentally deleted it).

From now on, each time you log in to Facebook from a new device you will need to provide the current 6 digits from the Authenticator app as additional proof of identity. If you use some devices regularly, you can then choose not to require two factor authentication in the future.

If you use the Facebook App on your device, that can also function as an authenticator app. The downside to using this is that it only works for Facebook, whereas an app like Microsoft Authenticator can work with many online services.

These include Amazon, Dropbox, Facebook, GitHub, Google accounts, Microsoft Accounts, Mailchimp, Twitter and others. Always choose to enable 2FA for any online services you use. Many banks and financial institutions are also using similar systems.

If you have a mobile phone

  1. Open Facebook in your web browser (preferably on a different device to your smartphone)
  2. Go to Settings, then Security and then Login Approvals
  3. In the Text message (SMS) section, if there is no number listed click on Add phone number
  4. Follow through confirming the phone number

From now on, when you log in to Facebook you’ll receive a SMS text message with a code. You’ll then need to provide that code in addition to your password. If you use a device regularly, you can tell Facebook not to prompt for 2FA again.

Using 2FA with text messages is much better than not using 2FA at all, but it isn’t quite as secure as using an authenticator app. If you can’t use an app then do enable 2FA using SMS. Some services even support non-mobile numbers by reading out the code instead of as a text message.

You just received a friend request on Facebook from someone who’s already a friend

One in a series of posts on Facebook Security and Privacy

First off, don’t panic! Almost certainly your friend has not “been hacked”. Instead an annoying person has just created a new Facebook account and copied your friend’s profile picture and name, and is presumably now going through their friend list asking to become friends.

What can you do?

Use the Facebook “Report” function to let your friend know.

  1. Open the fake profile page (Just click on the name. Don’t click on Confirm Request!)
  2. Click on the ‘…’ button (to the right of the Message button), then click Report.
    Facebook Report
  3. Select Report this profile and click Continue
  4. Select They're pretending to be me or someone I know and click Continue
  5. Select Someone I know and click Continue
  6. Select Message your friend
  7. Type in your friend’s name. Your friend’s existing Facebook profile should be listed.
  8. Click Send.
  9. You friend will receive a Facebook message with a link to the offending profile and they can follow it up by reporting it to Facebook.

If you’re particularly concerned, at step 6 you can also choose Submit to Facebook for Review. You will then be asked to select your friend’s real Facebook profile and send it off to Facebook.

Facebook security and privacy

I’ve had a number of friends on Facebook suffer the annoyance of having ‘fake’ accounts using the same name and profile picture to impersonate them and contacting all their friends asking to be friends.

It’s frustrating and annoying for everyone concerned. The victim who is being impersonated often also wonders if their Facebook account “has been hacked!”. Usually this is not the case, but I thought it would be helpful to write down some suggestions to help reduce the risk and help you feel more safe using Facebook.

Topics in this series:

Let me know in the comments if there’s anything else I should cover.

Tuesday, 4 April 2017

MVP Community Connection 2017

Microsoft SignageFriday morning I took the day off of work so I could fly over to Sydney to take part in a gathering of Australian Microsoft MVPs. Friday afternoon there was a networking/”unconference” event held at Microsoft’s North Ryde campus.

 

Microsoft, North Ryde

Later we travelled back to Darling Harbor to have some fun at Strike, trying out their Escape Rooms (lots of fun).

Darling Harbour

The next morning we gathered for breakfast followed by a full day of speakers and workshops. Everyone got these really nice cards of appreciation with personalised Lego mini-figures. Not sure that my hair is brown, but then I’m not really sure what colour it is – the days of being blonde, or even ‘dirty’ blonde are well behind me Smile

Card with "Thankyou for being awesome"

During the afternoon, I was asked to do a short presentation about running a user group. I can tell you I was more than a little bit nervous getting up in front of such an experienced group of people, but I think it went ok.

Early Sunday morning, I flew back home. All in all a great time catching up with friends and learning a lot.

Saturday, 25 February 2017

Richard’s Technical Debt

These are my notes from listening to the recording of Richard Banks’ talk The Technical Debt Prevention Clinic that he gave recently at the Microsoft Ignite Australia 2017 conference.

TL; DR - This is a really compelling talk. Go watch it, and share it with your colleagues!

My notes and highlights follow. These are not a substitute for watching/listening to the talk, and the best thing (if you ever get the opportunity) would be to see Richard deliver this in person.

Technical debt

  • Is design complexity + cognitive load. Is NOT quick & dirty code
  • Bad code is not technical debt, it’s just bad code
  • Quantifying – look at trends over time
  • Don’t
    • do a “technical debt sprint”
    • Rewrite
  • Do
    • “Boy Scout Rule”

Refactoring

  • Micro-refactoring – do anytime
  • Macro-refactoring – plan and only do one at a time to limit disruption to team
  • Both should have tests in place – ideally behavioural tests (so you’re testing the behaviour not the implementation)

Feature flags

  • Really useful
  • Still need to be managed properly

Preventing

  • Be Professional – you don’t need permission to do your job properly
  • Have a Definition of Done and stick to it.
  • Automate everything you can
    • tests
    • code styles/rules
  • Change Team Culture

Code Reviews (suck)

  • Traditional code reviews often don’t work well for a number of reasons
  • Try doing peer refactoring
  • Or pair programming when it is “strong-style” where both people are engaged.
    • Put the mouse away!
  • Mob programming – maximise team intelligence
  • Experiment and find out what works for your team

Other tips

  • Avoid branching if possible. If not possible make it short-lived. This is because merging is costly
  • Premature optimisation
  • Resist temptations
  • Shared learning
  • Run hackathons
  • Adhere to that Definition of Done

Conclusion

Technical debt can be a good thing, but bad code never is.

Friday, 10 February 2017

Skeet, Cogan and VS 2017 launch date announced

It’s been a busy week!

On Wednesday evening we hosted the regular monthly meeting of the Adelaide .NET User Group in the Adelaide offices of RL Solutions. Our speaker was to be Jon Skeet talking about C# 7, joining us remotely from the UK. This involved a bit of logistical planning, including getting in enough seats for the expected crowd, getting a good PA (thanks Tom!), borrowing a nice data projector (thanks Keith!) and making sure everyone could get into the building after hours (thanks Vic!).

Jon Skeet, wrapping up presentationThere were a few gotchas along the way – I’d remembered the front door to our building closes at 6pm, but forgot that the lifts required a security card from 5.30pm. Then my laptop decided to freeze its screen when I reconnected the data projector and tried to launch PowerPoint as we were about to start. We got everyone upstairs and I rebooted my laptop and Jon was able to present his talk. I then realised that the pizzas were going to be delivered too early. So a quick change of schedule to introduce a 5 minute interval in the middle of the talk so everyone could grab some food before continuing on with part 2. Not to mention Tom running out to get some disposable plates as I’d overlooked those too.

But in the scheme of things, they were all pretty minor. All in all, I think it was a pretty successful night and I think lots of positive comments about Jon’s talk and also our office (the bar was especially popular!)

We recorded the Hangout so you can watch Jon’s presentation:


Adam Cogan presentingFriday afternoon is not when we’d normally have a user group meeting, but Adam Cogan was keen to visit and give us a preview of his Ignite Conference talk on What’s New in Visual Studio 2017 and Visual Studio Code.
The timing of Adam’s talk turned out to be quite good, as Microsoft have just announced the release date for Visual Studio 2017. Set your alarms for 2.30am on March 8th (Adelaide time) for a live streaming launch event.

I’ve already got two speakers (Ben Laan on Load Testing and Bronwen Zande on HoloLens) lined up for March, so I think we’ll make April’s meeting our local Adelaide launch event for VS 2017 (combined with Jack Ni on IoT).

It’s going to be a busy year!