404 error accessing Salesforce OAuth2 endpoints?

Try removing the trailing slash.

This works:

https://login.salesforce.com/services/oauth2/token

This doesn’t:

https://login.salesforce.com/services/oauth2/token/

Posted in Uncategorized | Leave a comment

Sluggish Internet Explorer performance and Browser Link

I recently experienced problems where Internet Explorer performance was sluggish, almost unusable. I could barely log in to the application I was running as there was a long lag between key presses and the text appearing. It turns out that the culprit was Browser Link, a new feature in Visual Studio 2013 that creates a communication channel between the development environment and one or more web browsers.

Disabling Browser Link solved the performance problems.

Uncheck the “Enable Browser Link” option:

 

Untitled

Posted in Uncategorized | Comments Off on Sluggish Internet Explorer performance and Browser Link

My Magic Lantern bricking experience

A few months ago I managed to brick my wife’s Canon 60D. This is the story of how it happened and the things I tried doing to fix it before finally giving up and sending it off to be repaired.

Whilst using my Canon 60D (Firmware 1.1.1, ML 2.3) to take long exposures (astrophotography) I noticed it had apparently frozen up. Unfortunately I can’t remember exactly what I then did, but it was probably a good 30 seconds or more before I removed the battery and card.

I wasn’t able to start it up again no matter what combination of button presses or card/battery removals/replacements I tried.

I was seeing nothing at all on the rear screen, LCD display or in the viewfinder, no beeps or clicks, no smells. The only sign of life I could get was with one of the cards I had Magic Lantern installed on – I get either a single flash when I insert the card or occasionally a double flash – it does this every time but only with that card. No other card does anything at any time. I originally copied Magic Lantern onto two identical 16GB cards. The other card (same version of ML, same card manufacturer) does nothing.

I tried the following standard suggestions for a “bricked” camera but nothing helped:

  • different batteries – partially charged and 100% charged
  • different lenses
  • with/without lens
  • with/without card
  • using a card formatted on my PC – empty
  • using a card formatted on my PC – clean ML install
  • using a card formatted on another 60D (low-level format)

I posted my problem onto the Magic Lantern forums: Bricked 60D – no sign of life except for the SD card light with one ML card

There were a few diagnostic tools which I was able to run:

  • LED blink test
  • Startup log
  • ROM dump

After a few teething issues with incorrectly formatted cards and corrupted file copies, we managed to get the LED blink test and ROM dump to run. The LED blink test just flashes the SD card light once a second – useful for showing that it’s able to read the card and that basic startup routines are executing. The ROM dump was meaningless to me, but was of interest to the Magic Lantern developers who were able to look for possible corruption.

I also had a lot of “fun” trying to build Magic Lantern and the ROM dump code from the source. I’m a developer, but I was way outside my comfort zone with the Magic Lantern build process and embedded ARM development tooling. I got there in the end but it wasn’t fun.

We had a few red herrings and dead ends due to the aforementioned card formatting/filesystem corruption problems.

What was really needed was more detail about the startup, to try and find what was running, and more importantly, what wasn’t – and why.

The Magic Lantern developers have come up with a very clever way of doing this. Because the only way my camera could communicate with the outside world was by flashing its SD card light then the only way to get startup data out was via this light.

There are two parts – code that runs on the problematic camera which flashes the light rapidly – a bit like morse code – long blinks and short blinks. Then you need another helper camera (also running Magic Lantern) and the deblink module, which watches and decodes the blinks in realtime and displays the output.

The tricky part of this, was finding someone else local who had Magic Lantern installed and was able/willing to run the deblink process.

Thanks to Andy Harris (a regular at Reading Geek Night), we managed to give this a go. The result was something we coined “camera inception”. Below you can see my camera (furthest away), the decoding camera (middle) and then for good measure a third camera recording the output that was being decoded via the decoding camera. The reason for the third camera was that we kept running into problems where the decoding camera either turned off, or didn’t record the output anywhere on its own card. So the third camera acted as a record of what happened.

20141108_105917

The decoding camera was set up with a very nice macro lens, looking straight at the flashing light on my camera. You can see the orange glow in this photo.

20141108_110117

 

The end result was this:

Unfortunately (as is probably obvious with hindsight) the decoding process didn’t work that well so the output is a bit corrupted.

The Magic Lantern developers had a few more suggestions but it was beginning to require skills I just didn’t have – electronics and low level ARM programming knowledge.

After an interesting few months I finally had to call it a day and returned the camera to a Canon repair centre. They did a great job and the camera is back to normal, but my wallet took a bit of a battering.

I’d like to thank Alex from Magic Lantern and Andy Harris for their time and effort in trying to fix this. Hopefully this post will be helpful to anyone else in a similar situation, or at least interesting!

Posted in Uncategorized | Comments Off on My Magic Lantern bricking experience

Tweaks for SSDs on Windows

  • Update firmware
  • Check TRIM is enabled
  • AHCI mode
  • Disable hibernation (powercfg -h off)
  • Install Intel Remote Storage Tools
  • Disable page file?
  • Turn off auto defrag (automatically disabled in Windows 7+?)
  • Turn off superfetch (optional, automatically disabled in Windows 7+?)
  • Set up backups
Posted in Uncategorized | Comments Off on Tweaks for SSDs on Windows

MongoDB London 2013

Some very rough notes from MongoDB London 2013:

Session 1 – Performance

Keep indexes in memory

Data in memory if you can

Slow queries can be configured to appear in logs

Use SSDs

Growing documents is bad

Do an ‘explain’ on queries

Padding factor

DB locks when writing

Sharding to scale writes

Optionally read from slaves but they may not have the written data yet

Write concern level configurable

Can set importance level of writes based on the node that has acknowledged the write

You can define your own _id structure to help querying

Use short field names – use an abstraction layer

Covered indexes

Dropping collections is faster than removing

mongostat

Run your own benchmark – benchrun

serverdensity.com/mdb

@davidmytton

Document per day,  pre allocated then use inc operator

Session 2 – Backups

bsondump converts bson to json

Use journalling

Disk backups faster

TTL indexes and capped collections

Replication

An uneven number of nodes is advised

There’s a mesh of hearbeats between the nodes

An arbiter node only exists for voting – it stores no data

You can have hiddden nodes, for “backup” purposes only

You can give a node a slaveDelay so the replication is delayed

Servers can be tagged e,g, { datacenter: new york }

There are 5 read preference modes

You can test all this on a single machine

Failure points:

  • Power
  • Network
  • Data Center (5 nodes safest, 2 (primary) +2 (primary)+1 (backup DC)
  • Multi-node failure can occur e.g. 2 out of 3 fail

When there’s only one node, the whole cluster becomes read-only

You can disabled indexing if you want to, e.g. on a backup node that isn’t ever queried

OpenStreetMap data contains lots of Points Of Interest, e.g. pubs

MongoDB can be used with Hadoop

There’s a mongo-storm project

Posted in Uncategorized | Comments Off on MongoDB London 2013

Defining a redirect/rewrite in the Web.config

For my own reference:

Posted in Uncategorized | Comments Off on Defining a redirect/rewrite in the Web.config

Parsing MongoDB log files with logstash on Windows

Note: work in progress

This site helps with the date/time formats used:

This is a useful site for debugging grok expressions:

Posted in Uncategorized | Comments Off on Parsing MongoDB log files with logstash on Windows

Parsing IIS log files with logstash on Windows

Note: work in progress

I found a couple of example configurations for IIS logging, but they both rely on NXLog and contain deprecated configuration settings:

This is a useful site for debugging grok expressions:

Posted in Uncategorized | Comments Off on Parsing IIS log files with logstash on Windows

Finding all NuGet packages across multiple solutions

This PowerShell script will look for a file called nuget.config in the current directory, then use it to enumerate through all packages.config files across all solutions underneath the current directory and list the packages that are in use.

https://gist.github.com/tjrobinson/6138411

Posted in Uncategorized | Comments Off on Finding all NuGet packages across multiple solutions

Deleting files that Windows can’t delete

I recently downloaded some files from Salesforce Chatter which ended in “….”

If Windows won’t let you delete them (it says they don’t exist), SysInternals sdelete will:

C:\tools\SysinternalsSuite\sdelete.exe /s “\\?\C:\Users\TRobinson\Desktop\Over the next few weeks….”

Posted in Uncategorized | Comments Off on Deleting files that Windows can’t delete