Monday, 7 December 2020

Dead Smartthings (Samjin) button

 As I'm in the process of switching from Samsung SmartThings to Home-Assistant for my home automation, I've been re-pairing various Zigbee and Zwave devices.

 One of those devices, a Samjin button, branded as SmartThings wouldn't come back to life after I removed the back cover (it was too tight against the wall to reach the reset switch).  I recall having two buttons in a pack of 5 that also did the same thing.  Those two seems to be dead-on-arrival, but I knew this button had been working fine.  After much fiddling, I managed to coax it back to life by holding the CR2450 battery in with one finger.  Whenever i put it back onto its battery cover however, dead.

No amount of bending the battery contacts made any difference.  So, I put a tiny square of folded tissue paper behind the battery (between it and the rear cover where the magnets are.  Hey presto - immediately works.  Slightly snug to twist the battery cover on, but I now think I know what was 'wrong' with those original  two buttons which went back to Amazon...

Tuesday, 1 May 2018

How do I follow a post on Facebook?

I have seen lots of posts on Facebook recently with comments along the lines of "Following this", or even just a stream of comments with just the letter "F".

The purpose of these comments seems to be so that the commenter can be alerted to any further comments and discussion on this post.

So, if you weren't already aware of the right way to do it, it's simple.  Click on the menu for the post.  This is usually displayed as 3 horizontal dots at the top right of the post.

Then it's as simple as clicking on "Turn on notifications for this post".  Same effect, much cleaner.

Thursday, 22 March 2018

Ford B-Max owner review - 2 years on

I bought my B-Max from a Ford dealer in Kent just over 2 years ago and I've now done 38000 miles in it.  I thought I'd share why I bought it, and hope my insights are useful to others.

Size:

The car had to be a certain length to fit with the other car on the driveway, so anything too long was immediately out of the question.  There's not a huge amount of cars in that bracket that can fit a family of 4, but the extra 6 inches of length and headroom over the fiesta makes a big difference in rear legroom.  It means there's enough room for my 18 year old daughter to sit comfortably.

The boot is just about big enough for two suitcases, as there is a board that comes out, to give a level loading surface, or a slightly deeper boot space.  It's packed full for a week-long family of 4 holiday but it's just about enough.  We wouldn't survive if my youngest still needed the baby paraphernalia.

Spec:  

I bought the Titanium edition, as a key requirement for me was that I wanted cruise control.  I commute for 2 hours every day, and you end up with a sore foot otherwise!  The Sony stereo is really good quality and I can plug a 128GB USB stick  and have all my MP3s in the car, with voice control to select the artist or album.  There's also a second cigarette lighter plug in the centre console which is ideal for powering chargers for the kids in the back seat.

Engine:

This was one of the most important decisions for me - I wanted an automatic transmission, but that was only offered on the much older 1.6L engine, and the EcoBoost 1.0L engine was more important too me, both for fuel economy and the fact it has start-stop engine technology.

I went for the 120bhp Ecoboost engine option to give the car a little bit more oomph (the standard engine is 100bhp), and I'm happy to say that unlike my old 1.2L Honda Jazz, I can keep it in 5th gear and still accelerate up hills!

I use the Android app Fuelio to track my fill-ups, and I'm getting an average of 44.3 mpg.

Servicing:

I bought a service plan from the dealer for £24 per month, but as I've done more mileage than the salesman put down for, I've exhausted it after 2 years (rather than 3).  It was nice to have while it lasted.  The only thing that's gone wrong with the car is a brake-light bulb which was spotted and replaced at service.  The garage also send you a YouTube video of your car being inspected, which is a nice touch.

What next?

I'm on a 36 month PCP, and ideally when I get my next car it will be electric or at least hybrid-electric, which sadly with the current range rules out a lot of Ford models.  There won't be a new B-Max and the closest two cars - the Fiesta Active and the Ecosport - are both SUV-style, which doesn't really float my boat.  I'm keeping a keen eye on the new Nissan Leaf.


Sunday, 11 March 2018

Top 3 things to do in Tromso, Norway

A few weeks ago I was lucky enough to visit Tromso in Norway to see the northern lights for my wedding anniversary with my wonderful wife.  Rather than sticking everything on TripAdvisor I've documented it here:

Flights

We flew to Tromso from London with Norwegian Airlines.  The outbound flight was via Oslo but the return was direct back to London Gatwick.  We went Friday morning to Monday evening. We were quite impressed by the transfer in Oslo - as you go through passport control a picture of your suitcase pops up and asks you if this is your luggage.  There was also facial recognition for passport control rather than a long queue for a border guard.

Hotel

The hotel we stayed at was Skansen hotel.  It was fairly basic but nice enough.  The staff were incredibly friendly and helpful.  It's only a minute's walk into town too.  There's a basic breakfast buffet included but no dinner restaurant.

Tromso

Tromso is quite a small city, the airport is a few miles outside, through a network of tunnels, the taxi cost around £15.  We went in February and the high street was covered in a couple of inches of ice, but the pavements either side were clear.  Where the pavements weren't clear there was a layer of gravel.  This is a different approach to the UK, rather than salt to melt the ice the gravel just makes the ice grippier.  There's a few shops, and a huge number of hair salons, the reasons for which we couldn't fathom.  There's only one shop in the city which has an off-licence, so once we'd found it we bought a bottle of wine for the hotel room.  The wine, along with everything else was quite pricey due to Norway's strong economy, and our rubbish one.

There's a really nice harbour, lots of restaurants and gift shops.


Restaurants

We ate out at two really nice restaurants, at different ends of the scale - a pizzeria called Peppe's and a restaurant called Kitchen and Table.

We ordered a large pizza between the 2 of us at Peppe's and we're glad we did as I've never felt full after a single slice before, there's no way we could have eaten one each as I was originally considering.  It was really nice with a draught beer.

Kitchen and Table was a different proposition - fine dining, and prices to match, but the food was delicious and strongly recommended.  Not a huge choice but everything we had was well presented and very tasty.



With that out the way, here's the top 3 things we did, and would recommend anyone do in Tromso, Norway:

3. Polaria

Polaria is an aquarium and education centre a few minutes walk from the centre of Tromso, there's a gift shop, cafe, cinema screen and various bits to see and do.

The cinema screen is a very wide wrap-around display which shows nature and conservation videos on a regular schedule.  The main attraction though is the aquarium - there's a walk through glass tunnel where you can observe the two species of seal they have, and a couple of times a day is a really good show with the seals, in which you genuinely believe the seals are enjoying themselves rather than just being about entertainment for the audience.  Allow around 3 hours. 

2. Husky sledding

We found this prior to the trip on TripAdvisor and booked through them for the Monday morning starting at 8:30am.  Everyone meets in the Clarion hotel near the harbour and a coach takes you to the huskies, which was about a 30 minute journey.  Each couple gets a sled and 6 dogs and you're taught everything you need to know to stop/start/control the sleds.  It was a great experience and the dogs are lovely.  I took a few short videos on my phone as you can only bear to have your hands out of the gloves for around 20 seconds at a time.




1. Aurora tour

Again we found the tour on TripAdvisor prior to arrival. A minibus picked us up at 7:30pm along with 5 others and we set of in search of the darkest place we could find.  Once away from the lights of the city, the sky was magnificent, and we didn't have to wait long.
We were very lucky to have two good 'shows' on the night, one about an hour into the trip and one just before midnight.  There had been a solar 'storm' about 5 days before and I think we caught the tail end of it.  Within 2 hours of getting out of the minibus we were all desperate for the provided snow-suits and warm snacks despite already wearing every item of clothing we had.  I alternated between marshmallows over the fire, and nipping to my camera to take more photos.

Photographing the lights

I took my Canon EOS 650D SLR with the Canon 17-85mm lens and a Manfrotto tripod.  I used a 20-30 second exposure with the lens wide open most of the time (lowest F-stop), focussed manually at infinity.  I set the ISO to 400-800 and recorded the images in JPG+RAW so I could post-process them afterwards.

An article I read warned about dew building up on the lens, but I didn't have any such problems, and the battery survived the cold temperatures fine.  Here's a couple of photos taken straight from the back of my SLR screen.  If you're interested in seeing the full-size processed images let me know!



A few people didn't have their own cameras, but the guide took many of his own pictures and shared them with us afterwards, including ones with us in them, by 'painting' us in with a torch flash to get the exposure correct.

We were really lucky to be able to see the aurora and we've just had it blown up on a large canvas to put in our hallway.

I would not hesitate to recommend Tromso, there's no guarantee you'll see the lights but it's a brilliant experience - just wrap up warm!

Saturday, 13 January 2018

Asus MB169B+ USB Monitor

Now I'm doing everything on my laptop (coding, reading, betting) in the evenings, I started to miss the screen real-estate I enjoy at work (4 monitors!), so I started looking into a laptop-friendly way of extending my desktop without peppering the lounge with extra monitors.  I came across this product, and I've been using it for a few weeks now. 



It's a standard Full HD 15.6" non-touchscreen display, but it's really thin, fairly light and best of all, it takes all it's power and display signal through a single USB port, so you don't need extra plugs or power bricks around.  The display is bright, clear and there's no real lag if you're just using it for 2D windows applications and web browsing.  I haven't tried it for 3D gaming but you're probably better off with a full-blown HDMI monitor if that's your use-case.

It comes with a faux-leather slip case, and you're supposed to be able to prop up the display in the stand, however I haven't found it to be the most stable solution (the monitor is prone to falling backwards).  This is the only downside and I've ordered a tablet stand to try to prop it up a bit better, but a plate holder/stand would probably do the same job.

You can Buy the MB169B+ here

"Invalid Username or password" when mapping a network drive for a Windows service

Another recent issue I've come across required such a bizarre fix I thought I'd document it here in case it helps anyone else.

We had a Windows service running as Local System account on Windows Server 2016, and a mapped drive using Azure File Service over SMB.  So our server was on a separate Active Directory domain to the storage (the Azure storage is effectively on a domain called AZURE).

When we tried to access files on this share using a named drive letter, we would always get an error back saying Invalid username or password.  So after reading StackOverflow and other sites, we tried several different tactics:

1) Try to map the drive using a Windows Scheduled Task running as SYSTEM user, to run a batch file with a net use command in.

2) Try to map the drive using an administrative command prompt and the SysInternals PsExec tool (psexec -s -i cmd.exe)

3) Try to save the credentials for the network location in Windows Credential Manager

But whatever we tried, either the logged in windows user could see it, but the system user couldn't, or vice versa, but nothing would allow the service to see the drive.  We couldn't use the UNC path without mapping it because you can't embed credentials (username and password) in a UNC path.

After much more reading, it turns out that:

a) Each user has it's own record of mapped drives and credentials (which we knew anyway).
b) In some cases, such as Windows Services, different logon sessions for the same user have different mapped drives.
c) All Windows services running as the same user share the same session.

It was (c) that allowed us to finally find a (slightly Frankenstein-esque) solution.

If you create a new windows service (using C# and TopShelf for example) which shells out (System.Diagnostics.Process.Start) to run the net use command, and install this service to run as the SYSTEM user (TopShelf defaults to this), then it magically works, now your existing service can see your mapped drive!

P.S. If you get into a situation where you can't un-map a drive, you need to log back in as the user who mapped it in order to delete it (net use * /d)

P.P.S. If you're in a situation where you're able to change the user a service runs as (we weren't), then this whole thing might be a lot easier.  I think it's the special SYSTEM login that complicates things.

Friday, 12 January 2018

IIS w3wp hangs indefinitely with low cpu

Recently I investigated an issue with an old application (think asp / unmanaged code / cgi) which had been working for years on IIS 7 but when it was migrated to IIS 8.5 on a newer Windows server we started to see a gradual decrease in stability. The website would just stop responding to new requests and the existing request would never time out. As it got worse over a couple of weeks it would not recover even when recycling the app pool or killing the w3wp.exe process. After trying several different things with no success we eventually found a huge number of .TMP temp files in c:\windows\temp had built up (hundreds of thousands). I believe these files were possible remnants of ODBC connections that were never cleared up properly by the runtime.

Clearing these files cleared the issue immediately and the application has been completely stable since. Hopefully this article will help you and you won't spend as long googling as I did!