Main menu:

Site search

Categories

February 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
232425262728  

Tags

Blogroll

Fitting in to the programme

As a type 1 diabetic, on many levels I have it all.  A reasonable Hb1Ac, good clothes, a smart house, a fascinating job and some great friends.

I do mean great because, often, I’m shattered, mentally exhausted as my blood sugar levels are managed by me.

I test and analyse everything and mark it against what I’ve done.  If everything is working as it should, that all takes about 15 minutes a day.

The past week has been shattering as things are not working that way at all.

So, you’re Hb1Ac is 6.1%, it can’t be that bad!

Mmm, I’ve knocked a significant amount off my basal as per working on basal rate 2 but I’m still hypo first thing.  I’ve not managed more than 5 hours sleep on average as a result and I’m just a bit blah.

I know it’s because I am high at ten pm (between 8 and 10mmol/l) and have changed the basal for that time to accommodate that requirement.  That should mean I don’t need to correct and the basal between 2am and 8am is obviously perfect because it is as steady as a rock but I am pooped just the same.  It’s been a week and I am down on at least 2hrs if not more for 7 days which is nearly two night’s sleep.

In the diabetes blogs, this is called diabetes fatigue as per “what causes diabetes fatigue“.  For me this is one of the reasons the Equality Act 2010 is so important.  We look normal and during the working day most things work normally but our day job is 24/7, 365.

Where I work we have a stress assessment tool to work out if you are under a great deal of pressure at work or elsewhere.  One of the questions concerns sleep – “are you having more or less sleep than normal?”  It’s given a great deal of weight in the sheet because of the impact low sleep levels have on the body.

High or low blood sugar makes it very difficult for me to sleep, so I tend to answer thruthfully and  I don’t always get 8 hours a night.

If I answered this against expectations for my age and health, according to the stress assessment, I would be considered under extreme duress.  We just put up with it, because there’s nothing else we can do.  You work at your blood sugar but every so often there is something causing it to behave unpredictably and you just have to live with it.

Such periods of course have the same impact on us as they do to anyone without diabetes.  We get run down and that causes depression which in turn causes instablity and then we’re more prone to not healing when we get infections!  You then get a vicious circle.

The way I cope is prioritisation.  If the dishwasher doesn’t get emptied no-one is going to die.

Making sure I am relaxed in the evening and counting my carbs and making the right decisions.  I have a tool kit with my calculators too.

Hopefully, things will become steady as I begin to recover.  Wish me luck, please.

Two of five

No, I am not writing a thriller here, but more chat about basals, like the last post.

My pump allows me to programme five different basals.  In practice, I only use four and then use a temporary adjustment if something completely unplanned is happening.

Four?

I use the same ones working day or weekend as I keep to fairly regular patterns.  As a girl, I have different rates for which stage of my menstrual cycle I’m in.

Basal rate analysis

Basal Rate 2 is used the week before my period is due (especially if I am exercising a great deal).

Basal Rate 3 is used when my period starts – for a couple of days only.

Basal Rate 4 is used for the two days before my period is due and I am not exercising a great deal.

Basal Rate 1 is used the rest of the time.

That doesn’t seem to be a very logical order?

Thank you for your observation, but when a rate is working really well, I moved on to the next available slot.  As it happened, 1 was the first I programmed.

I said I only used four but five is an emergency one.  If I wanted a small break and used a long acting basal, a temporary rate of zero or a little higher might seem like a good idea.

Long actings are not that predictable with me and having to constantly adjust a temporary in those cases is really annoying. Five is kept as this spare for that reason.  I also use it if I need something a bit special.

Once the situation is back to normal (whatever normal is anyway), I switch my basal rate to the most applicable one.

Wouldn’t it be easier to have a closed loop system?

I do think about it, honestly.  I do quite like being the wet-ware in control (human brain control cybernetics).

My neural net is able to think of things in a way a machine has difficultly doing as I am aware of the whole picture not just my institial results.

For example, if I took an antihestimine tablet, I am aware of how that works in me.  Because I know that I have taken it, I am not reacting to the results I am getting, I am already implementing a plan.  Actually, I might wait a couple of hours before taking the tablet because I know that I need to knock off two tenths of a iu before the allergy treatment starts to work and I need to do that for 18 hours.  Because of my insulin’s kinetics,

A closed loop would just be reacting which is not quite the same thing.

If you say so, just think it would be easier for you…

I know these facts because of my FreeStyle Libre has allowed me to see what does what.  That single tool has allowed me to see so much more of what is happening when.

I know when my blood sugar gets above 8 two hours after eating, I am going to get hungry now.

(I’m guessing that’s middle age, but you can see how type 2 diabetes impacts the middle aged more than youngsters.  If I didn’t know better, I would snack instead of bolusing.

I’ve spent my life taking hunger to be a sign of low blood sugar but actually, that doesn’t happen that way at all.  Low’s it tends to be concentration that goes first then I feel a bit nauseous).

Anyway, the best curves I get are from Coke, normally leaded Coke.  150ml is 16g of CHO and if I bolus 1.6iu I don’t go above 9mmol/l an hour after food.  The curve is beautiful and absorption is guaranteed.

More complex food is always hard as absorption makes the bigest difference.

But now we’re talking about bolusing, not basal rates, so I will end it here.

 

Working on basal rate 2

As I come to the end of my sabatical, I’ve had an infection that drove up my glucose rates and plumented them just as quickly at the end.  The past three days have seen me hypo from 2am in the morning.

Which makes it a good time to review Basal Rate 2.

Hit me one more time, baby

😮 OK.

Excel is a brilliant tool for comparing two graphs and I use it for tracking my changes.

First I enter in my old basal rate as:

Time Old Basal rate 2
0 1.5
1 1.5
2 0.76
3 0.86
4 1.25
5 1.5
6 1.75
7 0.78
8 1.5
9 0.8
10 0.77
11 0.7
12 0.69
13 1.15
14 1.1
15 0.99
16 1
17 1
18 1.4
19 1.4
20 1.6
21 1.7
22 1.3
23 1.55

You will notice the time is actually the hourly rate in question: my pump allows me to have a different rate per hour which is great for tuning.  But it is not a format accepted by the Basal Rate Estimator but we’ll come on to that in a moment.

I then take my interstitial glucose readings for the period I want to tune:

Time Old Basal rate 2 Interstitial blood sugar
0 1.5 4.5
1 1.5 4
2 0.76 3
3 0.86 3.2
4 1.25 2.2
5 1.5 2.2
6 1.75 2.2
7 0.78 2.2
8 1.5 2.1

You can see here why I am tuning – I have a drop from 1am, my goal is to flatten out the curve :D.

Because the Basal Rate Estimator needs the information in a very specific format, I am going make some changes to the data.  I don’t do this in Excel because that would be very hard to make useable for any period in question.

I’ve written a short script to do the job for me:

In powershell script…
Open excel spreadsheet
Open sheet
Work through the blood glucose (converting time to 12 hour clock and add :00 to each hour)
Work through the old basal rate (converting time to 12 hour clock and add :00 to each hour)
Work through the new basal rate (converting time to 12 hour clock and add :00 to each hour)

The output looks something like this:

Doing blood sugar
0:00 4.5
1:00 4
2:00 3
3:00 3.2
4:00 2.2
5:00 2.2
6:00 2.2
7:00 2.2
8:00 2.1
Doing old BR
0:00 1.5
1:00 1.5
2:00 0.76
3:00 0.86
4:00 1.25
5:00 1.5
6:00 1.75
7:00 0.78
8:00 1.5

10:00 1.3
11:00 1.55
Doing New BR
First guess is to use exactly the same values as the old basal rate as that will allow us to fine tune

We’re nearly there, I run the Basal Rate Estimator entering in the “BG” or my institial values: this is a simple cut and paste from the powershell output.

I use humalog, so I select that and enter in my insulin ratio (that needs to be the same units as my readings, as I work in mmol/l my value is 2.5).

Now, in this case, my first blood glucose reading is midnight and the last is 9am.  I copy in my basal values between midnight and 9am but go to the bottom of the column and grab between 10pm and 11pm.  If I don’t do that, the tool complains as it hasn’t got a starting value for insulin kinetics (how much insulin is in your system at midnight affecting your blood sugar).

Sounds fiddly!

Bear with me.  I’ve put in the input into the right boxes, in the right format, so let’s have a look at the output.  First screen the graphs (real and simulated) overlay one another.  We need to change the “new basal” to see a difference.

So lets do that – I actually go through 4 iterations, but I’m guessing you’d like to see the final one.

I can then copy that to my pump as day 2 of the basal run and back to the Excel Sheet, where I can then plot the graph.

Adjusted basal

Hang on a minute… the blood sugars look different

Ah, because I was hypo last night, the basal rate estimator tells me I’m hypo and refuses to work, so I add two to each value of the blood sugars to allow me to do the simulated run.

This all sounds like wet pieces of string and sticky tape…

I was doubtful the first time I used this methodology.  The user interface is crude on the basal rate estimator however this is so much quicker than guessing which rate needs to be trimmed and by how much.

The 4am reading is still a dip.  I’ve taken more than 1iu off my basal and that’s a huge change, so I will try that tonight and do a second estimation run tomorrow morning then move on to breakfast and lunch and tea.  In five days, I normally get pretty close to having a flat line all day if I don’t eat which is a great place to be.

You talk about a script, can I have it?

Powershell scripts can be run on any Windows PC machine from Windows 7 onwards.  I am very happy to share – here it is – but it’s very rough and ready at the moment.

Give me a couple of days to knock it into better shape and I will share on this page 🙂

Warning – techy post

Whaaa..?

This is a technical post and there are no apologies for that.

I’ve run my own server for a while now (since 2007 to be honest) with the aim of 24/7 service to the internet.  It’s a small set up and I not only provide some tried and tested tools but also do some experimental things on here too.

Most of my dynamic insulin modelling is done here for example.

That means I have a web address and the machine needs to be available on the web.  As per many a standard security model, I have tied down exploitable routes into the server and use a firewall to enforce those rules.

Which brings me to the subject of this post: auto-configurable soft firewalls.

Using a simple script working out who is doing what and whether they should be, I am checking blacklisted IP against “Reported IPs Index | AbuseIPDB” so that I am learning from the rest of the internet’s experience of some individuals and their servers.

Which seems to be working reasonably well.  I have a list of 50,000 people I blocked from day one and am adding to that individuals trying to come into my computer by a non-authorised route.  That is saving my computer a great deal of cycle time because it isn’t waiting for a user to be failed three times any more.

Day 1, I had 20,000 odd tries a day from 100 or so hosts.  It is now down to 20 tries from 5 hosts!

Because I am doing this against the audit logs, it’s also serving to protect the services too which has improved my server’s response time.

Just celebrating the small victories.

Today’s key learning point…

I use fedora: I like it, there are a great many cool things you can do for very little effort.

OK, don’t know what you’re talking about…

Linux – there are several key flavours of Unix out there, and as a preference, I like the ones based on the Fedora definition.  I get some powerful tools, such as disk encryption and the main webservers all packaged up and held ready for me to install if I want them.

Most interestingly, it has an Active Directory like server for IAS (identification and authentication services) called FreeIPA.  This works out of the box but it’s obvious that the producers of the toolset are not focused on a home set up like mine!

What do you mean?

In other areas of life, you buying a white loaf bread does not make it impossible for you to buy some rye or brown bread.

FreeIPA assumes it is sitting on a dedicated, probably virtual, server.  Which is great if you can do that, but I am definitely running a single, non-virtualised server and it is running many web servers and the like to provide some of the tools I use to manage various aspects of my life.

That has caused a bit of disruption to my web presence over the past 24 hours and I still don’t have FreeIPA up and running!  Joy.

How so?

FreeIPA wants to install its own tomcat server.  50% of my services are supplied via tomcat – that’s hidden to my users through use of a proxy and a firewall.

I have a couple of other web servers too making it easy for me to deploy the right tool in the right location.

While FreeIPA cannot be configured to run else where, my servers can and this is the stage I am now at: everything has stepped asside ready for FreeIPA to do its thing.

Not sure I get the why and wherefore…

I am not a huge fan of Windows but Active Directory is pretty wow.  It provides a network with a means of authenticating all users and machines access a domain (a closed network).

It’s had few competitors in the PC world and indeed for Unix.  This is where Fedora comes in: think of Fedora and being the equivalent of a Windows Server.  Other Unixes are more like Windows PCs with some server capabilities and often “home cooked”.

The most famous versions of Fedora are RedHat Enterprise Linux (recently bought by IBM), Oracle Enterprise Linux and of course Amazons Linux available on their cloud servers.  The opensource version is called Centos.

RedHat kicked off development of IPA and released it through Centos.

Which is where my server comes in.  I have moved all my public services (30 minute job) but cannot get FreeIPA to install and run effectively.  Back to the drawing board!

Today’s progress

I hit the gym today.  I’ve been a little lackadaisical in hitting the gym which would be great except for the fact winter has struck.  When I say winter, I mean the English version – dull, damp and decidedly chilling to the bone.  It’s not been foggy but that kind of damp, lacklustre effect is permeating the air.

The gym is the obvious place to work around the English weather.  Air conditioned, no traffic to fight and there are options; cross trainers, treadmills, rowing machine, spinning and static bikes, low intensity weights.

Last year’s cycling helped me lose weight and now what is left is still too high in fat (35%).  If I can turn the fat into muscle and maybe lose another 5kg, I’ll have a much better chance of having readily available stores for the ride and of course be that little bit lighter.

I had a walk through the equipment at the gym.  I love cycling and rowing but can take or leave the treadmills.  I am aiming for 10.5K steps a day or 10Km, which should leave me in good stead for base fitness.

I did ask about how much protein should be in my diet.  I weight 70Kg, so the figure I was given by Brad at Riverhills Spa is 0.8g per Kg, so I should be eating 56g of protein a day.

I am not managing that with my current diet.  The obvious thing to do is up my nut and bean intake – kinder to the planet and my cardiovascular system.

As they had a deal on, I had a lovely massage too.  Just off for a bath to finish off the relaxing.

Anyone for Brazils?

Analysis of today’s food

To do 100 miles, I am going to need energy and most of that should come from carbohydrates (aka CHO or carbs).  Which makes my life much easier – carbs are really simple to count and for each 10g I give 1iu (because that’s how my ratios work out) (or 0.1iu per 1g of CHO).

If a meal has more than 5g of fibre in it, I subtract the fibre from the carb count.  Shreddies are my favourite example of that: if I have 40g and milk, I would have 34g of CHO but I only bolus for 29g because that meal would have 5g of fibre.

My diet today:

Which does make it 54% from CHO, 24% fat and 22% protein (54g).  Which is probably not too bad.

I’m a little worried about the sodium levels, 2.7g seems a bit high?

A trip down memory lane

My family may be forgiven for thinking my life revolves around computers.

I like to think it doesn’t but it’s when you talk to other mums in parents evening that you realise just how far down the rabbit hole you have indeed travelled.

Since losing my computer in early October thanks to difficulty mounting an encrypted hard disk on my server, I’ve been doing some home work.

This is not that uncommon-a-problem and it pays to ensure you have a disaster plan in place for when such things happen.

And test it to make sure it works before things become critical.

Unfortunately, that last bit meant I lost my wiki.  The last perfect backup I had to hand is three years old but it is at least better than nothing!

Only issue has been winding the clock back to a time when that backup would work.

Thankfully, I have a couple of Raspberry Pi’s and they are proving to be most useful.  I have mysql 5.4 installed and an older version of apache and a copy of php 5.4.  Just waiting to extract the actual wiki backup (the db is already running) and then I can start to move the backup forward to a much later version of the wiki software that will work on my main server.

For the security minded, thanks to the firewall configured on the network, this Pi though old should not be able to act as a backdoor to the network and the machines behind it.

I have learnt from my lesson too: periodic disaster recovery plan walk throughs once a quarter from now on, no excuses!

You’re talking about security here, what exactly do you mean?

For me, security is about four aspects: integrity, non-repudiation, appropriate confidentiality and immutability.

You should be able to trust what you are seeing and that no-one who shouldn’t see that data has access to it.

There are various mechanisms for achieving this.  I use four key ones: TLS for traffic over the web, PKI for non-repudiation, confidentiality and immutability and I use PKI to ensure no-one has access to my servers who shouldn’t have it.

My base disks are then encrypted too, just encase some gets keen enough to break into my house and take the server.

Suitable passwords are used on top of this to ensure things are protected and I have also use a secure wiping system to ensure deleted files are protected where possible.

I don’t store anyone’s data but my own.

I make use of virus checkers for all my machines and firewalls.

I don’t think that means everything is safe.  I am just doing the basics.

My diadigits

JDRF are doing some pages to allow people to produce their diabetic statistics, how many blood tests they’ve done etc.

Being “an old diabetic”, mine is a little unconventional:

Item Per day Period Total
Insulin Injections 1 1 yr      365
Insulin Injections 2 8 yrs   5,840
Insulin Injections 4 14 yrs 20,440
Insulin Injections 6 0.75 yrs   1,643
Insulin Injections 4 1.5 yrs   2,190
Glucagon N/A N/A          12
Blood tests 6 37 81,030
Sensors N/A N/A        30
Urine tests 4 4 yrs   5,840
Insulin pump cannula 0.3 17 yrs   1,862

Which gives a grand total of:

  • Injections: 31,000 (round to nearest 1,000 to cover vaccines, etc)
  • Tests: 87,000 (not including sensors as this is a bit meaningless)
  • Cannulas: 1,900 (rounded to nearest hundred)

My toolkit

Pump tools

Pump tools

Back in 2000, I met someone with an insulin pump.  I’d had difficulties controlling my blood sugar with long acting insulin since I was a teenager and I didn’t have the tools to be able to tune my background insulin levels by using long acting insulin.

Unfortunately, I was “too well controlled” to gain pump funding (the highs from the long acting insulin not lasting long enough and requiring an extra shot of insulin followed by the frequent hypos at 2am because the insulin I need to cover the early morning were way too high for my two o’clock in the morning body to cater to but you know, doing great!) I self funded.

Which gave me unrestricted access to the pump company and the calculations and tools they had to hand.

At the time this was all passed on with paper charts and by mouth.

I soon realised, I was not in Kansas any more.

Kansas!?

The game had changed.  The rapid acting insulin had a pretty reliable behaviour which meant it could be modelled.  Models allow calculation tools to be built and given my new appreciation of a basal rate, I made those tools for me.

Through Insulin Pumpers Org (International), I learnt that not everyone had my ratios and indeed, my ratios may change.  Some people measured their blood and interstitial glucose in different units.  I evolved the calculators to cater to those needs.

I was keen to ensure that privacy was maintained for the users.  There are no cookies, very little javascript and the user doesn’t need a fancy browser.  This tool kit is designed to be simple and just work.

I’ve even made sure the colours and sizes can be changed if the user has visual issues.

When I was learning, the Insulin requirements calculator and Carbohydrate calculator made my life much easier.

If I’m hypo, the Carbohydrate calculator helps me get back to normal.

My newest tool is the Insulin on board calculator.  I use this most days to ensure I avoid highs and hypos if I don’t get my boluses right and when I do get it right. not to lose faith and give anything extra.  Along with my Freestyle Libre I can make meaningful decisions early.  I have perfected bolusing from experiences using this tool as well as you can begin to appreciate the patterns.

Eh?

Let me explain.  When a non-diabetic eats, their body can provide appropriate insulin levels in tiny doses to keep their blood sugar within a euglycemic range; that’s between 70 and 130 mg/dl according to the ADA or 3.9 and 7.2 mmol/l else where in the world.

As a type 1 diabetic, I’m not expected to be as tightly controlled because of the limitations of my treatment.  Again according to the ADA, euglycemic for a type 1 diabetic on multiple daily injections (or MDI), euglycemia is considered to be around 10mmol/l two hours after food.

With a pump, because our basals are closer to what they need to be, we can actually shorten that period down and on odd occassions, keep well below 10mmol/l without going hypo.  That’s the dream.  Today, having proven my basal rate yesterday, I am living the dream (today).

Living the dream

Living the dream

Normal basal all day.  No correction boluses.

Breakfast was 15g Rice Crispies (13g of CHO), 30 ml of milk (2g of CHO) and 250ml pink grapefruit (25g of CHO) – 4 units bolused as ratio is approx. 10g to 1iu.

Morning snack Soreen Lunchbox Loaf (8.6g of CHO).

Lunch was a bacon and egg sandwich (60g of CHO) and 250ml orange juice (25g of CHO).

Boluses: 4iu for breakfast (09:15), 2.5iu for lunch (12:20) with a further 6iu given over 15minutes.

Today, why is this qualified with Today?

Because tomorrow is the undiscovered country and the game is similar but not the same.

A strange new world

Food is something I care about.  I have to, not understanding how food works in the body is not possible for a type 1 diabetic.

I do not diet per se.  I do count my carbs, that is the foundation of my bolusing decisions: if I am not aware of what sugar, protein and fat is in a food, I cannot hope to get the bolusing correct.

Bolusing?

That’s the extra insulin I give to cope with food digestion and sometimes with the release of glucose stores when exercising or when stressed.

When I say food, that’s anything with sugar, fat and protein.

I don’t necessarily give insulin for fat but a higher concentration of fat makes the carbohydrates I eat act behaviour differently in my body.  Very few foods are purely fat, sugar or protein.  All mammalian meat has some stores of fat and sugar because that’s how mammals work.  We store energy in our muscles. Birds and fish do this in a suitably different way. Beans also provide some fats and sugars along with the base proteins.

What you end up with is a wonderfully tasty mix that’s hard to quantity in terms of what sugar is entering your body at any one time.

Honey’s there – I don’t count honey as sugar

It works with my insulin exactly as sugar does.  It might provide some trace elements, but I need to bolus for honey exactly as I do for sugar.  Weight for weight.  Sorry, but I have the bolusing facts to back it up.

I don’t produce insulin any other way, so it’s pretty conclusive.

Hmm, OK, we’ll leave that there.  Bolusing decisions?

Fibre does make a difference, if a food is very fibrous I take off the fibre from the carb count and bolus the difference.

Fat slows absorption but doesn’t affect the amount I bolus.

Protein is a whole different and fun ball game.  Hard to measure and harder to know when it will act.  I keep my protein count down low to keep things easy, about 100cals spread throughout the day.

Complicated!

Yes, yes it is.  I didn’t get it right when counting a new home made recipe and ended up fighting to get my blood sugar down most of Sunday evening.

Butternet squash soup tastes great but needs bolusing in a suitably different way to my approach on Sunday – I propose giving the bread bolus over a 15minute extended bolus and the soup needs more quick bolusing – possibly 40g of carbohydrate for a bowl of soup.

Wow, you’ve completely lost me!

Have a great evening 😉