Setting all indexes to have zero replicas with Elasticsearch

To configure all indexes (including existing ones) to have zero replicas (useful if running on only one server, e.g. in development), execute this (syntax assumes you’re using Sense):

PUT /_settings
“index” : {
“number_of_replicas” : 0

Then check it’s worked by running this:

GET /_cat/indices?v

Posted in Uncategorized | Leave a comment

Stdout logging in ASP.NET 1.1.1 Azure Web Apps

Because I keep forgetting it:

Posted in Uncategorized | Leave a comment

RavenDB: CryptographicException & FormatException: Input string was not in a correct format

If you get an error similar to the below and are using encrypted databases, make sure that you’re running the RavenDB process as the same user you were when the databases were created/encrypted.

The encryption keys are stored in per-user stores by Windows so if you created the database while RavenDB was running as a Windows Service (as LOCAL SYSTEM) and then later run RavenDB directly using Raven.Server.exe it will be running as the logged in user, not LOCAL SYSTEM and won’t have access to the encryption keys.

Raven.Database.Server.Tenancy.AbstractLandlord`1,Warn,,45,Could not unprotect secured db data Raven/Encryption/EncryptIndexes setting the value to '<data could not be decrypted>',"System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.
   at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
   at Raven.Database.Server.Tenancy.DatabasesLandlord.Unprotect(DatabaseDocument databaseDocument) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 283
Raven.Database.Server.Controllers.RavenDbApiController,Warn,,45,Could not open database named: XXXX Input string was not in a correct format.,"System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at Raven.Database.Config.InMemoryRavenConfiguration.Initialize() in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Config\InMemoryRavenConfiguration.cs:line 339
   at Raven.Database.Server.Tenancy.DatabasesLandlord.CreateConfiguration(String tenantId, DatabaseDocument document, String folderPropName, InMemoryRavenConfiguration parentConfiguration) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 263
   at Raven.Database.Server.Tenancy.DatabasesLandlord.CreateTenantConfiguration(String tenantId, Boolean ignoreDisabledDatabase) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 99
   at Raven.Database.Server.Tenancy.DatabasesLandlord.TryGetOrCreateResourceStore(String tenantId, Task`1& database) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Tenancy\DatabaseLandlord.cs:line 160
   at Raven.Database.Server.Controllers.RavenDbApiController.TrySetupRequestToProperResource(RequestWebApiEventArgs& args) in c:\Builds\RavenDB-Stable-3.0\Raven.Database\Server\Controllers\RavenDbApiController.cs:line 618
Posted in Uncategorized | Comments Off on RavenDB: CryptographicException & FormatException: Input string was not in a correct format

Pukka tea tasting notes

I bought a Pukka teas taster pack a few weeks ago, and kept notes so I could remember which ones I wanted to buy more of. These are my personal tastes and opinions, your results may differ!

star anise & cinnamon – “A velvety swirl of organic star anise, cinnamon & ginger” – Good but not sure I’d want to drink a whole box full, perhaps one for winter.

lively english breakfast – “A perky blend of organic whole leaf tea, ginseng & licorice” – Had this with milk. Quite good but a bit “fruity” for tea with milk. Not one I’ll be buying a box of.

three tulsi – “A sacred organic blend flowering with vibrant clarity” – A bit like Jasmine tea, not bad but a bit flowery for me.

lemon, ginger & manuka honey – “A welcoming cup of spicy-sweet organic bliss” – Very good, a classic. Though the manuka honey is only a flavouring, it doesn’t actually contain any. Not so good if left to go cold.

cool mint green – “An organic spearmint splash into green’s goodness” – Pretty much what it says on the tin – green tea with a hint of mint. A good combo – takes the edge of the green tea bitterness. Might buy this one.

rooibos & honeybush – “A copper red charm of organic earthy delight” – Not much to say really, tastes of rooibos – quite nice but not that keen personally.

lemongrass & ginger – “An uplifting organic lemony zing with a flying finish” – Not bad, hard to describe really – not quite as interesting as it sounds. Not interesting enough to consider buying any more. The lemony-ness is very subtle.

licorice & cinnamon – “A luxuriously sweet organic treasure gilded with golden spice” – You can’t really go wrong with this one – very nice, sweet and warming. Would buy again.

lemon & mandarin with lemon verbena – “An organic citrus sensation to cheer your senses” – Not quite as exciting or fruity as it sounds but a good fruity tea, similar to lemon and ginger I guess.

detox – “A lemony spring of organic aniseed, fennel & cardamom” – Nice and refreshing, light, lemony. Doubt it actually detoxes anything though!

elderberry & echinacea with elderflower – “A rich organic embrace tingling with fruity warmth” – Fruity, nice. Hard to distinguish all the flavours but would buy again.

wild apple & cinnamon with ginger – “A sunlit orchard of organic warmth & sweet spice” – Not bad and quite warming though not sure about the apple.

blackcurrant beauty – “Deliciously deep purple organic fruits to help you glow inside and out” – Blackcurranty, not much more to say.

womankind – “A delicate dance of organic cranberry, rose & sweet vanilla” – I had this in a pink mug to match the packaging. Not bad, lots of ingredients but none of them really stood out. Fairly generic “fruity” tea.

clean green – “A fresh burst of pure organic green tea with a luscious lemony lift” – Basically green tea with a hint of lemon. Pretty good though, takes the bitter edge off. I’d buy this if I wanted a green tea.

vanilla chai – “A caffeine-free organic lift flushed with cinnamon warmth” – Nicer than other chai teas I’ve had – I couldn’t really taste the vanilla but it seemed to work.

relax – “A deeply soothing fusion of organic chamomile, fennel & marshmallow root” – I had this on a stressful day to put it to the test – not sure if it worked or not. It was nice but not memorable – I probably wouldn’t buy this again.

sweet vanilla green – “A seductively sweet organic melody of soothing vanilla and whole leaf green tea” – Good but not that sweet and not much vanilla flavour. Better than plain green tea though.

gorgeous earl grey – “An inspiring infusion of organic whole leaf, bergamot & lavendar” – I’m not a massive earl grey fan but this one seemed pretty good – nice and smooth though I was left with a bitter taste when I’d finished the cup.

three ginger – “A warming swirl of organic ginger, galangal & golden turmeric” – It’s a good ginger tea, but it’s just ginger tea – couldn’t taste the other ingredients.

three licorice – “A sweet song of nourishing organic licorice from Kazakhstan, Pakistan & Egypt” – Very good and strong flavour but I think I still prefer the “peppermint & licorice” tea by Pukka.

cleanse – “A radiant blend of organic nettle, fennel & peppermint” – Hard to decribe, tasted mostly of peppermint but not as strong as a pure peppermint. Nice, but a bit boring.

supreme matcha green – “A vital wellspring of organic whole leaf green tea & the finest matcha” – Much like any other green tea I’ve had – a bit bitter but feels like it’s doing you good. The matcha is only 2% so probably more of a marketing gimmick than anything else.

three fennel – “Soothing organic sweet & wild fennel seeds with fennel leaf” – This smells pretty good and tastes ok too – a bit bland but I like it, I just don’t know why.

chamomile, vanilla & manuka honey – “A soothing dip in an organic pool of calm” – I was so calmed when I drank this that I’ve totally forgotten what it tasted like. It contains manuka honey flavouring, not actual manuka honey which is a bit of a swizz.

three cinnamon – “A sweet embrace of organic Indian, Indonesian & Vietnamese cinnamon” – Very cinnamony for obvious reasons – nice flavour, warming and has the best disclaimer – “Do not drink more than 4 cups a day”

night time – “organic oat flower, lavender & limeflower tea for peaceful sleep” – I had this during the afternoon and didn’t fall asleep (fortunately). It was pretty good, drinkable, hard to describe the flavour though – not as exotic a taste as the description might suggest.

revitalise – “A burst of warming organic cinnamon, cardamom & ginger” – Nice, smooth but not particularly memorable.

after dinner – “A delicious digestif of organic sweet fennel, roasted chicory & caradmom” – I had this mid-afternoon but I think it would go well after a big dinner, especially steak or similar.

serene jasmine green – “A sensual haven of organic green jasmine tea, chamomile & lavender” – Doesn’t taste as fancy or complicated as it sounds but good if you like that kind of flavour – I prefer the sweeter flavours personally.

original chai – “A royal flush of organic cinnamon, cardamom & ginger” – My favourite of the chai teas so far, or perhaps it’s just growing on me. I’d consider buying more of this one.

Posted in Uncategorized | Comments Off on Pukka tea tasting notes

PSake: “Exception: Unknown .NET Framework version, 4.6.1 specified in 4.6.1.”

If you get this error, you may have run another PSake script with a different framework version in the same PowerShell session.

Open a new PowerShell window and try again.

Posted in Uncategorized | Comments Off on PSake: “Exception: Unknown .NET Framework version, 4.6.1 specified in 4.6.1.”

Rewriting git history – removing a directory

git filter-branch –force –index-filter ‘git rm –cached -r –ignore-unmatch directoryToRemove’ –prune-empty — –all

git push origin master –force

Posted in Uncategorized | Comments Off on Rewriting git history – removing a directory

Running IISRESET from Visual Studio

If you want a quick way of running IISRESET from within Visual Studio:

Tools > External Tools…


Add a new menu item to run C:\Windows\System32\iisreset.exe (note the checkboxes at the bottom)…


You then get a new menu item…


And the output is displayed in the Output panel…


Depending on your UAC settings, you may need to be running Visual Studio as Administrator for this to work.

Posted in Uncategorized | Comments Off on Running IISRESET from Visual Studio

UAC, Windows 10 and Visual Studio


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
“C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe”=”~ RUNASADMIN”

Posted in Uncategorized | Comments Off on UAC, Windows 10 and Visual Studio

Progressive .NET Tutorials 2015

Microservices in .NET

IDL – interface definition language – swagger?

Components – don’t know what’s remote

SOA – make it being remote explicit

Microservices – bounded contexts, eventual consistency

Hard to let go of understanding everything

QA – just test the contract of each service, not the whole system – reduces problems caused by configuration problems

Don’t make services too small (Nanoservices) – can lead to too many changes in lots of places, latency (caching helps)

Monolith – staccato delivery

Break it up as each developer/team can only internalise so much

Embrace Conway’s law – check the long version of this

Eventual consistency – 2 phase commit doesn’t scale

Shared data – one source of truth, but can share out a “version” of the data

Try to avoid sharing dependencies, i.e. DTOs – duplicate theme

Enterprise service bus – becomes smart network, hard to test, locked in to vendor – keep the logic in the services instead

Anti-corruption layer for legacy code

Documentation driven design

REST in practice – reference data – ATOM feeds, very cacheable

Could use EventStore for the feed – then services poll the event feed – like a queue of orders in a restuarant



What about having a single API to cover everything?


  1. Break up into bounded contexts
  2. Ubiquitous language



Hexaganol architecture



DNS SD & SRV records – difficult to manage, so Zookeeper/etcd etc better




Everything is an actor 

3 Core Abilities of an actor 

  1. Send messages 
  2. Create other actors 
  3. Change behaviour 

Location transparency (same code in different locations) 

But URLs do have machine names in them 

Switchable behaviour web crawler 

Lighthouse (dedicated seed node) 

Dead letters 

Push dangerous calls down to children 

Supervision directives 

Functional programming in F# 

Types are sets and are composable 

Algebraic types 

Function oriented 


Pattern matching 

No ==, use let for assignment otherwise it will compare 

pure – no side effects 

Pipeline more logical than nesting paranthesis 

Currying – one input, then returns a function taking another input?? 

HOFs – parameterise all the things 

PowerShell DSC

DSC not just a Microsoft/PowerShell standard 

AWS $userdata 

Pull server 

Generates MOF file 

“WMI Tester” 

DSC resource kit – lots of modules! 

The DSC book 

Also see Chef’s site 

Microsoft DSC Resource Kit 

Check git repo for slides etc 

Keynote – Why I’m *not* leaving .NET!

ASP.NET 5: How to Get Your Cheese Back

Visual Studio & .NET on OS-X, Linux, and Windows

Going Further with ASP.NET 5

Complete Code Craft

Introduction to RabbitMQ & EasyNetQ 


Knowing what went bump in Production – modern monitoring in .net



nxlog community edition 

200GB/day of logs 

How big is the cluster? 

13 months retained 

Scheduled health checks 


embedded checks – config missing etc 


Move reads from writes 

Correlation IDs 

Reactive-interactive approaches to visualization of F# jobs

The Joy Of REPL

Monoliths to Microservices: A Journey

Posted in Uncategorized | Comments Off on Progressive .NET Tutorials 2015

How do you type a backslash “\” into the Dell DRAC viewer?

If you have a UK keyboard and try typing backslash into the Dell iDRACView application you might see # appear instead.

After a lot of experimentation and frustration, the only way I could find of doing this was to check Keyboard > Hold Left Alt Key then type 92 on the keyboard number pad. Then uncheck Keyboard > Hold Left Alt Key again.

Posted in Uncategorized | Comments Off on How do you type a backslash “\” into the Dell DRAC viewer?