Hello and welcome to my little nock of the internet. Here I have my blog which mainly contain posts about tech, the outdoors, cooking, and some times mead brewing.
A bit of background information before you step into my world of crazy. I am Lars, a.k.a. looopTools, a Software Engineer living in Northern Jutland, Denmark. I have 10+ years of experience from industry mainly through student positions, but also as self-employed consultant, or full-time employee. I mainly work in low-level user space, high-level kernel space, and storage systems in general. Besides research and software development, I also love the outdoors and try to go out as often as possible (not enough at the moment) and I am an aspiring author currently working on a few different novels. I also dabble in being a more advance home cook and baker, which you may see some posts about. Finally I like the ancient art of brewing mead, a.k.a. honey wine, and experiment with different flavour combinations and ageing times.
Reducing System Storage by deleting Time Machine Snapshots on macOS
For the longest time! I have had an annoying issue with my Mac Studio. A little over half of my disk was being used. I have a 1TB disk. Of this roughly 266GB was used on System Data.
There are so many post about this on Apples own discussion board, on Reddit, on Ask Different, and so on. YouTube has over a 100 videos about cleaning it and so. However, none of these solved the issue for me.
I went through application data, caches, and all the other fluff. Which according to the different resources could be the potential issue. Then! I noticed something. My Time Machine had been failing since July last year. YEAH YEAH I know CHECK YOU FLIPPING BACKUPS. I do check the others, I promise!
Which made me think, what does Time Machine do with the backups it prepare? Turns out it stores some form of snap short locally on your machine. But how can you know that? Because it sure as hell, is not obvious from Time Machine settings.
Well enter tmutil.
Which let you interact with time machine through the command line.
If you look at the man page you will see the verb listlocalsnapshots.
This let you list all local snapshots for a give mount point.
To get for you Macintosh hard drive run the command tmutil listlocalsnapshots /.
For me this gave me a list of 21 one snap shots:
com.apple.TimeMachine.2026-03-30-034253.local
com.apple.TimeMachine.2026-03-29-232838.local
com.apple.TimeMachine.2026-03-29-180459.local
com.apple.TimeMachine.2026-03-30-162801.local
com.apple.TimeMachine.2026-03-29-190510.local
com.apple.TimeMachine.2026-03-30-080956.local
com.apple.TimeMachine.2026-03-30-101239.local
com.apple.TimeMachine.2026-03-30-125847.local
com.apple.TimeMachine.2026-03-30-003759.local
com.apple.TimeMachine.2026-03-30-070449.local
com.apple.TimeMachine.2026-03-29-213724.local
com.apple.TimeMachine.2026-03-30-141114.local
com.apple.TimeMachine.2026-03-30-152753.local
com.apple.TimeMachine.2026-03-30-021149.local
com.apple.TimeMachine.2026-03-30-091308.local
com.apple.TimeMachine.2026-03-30-050221.local
com.apple.TimeMachine.2025-07-07-205826.local
com.apple.TimeMachine.2026-03-30-060144.local
com.apple.TimeMachine.2026-03-30-113605.local
com.apple.TimeMachine.2026-03-29-223324.local
com.apple.TimeMachine.2026-03-29-200941.local
First things first! APPLE!!!! Why are these not in order? Secondly, that is quite a lot although the do not seem to be so widely disburse. This sort of worried me because I have had my time machine hard drive connected. So why had it not taken any backups? Well that is saga for another day.
But how much space did these snapshot take?
Well, honestly I did not care about what was in them, as I have other backups I know is up to date and more importantly working!
So I decided to delete them ALL.
No dry run no nothing!
Like a pro!
Or something to that extend.
Turns out tmutil has a command for this called deletelocalsnapshots.
Please notice the s in the end.
The full command goes either tmutil deletelocalsnapshots <MOUNT POINT> or tmutil deletelocalsnapshots <DATE>.
It deletes ALL snapshots from either the mount point or from the date you provide.
I could not find one that actually can delete a single snapshot.
So powerful tool, a true nuke!
Either nuke with day precision or nuke it from orbit.
But what did this give me? Well my System Data Storage usage went from 266GB to 25.23GB so roughly a 10.5x decrease. Significant! Magnificent! So maybe you can give this a try. Though, I do urge you to be careful. In case there might be something in those snapshots you have deleted but needs.
NOW my next quest in this saga will be to find out what the hell is wrong. Is it the disk? Is it my mac? Is it macOS? A dark curse? Is it something else? Who knows? I do not. I have literally never seen Time Machine fail like this. And I have been using on the first mac I got with Mac OS X Leopard, so since 2008. Almost two decades without failure. What happened?
I will find out.
Reducing screen time using iOS Focus mode
People who follow this blog knows that I would like to reduce my screen time and spend time on other things. You can read about this in my post: How I am using less time on my Phone.
Now, whilst what I describe in the blog post just mention, does keep my screen time below 2 hours and often below 1.5 hours it is (to me) still a lot. I would like to average between 45 minutes and 1.5 hours max. The reason for this is, that I find my focus going up the less I use my phone with active screen time. Gaining focus is a goal for me. In particular in terms of being present when I am with other people and when I am doing a task. Be it at work or at home.
But, wait. What do I mean with active screen time. With active screen time I mean actually swiping around my phone and actively engaging with applications.
So how did I reach my new goal? Well, if you do not know iOS has a Focus Modes, some times only called focus. A focus mode allows you to set up what notifications you let through, what apps are available and more. For a long time, since the feature became a thing I have used a modified version of the sleep mode. It silence all notifications, except from my wife and my immediate family, I can only see the phone, messages, clock, health, and a few other apps. Just counted, it is apps in total. My phone goes into this mode about 30 minutes before my planned sleep time, so I do not get tempted to use some of my more time consuming applications.
I have also been a heavy user of the Do Not Disturb, in particular back when I was still in academia. Honestly, I think most students should have their phone in this during mode during the day and during evening study sessions.
However, do to the need for me being a little contactable during the work day, I had a struggle getting a mode that fully worked. So, now I have set up a custom mode (still called work) that I use daily, It is active whilst I am at my work location. I have the same notifications rules as in sleep, only my wife and immediate family. The mode allows me access to the following type of applications:
- Select Communication
- All music and audio book related
- Health releated
- Todos
- Security and Identification
While I would actually prefer to not have to use my phone for communication at work, I do need access to a few communication applications. Element for matrix communication, as I have some issues with the desktop application that is available on Ubuntu. I mainly use this application to stay in contact with the FOSS community when needed. Then there is signal, where I know if I get a message during the work day there is a pretty good reason for it. Finally Phone and Messages, as this is how I mainly communicate with my family. Also emails are allowed, though I mainly check them from my laptop.
For music apps I allow all. I am pretty heavy user of Apple Music Classical, Apple Music, Apple Books, and Bandcamp. With the three first being my main source of music and audio books. Bandcamp I will explain in another blog post. But I love having access to music whilst I work, as it help me focus. And YouTube just does not cut it during work ours as I fairly quickly get sucked into looking more interesting YouTube videos. Also YouTube has frustrating ads. But wait, why use a phone at all why not just use (for instance) Spotify? Well honestly… I have had such bad experience with Spotify that I do not see myself use it, again, ever. And I actually do not always use my phone because both Apple Music Classical and Apple Music has Web Players now :D
Health Apps! For reasons, I keep a tight look on my rough step count, pulse, and more. All of this I have consolidate into health where I can. And where I cannot I have allowed myself to use these apps.
Things and Apple Reminders are my jam. I use them for different types of todos and they honestly help me stay sane throughout the day. BY THE WAY Cultred Code where is my GTK based Things app for Linux???? I desperately need access to these to ensure I do not forgot stuff throughout the day.
Then there is Security and Identification apps. I have many, to many, two-factor authentication apps and a few password managers, which I do need access to through the day. Also in Denmark we insist on using MitID for accessing banks, governement sites, and more. Therefore, I need access to these from time to time during my work day.
Finally, I still sometimes need to be able to access the internet during meetings where I did not bring a laptop. To access different standard documents and more. Therefore, I have allowed Safari. This, however, annoys me as I sometimes have a hard time not using the app for less relevant things.
Setting up this Focus Mode has let me reduce my screen time even further! I actually cut my screen time by 30 minutes on average. Mainly, because I do not use my phone during micro breaks.
Now, I have now expanded my use of these modes to include one 1 hour before bed. I have almost the same restrictions as my work mode. But, I add a few Apps that I can use like Duolingo, Mendely, and Photos. This has actually added an additional 15-30 minutes reduction in screen. Bringing me solidly within the 45 minutes to 1.5 hours average I was aiming for. I even have a few days of 30 minutes screen time. Mainly taken up by Duolingo, and email and internet browsing where for the later I mainly go to Mastodon.
Findings
I have run with the above setup since January and I have some findings which I would like to present. These I have divide into a few sub categories.
For tasks
This section is not just in regards to work, but also tasks in my leisure time. I find that I do not have the same issues focusing deeply on a task that I have had in the past. It is also easier for me to juggle multiple tasks at the same time. Both are a huge benefit that overall have greatly increased my performance and I, honestly, make less mistakes.
Sleep
Whilst I have never had a problem falling asleep, staying asleep has been a problem. After, the introduction of my evening focus mode, I have found that my sleeping has gotten much less interrupted. And while I do not trust my smart watches sensors that much, it does appear to agree. I feel more rested and have started waking half an hour earlier than my alarm goes off. Though, I already was an early bird, it is nice to see I could get some gains there also.
Over all focus
Over all focus here, expands on the task section above to include things like, writing for this blog, personal coding projects, reading, cooking, and the list goes on. My focus has greatly expanded, during writing, reading, and coding sessions I no longer reach for my phone. I know how 45 minute reading sessions where I do not think about my phone. This has been amazing and I truly feel like I have won back my reading habits! In general, I simply do not grab for my phone so often anymore. Note: I have had a side question with listing to full music albums or self curated playlists which I will also have a blog post about later.
Where the heck is my phone
A thing I found surprising is that I forget my phone. Without wanting to, I go the bathroom with a phone, I go to meetings without my phone, I go out in the garden without my phone. It is quite weird, as this is not a habit I have had before. Whilst, I am writing this, I literally looked at my desk to verify that it was there. Sometimes, I notice that it is far away because my head phones cut out. It is quite annoying sometimes, when the phone is somewhere else and I need it. But hey, then I get some extra steps in.
Why the heck am I just watching YouTube
A thing I find weird, is that I do not enjoy watching YouTube as much as I use to. Some evenings I literally just feel like “Nah I do not want to watch”. Then I go pick up a book, clean, or something else. My wife has actually commented on this.
I will add here that I do often listen to audio books whilst doing stuff. But that is more just to enjoy the time more. Yet, I do want to cut that out too over time. Not saying here that there is anything wrong with audio books.
An extension is also, gaming has sort of lost its appeal. I have to be in a very specific mood to game.
Conclusion
Focus mode helped me a lot. I have shaved between 30 minutes to an hour of my active screen time. My focus has indeed improved and I do not feel like I constantly need to consume content anymore. Furthermore, I do not get gratification from doom scrolling YouTube and Social Networks. My Reddit abuse have been greatly reduced too. I do not even have the app on my phone anymore, only on my tablet.
I highly recommend configuring Focus Modes on your phone. They do exists on Android as well, I just believe they have a different name.
Easy way to work with time when using activerecord
The Ruby Programming Language is one of my favorit programming languages. Which for some reason suprise many people, so I will cover it in another post. Anyway, back on topic, and I have been using it for quite a while for personal projects. In particular for building APIs based on Sinatra and this blog is made using Jekyll.
When I make Sinatra based APIs I almost always have a database backend, most commonly I use PostgresSQL because it is epic. However, I always strive to make my code portable and whilst the pg is amazing, it does lock me to Postgres if I start making weird queries. So I often stick to using an Object-relational mapping (ORM) framework and more often than not I find that I use activerecord. The reason I use activerecord is due to its simplicity and available guides. Now you might think “wait, isn’t activerecord Rails only?”. No, whilst it is true that it is propperly most use with Ruby on Rails, you can use it as a standalone gem. Actually, the link to activerecord above is a link to the gem itself on rubygems.org. You still have support for migrations… if you write them by hand and you get all the nice features of activerecord. One of which is interactions with time.
So let us play a little bit around with this.
Let us assume we have a user model, that has username, email, password, when it was created, and updated.
Then we can write the migration something like this:
class User < ActiveRecord::Migration[7.0]
def change
create_table :users do |t|
t.string :username, index: { unique: true }
t.string :email, index: { unique: true }
t.string :password, null: false
t.timestamps
end
end
end
t.timestamps gives us the columns created_at and updated_at.
It is important to note here that activerecord assumes the date type for these are Ruby’s Time.
In the database from what I know with Postgres the date type used is timestamp without time zone.
Now let us play at little bit with activerecord modules before we move on.
When you install the activerecord gem, you also get a module active_support and it is filled with a lot of other submodules that are awesome.
One of these is active_support/core_ext/numeric/time, which gives us some nice extensions for how to interact with Time.
In vanilla Ruby if you want to get the time 24 hours ago you would do something like Time.now - (24 * 60 * 60).
For the basically subtraction the amount of seconds in 24 hours from the current time.
However, with active_support you can simply write 24.hours.ago.
You can even play with this in a tiny ruby program if you want to without a database.
The program below is quite simple and you can see the nice output below it.
require 'active_support'
require 'active_support/core_ext/numeric/time'
puts 24.days.ago
puts 24.hours.ago
puts 24.minutes.ago
puts 24.seconds.ago
puts Time.now + 24.seconds
puts Time.now + 24.minutes
puts Time.now + 24.days
2026-02-18 20:08:48 +0100
2026-03-13 20:08:48 +0100
2026-03-14 19:44:48 +0100
2026-03-14 20:08:24 +0100
2026-03-14 20:09:12 +0100
2026-03-14 20:32:48 +0100
2026-04-07 20:08:48 +0200
Now this is nifty, as we do not how to do “ugly” maths, like Time.now - (24 * 60 * 60) or Time.now + (24 * 60 * 60).
We can write it much more readable.
Only limitation I have found is that it does not have the option to work in years, yes I need that from time to time….
So what can we use this for?
Well let us say we want the users created in the last 24 hours.
we can express this as User.where('created_at > ?', 24.hours.ago).
But what if we want to have the users created between 24 and 22 hours ago?
Well activerecord actually supports Ruby’s Range class.
Thus, we can simply express our query as User.where(created_by: 24.hours.ago..22.hours.ago).
We can even make exclusive upper bound check by adding a . so it becomes User.where(created_by: 24.hours.ago...22.hours.ago).
This is quite nifty and powerful once you get use to it and I highly recommend that you do!
Firstly, because it makes you code easier to write.
Secondly, it makes it easier to read, always a very strong positive.
Thirdly, you do not have to make weird constants for like TWENTYFOUR_HOURS_IN_SECONDS = 24 * 60 * 60, which makes you code more easy to maintain in the long run.
Finally, I have found that I make much less computation errors when I express my time based queries in this manner.
Which, well… just makes me more productive which is also a huge bonus.
Finally, some may wonder “WAIT DO YOU NOT MAINTAIN QueryC++??? why do you need activerecord???”. Well, first of yes through Obsidian Wolf Labs I am still the main maintainer and currently only developer of QueryC++. But at Obsidian Wolf Labs, we do not only use C++, we also use Ruby, Swift, and Python. Also, I do not exclusively code in C++, for spare time projects I mainly use Swift and Ruby, with some C++ and C. Therefore, it is very nice for me to consistently improve my tool box.
./Lars
Why I do not use a dock
At work we use Ubuntu with Gnome, which comes with canonical dash to dock fuck up. Where Canonical has taking a perfectly great Gnome extension made by Michele Gaio and made it into a mix between the windows start menu and what ever that psycho trip was. Over the last month, this… thing has foster the discussion of docks. Quite a few of my colleagues, auto hides the default Ubuntu version of dash to dock, some change it to be macOS like, and then there is me who remove it. For some reason that I remove it, confuses people as I am not just a Gnome user, I am also a macOS user. Would I not love a dock? Well the truth is I do not use the dock, not even on macOS. There is I basically just ignore it. In this post I am going to cover why.
So first of on macOS back in the day when it was Mac OS X Leopard, when I returned to Mac. I did actually use the dock, but I reduced its size to be the bare minimum. A dock are a task bar like windows, take up a lot of screen real estate, even on 15” and 16” displays, which is the size I am used to. So I like to reduce the amount of space it takes up, thus minimum size, I am even disabled the magnifier functionality macOS dock has. But what happend if I used to use it? Why did I stop? It is simple really, I stopped using the mouse. A docker is rarely useful when you do not want to move your hands of the keyboard and on to the mouse. For some, I do believe dash to dock support this, you can assign hot keys such that you can launch applications based on the order they have in the dock. But then why the dock, why not just assign a hot key with the same purpose?
Then there is also the fact that I do not like to auto hide a dock and here is why. Unlike, apparently, every body else, I do not fling my mouse to the left or right side of the monitor. I throw it down and almost always I hit centre down of the screen. Which will make the dock show and at least in my experience with dash to dock and the dock on macOS, it does not auto hide again whilst the mouse is on top of it. This annoys me because, the show animation takes my focus away and I sometimes lose train of thoughts.
But how then do I launch apps?
Well this actually varies, a tiny bit, between Linux+Gnome and macOS.
Let us start with the later, on macOS I hit <CMD>+<SPC> to open spotlight and then I type the application name I need.
Usually I only have to type 2-3 letters to get the one I want and then launch it with enter.
On Linux, I have very good experiences with hotkeys.
So I have my most used applications bound to <Super> + <First letter of application anme>.
Emacs for instance is bound to <Super> + e.
If it is a less often used application I hit Super and open the Gnome Overview thing and type to search for the application I need.
Quite similar to how I used spotlight on macOS.
The reason I do not use hotkeys on macOS is due to the fact that I never got it to work properly.
So basically I don’t like the UX of docks anymore. Maybe I will get back to it one day if I ever start using the mouse more. But at least for now I am no dock kind of guy.
Now, before you leave I would like to give some praise dash to dock. This post was never meant as a bashing of Michele’s and all the contributors great work. I did use dash-to-dock on Gnome and I loved it! It is an amazing extension and if you are interested in having the dock experience you should check it out.
./Lars
Adding a recommendation Page
I have been asked quite often to recommend things, software, music, books, and more. Therefore I have added a recommendations page to this website.
Please have a look, you might find something interesting.
Happy New Year.