Doing a little spring cleaning today #MechanicalKeyboard
Micro Blog
three hundred eighty-two tiny posts on miscellaneous topics.
- #5km
- #adventofcode
- #adventofcode22
- #ai
- #airquality
- #algorithm
- #algorithmictimeline
- #algorithms
- #alignmentchart
- #android
- #anime
- #apple
- #arcticmonkeys
- #audio
- #bangalore
- #bengaluru
- #bicycle
- #bicycling
- #blog
- #blogs
- #bluesky
- #boat
- #book
- #books
- #bookwrym
- #bookwyrm
- #buildsystems
- #chatgpt
- #clojure
- #coffee
- #compiler
- #compilers
- #concurrency
- #coroutines
- #covid
- #cpp
- #css
- #deathcabforcutie
- #driving
- #eveningsky
- #fakerelay
- #fediverse
- #feed
- #feeds
- #flight
- #flu
- #food
- #functionalprogramming
- #garmin
- #ghc
- #golang
- #gotosocial
- #hashtag
- #haskell
- #hiking
- #homemanager
- #india
- #indieweb
- #interpreters
- #ios
- #japan
- #javascript
- #kbin
- #keyboards
- #kindle
- #lastpass
- #lazyweb
- #lemmy
- #linkblogging
- #lisp
- #llvm
- #macos
- #manga
- #mastoadmin
- #mastodon
- #mastodonmigration
- #maths
- #matrix
- #mechanicalkeyboard
- #miniflux
- #ml
- #music
- #netdata
- #newsletter
- #nix
- #nixdarwin
- #nixos
- #pandoc
- #parent
- #parkrun
- #personal
- #personalfinance
- #personalgrowth
- #photo
- #photography
- #photomonday
- #pinafore
- #pixelfed
- #plt
- #pollution
- #procrastination
- #programing
- #programinglanguages
- #programming
- #programminglanguages
- #python
- #qt
- #quantifiedself
- #quickcheck
- #reading
- #redditblackout
- #run
- #runnersofmastodon
- #running
- #rust
- #saturday
- #selfhosting
- #showerthoughts
- #signs
- #ska
- #softwareengineering
- #spotify
- #spotifyplaylist
- #spotifywrapped
- #stravayearinsport2023
- #streetphotography
- #sunset
- #systemd
- #threebodyproblem
- #til
- #tired
- #travelphotography
- #webdev
- #weeknote
- #wordpress
- #xz
- #yearinreview
- #zig
- #ziglang
The air quality in #Bangalore has been so bad recently. No wonder it is triggering all my allergies, which are keeping me up all night.
Current AQI in my neighbourhood is 326 (equivalent to US AQI 203). Only thing that's keeping my family somewhat healthy is the three air purifiers that we run all the time.
Seems like south-west #Bangalore is having an unusually terrible #AirQuality day today.
One of the great things about #miniflux, the minimal #feed reader, is that it lets users override the UI styles. So I customized mine to make it more compact, colorful and contrasting.
Getting better #audio equipment is like doing drugs. You get used to the better sound quality, you stop noticing it soon, and then you want even better quality. So you buy even better (and expensive) equipment, and the cycle repeats infinitely.
Some interesting #programming #blog posts I read recently: https://notes.abhinavsarkar.net/2024/links-04
#linkblogging
Moved into a new office. Now I have to reacquaint myself with all the new doors by remembering which ones to push and which ones to pull. Sigh.
@dcreager Hey Douglas. I just stumbled upon your blog (great articles!), and while trying to subscribe it via a feed reader, I noticed that the feed (https://dcreager.net/atom.xml) has not been updated in three years. Just wanted to let you know.
I often read on internet how so and so went out for a drive to calm down after a stressful event. I, on the other hand, am at my most stressed when I go for a drive. How's driving supposed to be calming‽
It's so bright here today that after I switched off the lights, I switched them back on thinking they were still on. #bangalore
The reason I decided to switch them off first time was because it was so bright already.
It's becoming difficult or expensive (because of high electricity bills due to running ACs) to work from home in #Bangalore because of the intense heat, and I hear that the local govt. wants to mandate work from home because of the water shortage. We are going to be stuck in a catch-22 situation.
Creator of #AdventOfCode @ericwastl commented “YES” on my post about https://abhinavsarkar.net/posts/compiling-aoc23-aplenty/ on Reddit so I guess all the time spent on this was worth it.
Every year I try to solve some problems from the #AdventOfCode competition in a not straightforward way. This year I solved the day 19 problem “Aplenty” by compiling the problem input to an executable file.
A new #blog post: https://abhinavsarkar.net/posts/compiling-aoc23-aplenty/
Now that #Zig is backed by gold, I request everyone to rewrite all their C codebases in #ZigLang.
https://www.bbc.com/news/world-africa-68736155
I've been away from #Clojure for a while now and I wonder if there are any libraries in Clojure that serve similar purpose as the Uniplate #Haskell library.
For those who may not be familiar, Uniplate is a generic data structure querying, traversal and transformation library. I find it indispensable for querying and transforming ASTs while writing compiler passes. #Clojure #Haskell
I've been reading the #Lisp in Small Pieces book, and it has helped me put names to a lot of concepts that I knew about Lisps and programming language design/implementation in general. It also provides a great historical perspective to #PLT, especially by mentioning all approaches that were tried but abandoned.
But other than being very very verbose, I find it hard to understand because it keeps changing the model of the interpreter every chapter. It starts with using Alists to model environments, then uses objects in the next chapter for the same, and in the next one, switches to using closures.
I get that it does this to showcase all possible ways of modelling an interpreter in Lisp, but it is quite disorienting to me as a reader.
But I can't say that the author didn't forewarn me. This is literally the fourth sentence of the book:
“To explain these entities, their origin, their variations, this book will go into great detail.”
It is a decent read, though the language feels a little outdated. It is translated from French so that may be the reason of the overly magniloquent language.
And of course, a fault that all old academic textbooks tend to suffer from: a lack of letters in variable names, like so:
```lisp
(define (evaluate-variable n r s k) (k (s (r n)) s) )
```
Shouldn't have they named the book and the show "Four body problem" because there are three suns and one planet, so four bodies? #ThreeBodyProblem
#FunctionalProgramming alignment chart. via @haskman
#programming #alignmentchart
Updating my #NixDarwin + #HomeManager setup to downgrade xz by patching nixpkgs with this PR (https://github.com/NixOS/nixpkgs/pull/300028), requiring me to build 886 packages. This is gonna be a while. #nix
@vedang goes on stage for his talk about developer productivity at IN/Clojure.
@deobald's keynote at IN/Clojure 24 is happening right now!
I learned #FunctionalProgramming to escape the imperative programming languages, which in turn got me interested into #Compilers and #ProgrammingLanguages. Turns out, most of the real-world compilers are written in C and C++, so here I am back at square one.
After years of avoiding it for decades, I taught myself #Cpp in the last couple of weeks. So anyway, does anyone want me to write a series of #blog posts about making a #Lisp interpreter (https://github.com/kanaka/mal) in C++?
What the ... I just learned C++ and White House is deprecating it!
https://www.infoworld.com/article/3713203/white-house-urges-developers-to-dump-c-and-c.amp.html
I've been writing #CPP for about a month now, and even though I have to lookup the docs very very often, the hardest thing I find is to keep track of lifetimes of objects, references and (smart) pointers. Using references and smart pointers gives an illusion of almost having automatic garbage collection. But one mistake of not tracking the lifetime correctly, and the object disappears, causing null pointers and segmentation faults.
I don't know if I'm running into these issues because I'm a noob or because that's how C++ programming goes. Hopefully it will become more intuitive with time.
The second biggest problem that I have faced with writing a PL implementation in #CPP is the lack of immutable data structures. I keep modifying the AST by mistake while walking over it. This is made much worse by the fact that I'm trying to implement a #Lisp with immutable data structures (much like #Clojure).
When I copy container data to preserve the old versions, I feel bad because of the performance implications. There is no easy way to share internal data between different versions of same data structures (AKA persistent data structures). Maybe there is a library that can help me all this.
I finished Make A #Lisp in C++20 in about 2600 lines of code. I learned a lot about modern #CPP and managed to write the whole interpreter without writing a single C-style macro or pointer arithmetic or type casting.
Compared to my usual choice #Haskell, C++ is way more verbose. I feel I can write the same interpreter in (idiomatic) Haskell in less than 800 LOCs. But it’ll probably be much slower.
Some time later in the year, I want to attempt writing a compiler for MAL in Haskell via QBE.
After a break of five long years, I'm giving a conference talk at the IN/Clojure conference about #FunctionalProgramming patterns in #Clojure: https://inclojure.org/#schedule.
I have previously talked about concurrency patterns in Clojure in the IN/Clojure 2019 edition. It is a fun little conference. If you are a functional programming or Clojure enthusiast/professional in #India, do consider going to this conference.
I am extremely saddened by the news of Akira Toriyama passing away today at the age of 68. His creations were a big part of my childhood. I still read/watch Dragonball every 5 years. #anime #manga
This is a great post by @tekknolagi on Compiling ML models to C: https://bernsteinbear.com//blog/compiling-ml-models/. I learned a lot! #programminglanguages #compilers #ml
What's with all the professors/academics in my timeline posting/boosting cat photos today? Is this some sort of tradition that I'm too uneducated to know?
Thanks to the quick PR by @farcaller for packaging the latest #Mastodon update for #NixOS, I was able to update https://fantastic.earth within two hours of of the new release. #mastoadmin
It's interesting how #Mastodon has had account list import and export support for while now, but there is still no service to publish, index and share lists among users.
Using #Nix unstable channel as the base for the software I use is a double-edged sword. I get the security updates and fixes earlier than the stable channel, but on some days like today, I end up building CMake, Meson, TCL, Rustc, Git and so many other things from scratch. And it takes hourrrrrs.
Today morning while I was brushing my teeth, I had a sudden realisation that the word “innings” is opposite of the word “outings”. It's just that we are indoor living people now, so we do more outings than innings these days. If we were people who spent most of the time outside, say in a forest foraging for food, and went to live in houses for winters, we’d call it "going for an inning”. #showerthoughts
I keep reading on internet how some Americans love eating vegetables so much that they specifically plan to have them with particular meals. And here I am (with my tropics born people), eating vegetables in almost every meal since childhood, not even thinking about them. 🤷🏽
#food
My life got 1.4x times better since I learned that I can have my orange juice alongside my coffee.
It has happened to me so many times. I am trying to figure out something tricky, have spend considerable time without any success, cannot find any clues on the internet, give up and put the problem at the back on my queue.
Within a month or so, drops a new blog post or a Github PR or a new tool that does exactly what I want. Maybe I'm just lucky. Maybe I notice such things because I’m looking out for them passively. Either way, it feels great when solutions just fall into my lap.
I tried to port the Racket to Assembly #compiler I wrote while following the Essentials of Compilation book (by @jeremysiek) to use QBE as the Assembly generation backend, but I couldn't because the book uses a shadow stack for tracking GC roots and QBE does not support that. Now I’m thinking of writing my own GC runtime to go along with QBE, maybe using libgc. Has anyone done something like this? Do you have any advice?
#compilers #programminglanguages
Shoot for the moon. Even if you miss, you'll end up making a beautiful mess. #music #arcticmonkeys
Happy World Introvert day to all the introverts out (in?) there.
#Haskell's documentation generation tool Haddock failed me so I wrote some regexes. Published new note: “Generating Standalone Haddock Docs for a Multi-package Haskell Project” https://notes.abhinavsarkar.net/2023/standalone-haddock
Today's been good. After trying for many days, I finally got all my #QuickCheck tests to pass. At least this one time. #compilers #Haskell
One of my most embarrassing secrets is that I often use the Fibonacci function for testing my #ProgrammingLanguages #compilers and #interpreters (as a basic case of non-trivial recursive function), but I never remember the actual Fibonacci sequence, and have to look it up on internet again and again.
#programming
I ran a 10k race with @nid and @kitallis last night. My goal time was 1 hr 15 min and my actual time was 1 hr 15 min 7 sec. :pikachuDance:
My last 10k #run time four months ago in August was 1 hr 20 min. I trained in Heart Rate Zone 2 for last four months and the improvements have been massive. I was never out of breath last night, even though I was running as fast as I could.
My plan for the next year is to train to be able to do sub one hour 10k by the end of the year.
Official timing results just came and my official time was 1 hr 14 min 37 sec. So I did manage to do my goal time. :pikachuDance:
I know I'll be terrible at playing it but I found it pretty cool: “Flappy Dird: Flappy Bird implemented in MacOS Finder” https://eieio.games/nonsense/game-11-flappy-bird-finder/. Made by @eieio. #macos
I had 230 active days this year according to my #StravaYearInSport2023 report. That's 65% of days! Hoping to do better next year.
This was an interesting read: “When would you ever want bubblesort?" https://buttondown.email/hillelwayne/archive/when-would-you-ever-want-bubblesort/
#programming #algorithms
कल रात अचानक से मेरी नींद खुल गई। जागते ही धूएँ की गंध आयी। परेशान होकर मैंने पूरे घर की जाँच की पर कुछ नहीं पाया। फिर खिड़की खोला तो पता चला कि धूआँ कही बाहर से आ रहा था । रात भर घर में धूआँ भरा रहा। सुबह उठा तो सर में दर्द था। पता नहीं कौन रात में कहा आग जला रहा था पर मेरी नींद तो पूरी ख़राब हो गई।
While trying to upgrade my VPS to #NixOS 23.11, I found that fail2ban config format has changed from using strings to structs. I can't find a single example on the internet about how to use the new format. Now I have to read the code to figure it about. That's so #Nix.
Even the official docs at https://nixos.wiki/wiki/Fail2ban do not show how to use the new format.
Figured this out and finally upgraded my VPS to #NixOS 23.11 with minimal issues. I had to disable a service because it no longer worked (and I no longer needed) but rest went fine without any hitch.
Checked Nixpkgs Github and someone filed an issue about the broken service just 30 minutes ago. Hopefully it gets sorted in few days.
It's been a year since a bunch of friends and I started the https://fantastic.earth #Mastodon server. We currently have 10 active users and pay about 4.1 USD per person per month for hosting costs, which includes hosting a #Pixelfed and a #Bookwrym server as well for our members.
We have two sysadmins and two moderators. Thankfully we have rarely run into system or moderation issues over the last year.
We are invite-only and accepting new members. If you know any existing members personally, ask them for an invite.
So many new services in #NixOS 23.11 https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11-new-services. I need to upgrade soon.
I bought the #Haskell #book Optics by Example by Chris Penner as my latest (last?) attempt to really understand lenses. Hope it works this time.
Sundays are for long runs, eating icecream and making fun of old movies.
Starting today morning the automatically set time in #macOS is being set to some far back time in past, causing connections to all secure website to fail. For now I manually reset it to correct date and time. Is this happening to anyone else? #Apple
I just made my #Nix + #HomeManager installation on macOS self-contained by making it so that running `nix-shell` anywhere uses the Nix package version in use by Home Manager, thereby sharing packages between the Home Manager installation and system-level Nix shells. I even deleted the `nixpkgs` channel after doing this because it's not needed anymore.
All I had to do was to add this shell hook:
```
shellHook = ''
export NIX_PATH=$HOME/.hm-nixchannels;
mkdir -p $NIX_PATH;
ln -f -s ${pkgs.path} -T $NIX_PATH/nixpkgs;
'';
```
and this session variable:
```
home. sessionVariables = {
NIX_PATH = "$HOME/.hm-nixchannels";
};
```
While trying to upgrade https://fantastic.earth to #Mastodon 4.2.1 today, I accidentally ended up upgrading the #Bookwyrm service as well because both of them were using the same #NixOS pinned channel. Mastodon upgrade worked fine but Bookwyrm refused to build because of some Python packaging issues.
So I just copied the previously working channel for Bookwyrm and changed its config to use the same, upgrading only Mastodon.
Doing these kind of things would be so cumbersome if I had not been using NixOS.
I also managed to wipe out the whole Nix store while trying to figure out the Bookwrym build issue (by running garbage collection). But no problem, I just ran the build again, and everything was back to how it was.
So, the point I'm trying to make here is, use NixOS for setting up your servers. The isolation and reproducibility (and composability) is worth learning the complex #Nix language.
The #Mastodon upgrade went without a hitch, as have all previous ones. #NixOS shines here as well because all the upgrade related changes are handled by the NixOS service code written and tested by expert maintainers, instead of random admins like me.
Only thing that 24+ inch monitors are more useful for than smaller ones is 3-way merge conflict resolution UIs. #programming
A test for a new feature I wrote started failing with different error diffs in every run. I was perplexed by it become all of my code is supposed to be deterministic, no random values created or used anywhere. After poking all over the code base and breaking my head over it for a day, I realized that the non-determinism comes from the hashmaps I used in my code. This is because iteration over hashmaps is non-deterministic, causing the output to be possibly different every time. 😩 #programming
I've quietly passed my one year anniversary of joining #Mastodon. With 324 original posts and over 1600 posts/replies/boosts, this is the most active I've ever been on a social network in the last decade. I've found some very interesting people here, and learned about many new things and perspectives. I hope this continues in the future.
Went for a #run in the park with @kitallis and @nid. Forgot to take a photo so here is the map of the run route.
#AI is taking over all aspects of our lives.
We put a slow automatic door closer on our house’s main door, because baby, and now every occasion of opening and closing the door is an exercise of patience and mindfulness. #personal
I've been bitten by #golang's lack of covariant generics. Now I have to restructure my whole code to work around this. 🫠
#programming
I'm currently going through the phase where my beard is long enough to be annoying but not enough to be majestic. Usually I shave it off at this point, but this time I'm hoping to care for it better and let it grow up to a point where the payoff becomes positive. #personal #personalgrowth
The week is ending today. You know what that means? A new #weeknote! https://notes.abhinavsarkar.net/2023/weeknotes-10-29
#blog
Got a new phone today. Gonna take the next week off to set it up.
I discovered a bug in my code last night just before falling asleep. It came to me out of nowhere while I was lying in my bed, half-asleep. Thankfully, I remembered it today when I started working. It's a severe bug, and now I have to spend my day fixing it. #programming
Very few things match the thrill of `git bisect`¹ narrowing down a test failure from 35000 PRs to one. #programming
¹ Well, an equivalent tool actually.
I love it when people write about many different things in their personal #blogs. But I always wish that they would tag their articles and provide tag-wise RSS #feeds, so that I could subscribe to particular articles I am interested in.
My five day long vacation starts today and I was hoping to #run every day, but I ran into a bench yesterday and now my knee is hurt :(
I hope that it heals by tomorrow.
I follow some extremely start people here, and sometimes I read their conversation threads where I don't get 90% of what they say; I just stare in awe. Often I find links to interesting papers and posts in these conversations that expand my knowledge horizon. I hope that if I keep reading them, I'll eventually understand the conversations as well.
Waiting for #NixOS to merge the PR for #Mastodon 4.2 so that I can deploy it on https://fantastic.earth.
#MastoAdmin
Still waiting on this. cc @raito
Now that I’m finding it harder and harder to scroll through the entirety of my #Mastodon feed every day (too many posts, too less time), I have taken to subscribing to the RSS feed of some accounts I’m particularly interested in.
My feed reader (Reeder5) pulls their posts and saves them for me till I have free time, typically once in a week, to go and read them. This works even if the server removes their old posts. I feel like this a secret trick not many know about.
Registered for a 10k #running race in December. Now I have no excuses to be lazy about the training.
I wrote a weeknote after a long break: https://notes.abhinavsarkar.net/2023/weeknotes-10-14.
#blog
#Wordpress is joining the #Fediverse, making it possible for people to follow Wordpress blogs right from your Fediverse accounts. But what if you have static-site generator based #blog? Use the excellent (and free) Bridgy Fed service https://fed.brid.gy by @snarfed! For example, you can follow my blog at @abhinavsarkar.net@abhinavsarkar.net, made available on fediverse using Bridgy Fed. #indieweb
Hey #NixOS + #Rust folks, can someone tell me how to patch the sources of git repo based dependencies of a Rust project when using https://crane.dev? #programming
I really hope that #Garmin makes their daily suggested #running workouts visible on their phone app. I really hate to click three different buttons on my watch seven times to see what is the next workout.
I love that I can participate in #Lemmy and #Kbin threads right from #Mastodon, without even signing up. For example, my post here https://aussie.zone/comment/3222308 was originally made here https://fantastic.earth/@abnv/111186198876587115.
My TODO list for a better #Mastodon digest is getting long.
I want to add a Discourse style calendar scroll bar on the microblog page on my website. Does anyone know if there is a library I can use? Searching on internet yields nothing. #WebDev #JavaScript #Programming
@wallabag package on #NixOS seems to be broken. I suspect that's because the latest release did not bundle the JavaScript assets. Trying to create a release by myself to validate this.
Turns out the real issue was actually how I packaged the app for #NixOS. Something changed between the updates and I had to fix the packaging for it.
@ivory I have noticed that Ivory crashes every time when macOS pauses it when it reaches screen time limit. And when it restarts it forgets the timeline positions and starts showing posts from many days ago. Please fix this bug.
Just witnessed a 2km long traffic jam in #Bangalore. I'm glad that I don't usually have to go out at in evenings.
I wonder if there is a #Rust #Programming book written in the style of Dive into Python or Real World Haskell, which teaches entire Rust (or most of it) by going through a set of real world projects from many different domains instead of giving simple artificial examples or focussing on some particular domain or aspect of Rust.
My fork of the #Mastodon digest has accumulated enough new features that I'm getting antsy of writing #Python, which is what the original is written in. I’m thinking of a rewriting it, but I'm conflicted between using #Haskell, which is my comfort language, #Golang, which may be easier for others to contribute to, and #Rust, which I want to learn.
The program involves fetching a bunch of JSON data from the internet, doing some statistical calculations on that data, and then outputting an HTML page.
What do you think I should rewrite it in? #Programming
The #fediverse has spoken. After putting it off for so long, finally it is time for me to learn #Rust.
As many #MastoAdmin upgrade their servers today to #Mastodon 4.2, I'd like to remind them to set up a scheduled job to periodically clean the databases and disks. Here is what mine looks like:
```
tootctl media remove --days=1
tootctl preview_cards remove --days=1
tootctl media remove --prune-profiles --days=1
tootctl statuses remove --days=90 --continue
tootctl search deploy --clean --no-import
tootctl accounts prune
```
Here's the result of a sample run:
```
Removed 7506 media attachments (approx. 4.57 GB)
Removed 5619 preview cards (approx. 188 MB)
Visited 214058 accounts and removed profile media totaling 1.82 GB
Done after 33s, removed 8833 out of 8836 statuses.
Done after 50s, removed 2075 out of 2075 media_attachments.
Done after 24s, removed 7309 out of 7309 conversations.
Indexed 0 records, de-indexed 8786
OK, pruned 366 accounts
```
Keep your servers clean so that your users don't face any surprise downtimes.
After a decade of using Google Android phones, I'm very tempted to switch to iPhone 15 this time.
More reasons to love #Mastodon and other #fediverse software over closed-source ones: I can patch them very easily. #MastoAdmin
X¹ is gonna take it² from ya.
¹ X was formerly known as #Twitter.
² 'It' refers to the money they are planning to charge.
One of my biggest regrets of my life is not being able to watch #DeathCabForCutie on stage because I was stuck in a typhoon, just 100 meters away from the stage. In grief, I gave up listening to them almost completely for many years after that. #music #personal
I could hear the echos of the songs they played from where I was stuck, utterly drenched and tired. The far-away sounds still haunt my dreams.
I almost died of hypothermia that night but that's a story for another time.
"You think you know what it takes to tell the user it's their birthday? You know nothing!"
Spending my Sunday cleaning up:
$ nix-collect-garbage -d --delete-old
4122 store paths deleted, 5492.07 MiB freed
I love having waterproof electronics because when they get dirty, I can wash them with water and soap, like this:
Unfortunately, the only truly waterproof electronic thing I have is my Garmin watch, which I do wash with soap occasionally. In fact, that is the officially recommended way to clean it.
I wrote a [rather long] blog post about my couch-to-10k #run training, with way too many charts: https://notes.abhinavsarkar.net/2023/10k-training
Never knew that closing channels in #golang is such an involved affair: https://go101.org/article/channel-closing.html
#programming
#programming What is your preferred way of following log files:
Seems like almost everyone uses tail or some variation of it to follow log files. Well, I'm glad that there is at least one person out there who uses less to follow logs like me.
I've been trying to build a personal #AlgorithmicTimeline for #Mastodon for myself for some time and I've got a basic version working. Here's how it works:
1. Fetch posts in my home timeline for last 24 hours.
2. Apply my Mastodon filters on them to remove unwanted posts.
3. Remove private posts.
4. Remove posts that I have liked, boosted or replied to.
5. Remove foreign language posts.
6. Fetch like, boost and reply counts for the posts from their origin server.
7. Partition posts into boosts and non-boosts, and apply next steps for each partition separately.
8. Assign scores to posts using this formula:
`score = geometric_mean(like_count, boost_count, reply_count) / square_root(follower_count_of_poster)`
9. If a post contains any of my specified favourite tags, increase its score by multiplying it by a constant factor (I use 1.2).
10. If a post is from any of my specified favourite accounts, increase its score by a constant factor (I use 1.2).
1/2
continued …
11. Reduce the scores of each post by a factor of `power(2, (time_now - post_create_time)/half_life)` where `half_life` is something like 6 hours. This causes older posts to have lower scores.
12. Group posts into threads they are part of, if any. Then select the highest scored post from each thread. This prevents posts from popular threads from taking over.
13. Sort posts by their score and select top 10% of posts.
14. Randomly select some posts from the bottom 90% of posts.
15. Render these posts as a webpage and serve on internet.
16. Run this entire process twice or thrice a day, and read the rendered webpage, interacting with the posts.
The initial inspiration for this algorithm came from @MattHodges's work (steps 1–4, 7–8, 13, 15) that I improved upon (steps 5–6, 9–12, 14, 16).
I have few more ideas like reducing the scores of posts with certain tags, but the current algorithm works pretty well for me. I'm also thinking about how to make it near-realtime instead of a batch process.
2/2
I feel happy when I find people who are/were programmers and also write/wrote fiction #books. Like here's a person who has mastered the languages of both the natural and machine world. It give me hope for my own creative endeavors beyond #programming.
Similar feelings for programmer musicians.
Today, after a long time, I'm playing my playlist of songs I want to learn to play on drums. Some are easy to play, some are difficult, all fun though. #music
I must have been very ambitious back then because this playlist has My Favorite Things by John Coltrane in it. 🤯
Injured my back while lifting the baby. Is this what being old feels like? #personal
Is it me or is https://lobste.rs down for last couple of days? Does someone know what's happening?
Seems like they had a hardware failure.
Finished reading "Type Systems for Memory Safety" https://borretti.me/article/type-systems-memory-safety by Fernando Borretti. It is a comprehensive review of various type system features across different #ProgrammingLanguages that are used to enforce (varying degrees of) memory safety at compile time.
As expected, it talks a lot about #Rust because Rust is probably the most used PL with compile time memory safety, but it features other languages like Ada, Val and Austral as well.
An interesting read if you are interested in #compilers.
I wonder where this "it's impossible to quit Vim" meme comes from. I have successfully quit Vim dozens of times in my decade long #programming career.
Mostly by yanking out the power cord.
If you are wondering why there was a gap of 40 minutes between the posts, I was busy trying to quit Vim.
Read https://noidea.dog/glue by @whereistanya and found this:
> In fact, doing glue work too early can be career limiting, or even push people out of the industry.
This reminds me of the time when I was the only senior (and glue) engineer in an important team of a big e-commerce company in India. I was coordinating seven projects between multiple teams, seting up the CI process, doing code reviews, mentoring multiple people, writing design documents etc.
At the end of the year, my manager gave me a bad review saying I didn't have enough code contribution. Ironically, that was probably the year when I had most impact on a company’s bottom-line. But the bad review after such hard work broke my heart. I switched to a different job soon after. It has been the shortest work stint of my whole career (1.25 years).
It's great to be a glue engineer if that's what you love doing. But it is very important to make sure that your contributions are counted.
To be honest, the aforementioned company was infamous for its bad work culture. A friend had a bet going with me that I wouldn't last even a year in it. Well, I won the bet but at the cost of my mental health.
breakfast today
Breakfast today: cut pineapple, papaya and dragon fruit. One tapioca cutlet, one pineapple strudel, one glass of pineapple juice. #food #photography
Any #MastoAdmin willing to share their experience of upgrading to #Mastodon 4.2? In particular, I'm concerned about the increase in resource usage by ElasticSearch.
I'd also like to know if removing the old posts using the maintenance command removes them from the search index.
I really miss a #ProgramingLanguages conference in #India. There used to be Functional Conf, which at least covered functional PLs, but they are not running anymore. And I can't be bothered to secure a visa to go to abroad ones. :sadface:
Being a #parent to a new human, I can never tell why I'm feeling unwell. Is it lack of sleep? Stress of feeding the baby? Stress of work? Daily commute wearing me down? An infection? Am I just hungry? Ate something wrong yesterday? Am I unwell because the baby is unwell? Or is it the other way? I have no clue. #personal
TIL that I have to run `home-manager expire-generations` before running `nix-collect-garbage` to actually delete all the old stuff in my #Nix store. Till now I kept wondering why I have five versions of VSCode installed on my machine.
Ah, there is goes:
11778 store paths deleted, 18809.04 MiB freed
Feeling so clean now.
I'm trying to set up #Netdata alerts on #NixOS for https://fantastic.earth but I can't find good documentation or examples of it. Help me out #lazyweb? #MastoAdmin
This is pretty cool: Parabolas in sequences of digits from the Fibonacci sequence https://math.stackexchange.com/questions/1416854/parabolas-in-sequences-of-digits-from-the-fibonacci-sequence
#maths
The good thing about having cucumber juice is that you are well hydrated. The bad thing about it is cucumber.
Is it weird to crave ice-cream all the time because you haven’t slept a full night in over a year? Too bad, there is no ice-cream in the fridge because I ate all of it already. #personal
I’ve been on Mastodon for nine month now, so maybe I should make an introduction post now?
#QT So that's why my legs are so strong! https://botsin.space/@trekkies/110898699520011164
Me starting to learn #Rust in 2023:
HEY COMPILER, if you know where to add the missing semicolons, why don't you add them yourself‽
Now that I follow around 500 people here, I often wake up to over a thousand #Mastodon posts. What are some good ways to keep up with them?
This post led me to explore #Mastodon clients with unconventional interfaces and I found some interesting one:
– Ebou (https://terhech.de/ebou) has the layout of a desktop messenger: leftmost column shows account names that have posted recently; clicking on them shows recent posts by them in an adjacent column, and clicking on the posts shows their conversation threads in the next column.
– Tut (https://tut.anv.nu) is a terminal UI client inspired by Vim, the code editor. It supports Vim like keyboard navigation as well.
– Macstodon (https://github.com/smallsco/macstodon) is a Classic Mac OS app, and looks kind of like old-school IRC clients.
– Stomp (https://stomp.social) run on Apple watch. You can scroll timelines or mention or lists but only one post at a time.
– Mastotron (https://github.com/mastotron/mastotron) completely eschews the concept of linear timelines and instead presents posts as graph of connections.
If you know any other such unconventional clients, please feel free to add to this thread.
Forgot to mention Toot.
– Toot (https://github.com/ihabunek/toot) is a CLI client, which provides you commands to interact with Mastodon. For example, to see the recent posts by me, you can run `toot timeline -1 -a abnv@fantastic.earth`. You can also use it to automate interactions. For example, to follow accounts that recently made posts with the Haskell tag on the https://discuss.systems instance, you can run: `toot timeline -1 -i discuss.systems -t Haskell | grep -oP "@[^ ]*@[^ ]*" | sort -u | xargs -n1 toot follow`. I love it!
Analysed the run time data from today's 10km #running race.
5%ile = 52 min
10%ile = 55 min
25%ile = 60 min
50%ile = 68 min
75%ile = 79 min
90%ile = 87 min
95%ile = 95 min
I've been charting my Couch-to-10k training runs. It's only been few weeks but I am making good progress. See an interactive version at https://abhinavsarkar.net/activities. #running #quantifiedself
Three weeks later, I'm doing longer runs with higher speed. Two more months to go before the race.
A month later, most of my runs are in 5k+ range. Though my pace hasn't improved much, my endurance has certainly gotten better. I'm able to run 15k+ every week now. One more month to go before the race.
#running #QuantifiedSelf
After three months of Couch-to-10k training, today I ran the 10k #run. I'm so happy to see the progress over time. Next, I'll rest for three days and then start training for the next 10k race aiming for a better time.
#running #QuantifiedSelf
https://fantastic.earth went down for few hours today because #NixOS decided to build the new nodejs package from scratch on the server. And that ate all the CPU and memory, causing the #Mastodon server to become unresponsive. I need to figure out a remote building strategy for Nix so that this doesn’t happen again.
@arun and I have finally succeeded in setting up the remote build for the https://fantastic.earth #NixOS setup.
We ran into an issue where Nix runs a command on the remote machine with sudo, but we didn't want to give sudo permissions to the remote build user. It turns out, sudo is not really needed and the build works fine without it. So @arun hacked up a no-op sudo substitute, which when put in the $PATH satisfied Nix and the build worked. ¯\_(ツ)_/¯
Finally, no more build caused downtimes!
I really wish feed readers would support syntax highlighting of code in blog articles. Then I’d finally have no reason to go to blog websites, and would read everything from the comfort of my reader.
I’ll never forgive Sword Art Online for making Isekai #anime so popular that 90% of anime made these days are Isekai. The deluge of so many mediocre Isekai anime has completely destroyed my interest in the subgenre that used to me one of my favourite.
The biggest problem with mechanical #keyboards is that you can buy one only once in ten years but the new models keep coming out all the time.
Attending an introductory course to #Rust tomorrow after trying to get started on it and giving up multiple times on my own. Hopefully it will click this time.
EDIT: This is the course I’m attending https://google.github.io/comprehensive-rust.
Done with the first day of the course. I have a better understanding of ownership in #Rust than before, but coming from garbage collected languages like Java and Python, I am still struggling a bit with move and copy semantics of variables.
Did any #MastoAdmin upgrade to #Mastodon version 4.2 yet? Do you have any additional notes?
Now that #Mastodon will have list import and export in version 4.2, someone should build a service to share lists. That would make it easier for new people to join and get started.
Followed a bunch of interesting people found using https://whomtofollow.com. Hoping that it'll make my timeline more lively, maybe even change my life!
Switched to yearly licence for @ivory after some fighting with the Apple payment system. I hope Ivory adds more useful features to make it worth it.
There's a new season of Futurama‽ This upsets my whole worldview.
Today's XKCD comic touches my soul. https://mastodon.xyz/@xkcd/110821269775454063
My today's cab's engine sounds like a sports car one. Though there is no opportunity to go fast because of this terrible traffic. Maybe the driver uses this car for racing in nights?
Toot is not a very feature rich client for #Mastodon but it is certainly useful for automating interactions using scripts.
Men will literally rewrite their code to be multithreaded instead of filing their tax returns. https://fantastic.earth/@abnv/110798065277045555
Well, I filed the tax returns with more than five hours to go before the deadline, so I'd call it a great success.
Made some #python code multithreaded today. Now it runs in 30 minutes instead of 2 hours. Protip: always log the thread name in multithreaded programs.
#Spotify is playing me 80s Bollywood disco music today for some unknow reason. This is not a complaint. #music
So, umm, how is Threads doing now?
My shoes used to wear out on the inside of the feet because I have flat feet, and caused me knee pains. So I started using the foot arch support insoles for correction, and then my shoes started wearing out on the outside of the feet. ¯\_(ツ)_/¯
Now, I alternate between using and not using the insoles so that my shoes wear out evenly. #running
Used https://federike.social to quickly and easily categorise the accounts I follow into lists. I think it'll help me in keeping better tab on posts. #Mastodon
Just paid my dues for #selfhosting #Mastodon https://fantastic.earth, #Pixelfed https://arti.stic.earth and #Bookwyrm https://linguistic.earth. Came out $4.8 for a month.
I just noticed that @trunksapp #Mastodon app has gained inline threading of posts in timelines! This makes it so much easier to read threads. However it sorts threads by the first post date instead of last, which causes new replies to old posts to appear much later in timelines. I wish they'd fix this.
I've been charting my mutual fund investment values like any good #QuantifiedSelf enthusiast, and I'm amazed to see the difference in the volatility of gains in equity and debt funds. #PersonalFinance
I took two back-to-back early morning flights last weekend and only today I feel rested enough to do any mental work. I'd have recovered quicker but baby fell sick and I couldn't sleep at nights. I was on vacation the whole week but all I could do was to watch Netflix and scroll Mastodon. Couple of more days left in my vacation, in which I hope to write and publish a blog post. #personal
Of course, I wasn't able to write a blog post. Between caring for the baby, working for my job, and training for the 10k run, I barely have enough mental and physical strength left to do anything else productive. It feels bad but there is nothing I can do but persevere till I build enough stamina to be able to do my other hobbies. On the bright side, I can run over 8km now and not almost die afterwards.
The #Pixelfed companion to https://fantastic.earth is up on https://arti.stic.earth now. Check out my profile @abnv@arti.stic.earth.
And now, we have the #Bookwyrm companion to https://fantastic.earth also up at https://linguistic.earth. Follow me @abhin4v.
It's the file-my-taxes kinda day. And I must admit, I really dislike doing it.
#runnersofmastodon How is your experience with bone conduction open ear headphones like https://shokz.com/products/openrun ? On paper, they seem pretty suitable for #running outside but I can't tell if they are really worth their price. Please share your thoughts so that I can decide if I should get them. Boosts for reach appreciated.
Upgraded https://fantastic.earth to #Mastodon v4.1.3. The process was smooth as ever, thanks to #NixOS packaging.
I'm not getting a Threads account. It took a lot of effort for me to get out of Facebook's grip, I'm not going back just like that.
Started the #run late today, after 8am. But thanks to the amazing weather in #Bangalore, I had a lot of fun. This was also 25th run of my couch to 10k training, resulting in more in 80km of #running in total. #runnersofmastodon
Followed a bunch of people from my #Pixelfed account @abnv@arti.stic.earth and now waiting for them to post photos so that my feed fill up.
I've been writing a lot of #Golang code these days after a gap of five years, and while newly introduced generics make working with collections tolerable, the error handling is still terrible. Also, I’m never sure if I should be using pointers or values. Are there any established practices for writing good Go these days? #Programming
Some interesting (at least to me) charts from my #running training data:
1. Average running power seems to be linearly correlated to running pace.
2. Average heart rate seems to be correlated to running pace as a logistic curve.
3. Average running cadence seems to be uncorrelated to running pace.
Crunched some numbers today and found that I made three times more money (adjusted for inflation) in last five years as a senior software engineer than I made as a junior and mid-level engineer in the ten years prior to that. #QuantifiedSelf
I’m waiting for #Pixelfed 0.11.6 to land in #NixOS so that we can finally host an instance for the https://fantastic.earth folks.
It is a beautiful rainy day in #Bengaluru, so I took the day off from work to stay inside and do all my pending chores.
Yesterday's #run was fun. I can never get enough of the lakeside. #running #runnersofmastodon
Added a new entry in my blocklist today. #redditblackout
I ported @mattmight’s CPS conversion code (https://matt.might.net/articles/cps-conversion/) to #Haskell and after some fighting with the type system, it worked! To make the interpreters work with the Cont monad, I had to remove recursive lets and hence, functions being able to call themselves recursively, but the rest works fine.
The attached images show the conversion of the Fibonacci function into the CPS version.
`call/cc` conversion works as well! I must say, it is somewhat magical to me.
And it was just 200 lines of #Haskell code including Alphatization. https://abhinavsarkar.net/code/cps-transform.html
It's amazing to see the support I’m getting on #Mastodon. I never got this kind of encouragement on Twitter.
After upgrading my server to #NixOS 23.05, my Nix based CI that runs as a #Systemd service fails to run `nix-build` with the error "unable to mount /proc". Something has changed in Systemd sandboxing that is breaking my previously working code. Does anyone have any clues?
Update: removing these lines from #Systemd service config fixed the issue:
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
Though, I feel like this is something that #Nix should be addressing instead.
EDIT:
Found out that having the ProtectKernelModules flag does not actually cause any issues. So the fix now it to remove ProtectKernelLogs and ProtectKernelTunables flags.
Hey, it's my cakeday on #Reddit. I've wasted 16 years of life on it.
I wrote the fourth part of my #blog series “Implementing Co, a small programming language with coroutines”. And this time, we add support for channels in Co for inter-coroutine communication. https://abhinavsarkar.net/posts/implementing-co-4/
#Programming #PLT #ProgramingLanguages #Compilers #Haskell #concurrency
Sometimes I have my computer read my #blog posts to me aloud for the purpose of proofreading. It is really funny to hear it say "Right arrow curving left" again and again when it encounters the footnotes.
Went for a #run by the lake after years. Came back with more energy! #running #photography
Latest #Garmin software update added running dynamics measuring to my #running watch! It's a completely unexpected but great surprise. But now I have to worry about my low vertical ratio.
OK @ivory, you win. You've made a subscriber out of me. Now please implement post threading in the timelines. I really hate reading posts in reverse order.
Upgraded my server and https://fantastic.earth to #NixOS 23.05. Faced only one issue of Man cache generation not working, which I then disabled because I don't need Man cache on a server anyway. Rest went smooth.
#Spotify just made my day: https://open.spotify.com/playlist/37i9dQZF1EIdfxn5SYf57p?si=50e30f027deb4e8c
#spotifyplaylist #music #ska
I just reached two hundred original posts (excluding boosts and replies) on #Fediverse! Took me six months. I have them all archived on my website https://abnv.me/mb, something which I couldn't do when I was on Twitter. #indieweb
I love @ivory, it is probably the best #Mastodon client there is, but I really miss threaded posts in my timeline, which @phanpy and @elk do really well. Another feature I wish Ivory had is Boost carousels from Phanpy. If Ivory adds these two features, I'd use it all the time, on all my devices.
Today I ran my first 5k #run in the Couch-to-10k training. It was hard but I feel really good about it. It took 6 minutes more than what it used to take pre-pandemic, but I'll get back there with time.
Today I had to write #nix code that looked like this:
```
blah.overrideAttrs (oldAttrs: {
x = oldAttrs.x.overrideAttrs (oldAttrs: {
y = oldAttrs.y.overrideAttrs (oldAttrs: {
outputHash = "xxxxx";
});
});
});
```
#nixos folks, is there a better way to do this kind of nested overriding of attributes?
I have a suspicion that @ivory on iOS supports multiple column layout but I am not able to figure out how to enable it.
Trying out the #Mastodon client @phanpy for the first time:
— Rounded corners everywhere, which is a little too much for my taste.
— I love the Boost carousels, and clean post threading, and post detail popups.
— The light mode somehow looks better than the dark mode, which is very unexpected because I use almost everything in dark mode.
— Really missing having keyboard shortcuts for navigation and actions.
I'm going to try it for a couple of days to see how it compares to my current client @elk.
Also, I don't like how @phanpy hides the multi-column view under Shortcuts settings, and how changing the timeline from home to something else reverts the view to single column.
I hope they work these issues out in time. I definitely see the potential for @phanpy to become a great #Mastodon client.
Update after two weeks of trying @phanpy: I love it and now I am using it full time in the browser (I use @ivory elsewhere). I still miss the keyboard navigation and shortcuts though, but Phanpy is so much better for quickly going over hundreds of posts when I wake up. I'm guessing that's because of the way it groups boosts.
Went out for a run in the park and managed to capture a photo with almost no one in it, even though the park was full of people. #running #photography #parkrun
Drove a car for 84 kms today, the longest I've ever. Can't say that I'm a fan of #driving cars yet, but it wasn't as bad as I had imagined it would be.
@gotosocial is an up-and-coming #Fediverse server, which is great for running single-user instances because of its low resource footprint. I wrote a #blog post about how to run a GoToSocial server on #nixos: https://notes.abhinavsarkar.net/2022/gotosocial-on-nixos
@trunksapp does not render ‽. How am I going to express my conflicted emotions‽
Here's how you can add #Mastodon comments to the posts on your website: https://notes.abhinavsarkar.net/2023/mastodon-comments
#blog #indieweb #programming
Added support for displaying #Mastodon comments on my notes #blog by writing some quick #Javascript: https://notes.abhinavsarkar.net/2023/mastodon-comments
I should write a #blog post about this.
I wrote a #blog post about my #bicycling journey. https://notes.abhinavsarkar.net/2023/bicycling
Tired: using #AI to write formal emails.
Wired: using AI to turn emails in pop songs:
(Verse 1)
Hey Josh,
I've got a question for you.
Can you tell me when the slides will be available?
I've got a meeting that might conflict,
So I need to know the schedule.
(Chorus)
Hey Josh,
I need to know the timing.
Can you please let me know?
I'm counting on you,
So don't let me down.
(Verse 2)
I know you're busy,
But this is important to me.
I need to know the schedule,
So I can plan accordingly.
(Chorus)
Hey Josh,
I need to know the timing.
Can you please let me know?
I'm counting on you,
So don't let me down.
(Bridge)
I know you'll come through for me,
Josh.
You're always there for me,
And I appreciate it.
(Chorus)
Hey Josh,
I need to know the timing.
Can you please let me know?
I'm counting on you,
So don't let me down.
(Outro)
Thanks, Josh!
I knew I could count on you.
I recently set up backups for our #Mastodon instance https://fantastic.earth, and wrote a note about it: https://notes.abhinavsarkar.net/2023/mastodon-backup
Went for a #bicycle ride today. The weather was so good, I didn't want to come back home.
The downside is the #pollution I have to face outside. I forgot to wear a pollution mask today, and now I'm fighting my allergies. When running, I can't even wear a mask, so I need to wake up crazy early like 5am to avoid all the dust and smoke.
Added very dumb preview cards to my #blog so that you can read the article titles before visiting them. Eg: https://abhinavsarkar.net/posts/implementing-co-3/
I generated these by taking screenshots using headless Chrome, like this:
`chrome --headless --disable-gpu --screenshot --window-size=500,255 <url>`
That's why they look so unrefined.
Configured a macos shortcut to post to #Mastodon so that I can be even more of my lazy self.
I'm really starting to like this shortcut. Now I can post more of my random thoughts in much quicker way!
TIL that #Mastodon has RSS feed per hashtag for each user. For example, you can find the feed for all the posts by me tagged “programming” at https://fantastic.earth/@abnv/tagged/programming.rss.
Spent some time fixing small bugs in my website. Sometimes it's nice to write code for oneself.
How do I find which revision of #nixos nixpkgs-unstable is available in cache for darwin-x86_64? Every time I update to latest unstable revision, I have to rebuild a lot of packages and it takes hours.
Left the air purifier running at home for three weeks of vacation, came back to clean air and the unexpected electricity bill.
And the kid forget how to walk because we left the walker at home. Though it came back to them in 5 minutes.
Pulled some visit numbers for my website https://abhinavsarkar.net. It seems it is slightly more popular in months I don't publish new posts, as compared to four years ago. But on the other hand, my recent posts don't get as much traffic as the ones before.
My notes blog (https://notes.abhinavsarkar.net) however, is seeing a lot more traffic that before.
@raito I found your Pixelfed PR in nixpkgs (https://github.com/NixOS/nixpkgs/pull/207194). Is it stable enough to be deployed? I don't want to wait for months for approvals.
I love that on #Mastodon you can turn a public thread into a private thread and the thread still continues with the same context.
Very tempted to buy #Garmin FR 255 in the ongoing Amazon sale.
My temptation won and now I have this.
One downside of purely chronological timeline in #Mastodon is that my home feed is mostly silent during my day time, and most active during my night time. So I read all the interesting stuff hours later, and I have to scroll my entire feed for that.
I'd love it if one of the third party clients can surface most interesting
posts by locally running some algorithms based on boost and favourite counts.
I do have Mastodon digest (https://github.com/mauforonda/mastodon_digest) set up to find and show interesting stuff from my timeline twice a day, but it'd be good to have it integrated directly in @ivory or some app like that.
Some interesting #programming related things I read on the internet last month: https://notes.abhinavsarkar.net/2023/links-23-04
Installed MonaApp for #Mastodon on MacBook. I can’t say I like its old-school Mac sliding panes UI. But it does have scores of settings and seems pretty configurable. Maybe I’ll give it a shot later.
Ran into a bug in @MonaApp almost immediately. It assumes that posts have character limit of 160, which is not true on my server.
I wish #PDF readers supported dark mode. I have dark mode turned on everywhere, but I still have to road PDFs like cavemen staring into blindingly bright fires.
Spent hours trying to package https://moaparty.com for #nixos. After failing to use mach-nix, poetry2nix and pip2nix, I'm finally trying the fixed-output derivation hack. It shouldn't be this difficult to package #python applications for nixos.
OK great! The output of `pipenv install` is actually not fixed and fixed-output derivation does not work either. If someone with more experience in packaging #python applications for #nixos can help me out, I'd be very grateful.
Our small #mastodon instance has 99.91% uptime according to DO uptime check. That is 39 minutes of downtime in 30 days. I wonder how other small instances are doing.
I haven't personally experienced the downtimes though. They must be happening while I'm asleep.
I wonder if I should write a #mastodon rebooster script that will boost my (or your) certain posts periodically, for a week or a month. Would people be interested in that?
I analyzed my sleep over the last one year and wrote a note about it: https://notes.abhinavsarkar.net/2023/sleep-analysis #blog #quantifiedself
Witnessing a sand storm for the first time after decades. It's making me cry.
I should have known that the government is on it!
I've been feeling unusually sleepy today morning, and I just realized that I forgot to drink #Coffee today. I wonder if I can still drink a cup without wrecking my early sleep plan.
@abnv drank a cup and that definitely fixed the sleepiness. Let's see if i can wake up for the morning run tomorrow.
Just raised the #Mastodon post size limit at https://fantastic.earth to 1000 so that I can write mini blog posts right here.
Should have set it to 1337 characters. What a missed opportunity.
@samebchase Welcome!
Fun fact: I drank 1259.5 litres of water in 2022. That's 3.45 litres of water every day on average. #quantifiedself
Using the iPad Air as an extended screen for my MacBook makes me wish I bought an iPad pro instead. :(
One downside of using dark mode everywhere on my laptop is that I rarely notice the dirt slowly accumulating on the screen. So I guess that's a ... win-win?
WTF ICICI Bank? Disallowing mobile banking app because I have developer options on? #india
I wrote a note about my reading process: https://notes.abhinavsarkar.net/2023/reading-process
#blog #reading
This maybe a #India specific thing, I wonder why nobody turns off their vehicles at traffic signals. Even if you don't care about the environment, why not save some money, fuel being so expensive now.
Changed my microblog page (https://abnv.me/mb) to point the post links to https://elk.zone instead of the default #Mastodon UI because of superior threading UI on @elk.
#indieweb
One think no one tells you about having children is how difficult it is to get the forever looping baby rhymes our of your head.
Upgraded to #GotoSocial 0.8 and connected to Elk. The #selfhosting experiment continues.
I've got to invent more filters to block US politics news from my Mastodon feed.
This is the best marketing video for a #programming language. https://youtu.be/oGkCwSdZBds
Updated #macOS to the latest version and had to input my password three times. Sometimes I rue the day I chose the super long password for extra security.
This is useful for people like me. #covid
Some interesting #programming related internet web pages I read last month: https://notes.abhinavsarkar.net/2023/links-23-03
Yep, I have the #flu. In retrospect, I should have guessed this when I drank 2l of water in the morning itself.
About 15 days later, I finally felt recovered enough to pre-sickness level. Is it me or the recovery time increases with age? #flu
I really wish for more #blogs to support per tag RSS/Atom #feeds so that I can subscribe to content that interests me and not clutter my feed reader.
@yudistrange welcome!
Trying to debug a memory leak in #haskell be like:
Spent hours trying to debug this memory leak, just to fail again and again. Finally, decided to read the docs of all libraries used and the first one itself says:
Lesson learned: thoroughly read the docs and source of your dependencies. Or at least skim them once.
Wrote a script to fetch missing replies to posts users on my server reply to in #Mastodon, trying to fix the issue described at https://github.com/mastodon/mastodon/discussions/22608. Running it as a cron job every 5 minutes. Seems to be working fine.
If there is any interest, I can share the script. #mastoadmin
cc @alexelcu
Wrote the script in #Python and found myself mixing `filter`, `itertools`, `yield`, generator expression and list comprehensions, and `for` loops. It offends me to use so many different control flow mechanisms at the same time. I feel like there must be a better way to do this, but I'm no Python expert.
The script: https://notes.abhinavsarkar.net/2023/mastodon-context?mtm_campaign=mastodon.
I wrote a Python script to fetch missing context toots for #Mastodon. https://notes.abhinavsarkar.net/2023/mastodon-context?mtm_campaign=mastodon
Here is a sneak peak at the diagrams I'm making for the part 4 of my Implementing Co #blog post. I must say I love https://monodraw.helftone.com.
#programming #programminglanguages
#bangalore is very dry this year because it hasn't rained in over four months. I don't remember when was the last time it didn't rain in winter here. Thinking of getting a humidifier, but then it may start raining this month.
Got myself a #Pixelfed account at @abnv@pixelfed.qayamat.se, thanks to @arun. Follow me to like my okayish photos.
Added a #hashtag cloud to my Microblog page https://abnv.me/mb because why not! #indieweb
Some interesting (and mostly #programming related) things I read on the internet this month: https://notes.abhinavsarkar.net/2023/links-23-02
Changed the commenting service on my website from Staticman to a self-hosted Isso instance. Looks good so far.
Now, only if someone would comment on one of my posts ...
After a break of about one and half years, I have started reading Crafting Interpreters again, and I am still amazed by the lucidity of the writing. The only other #programing #book I recall to be this much fun reading is Learning Perl.
#ProgrammingLanguages
Someone commented just “Roll credits!” on my #blog post and I think l am either too old or too non-american to understand what it means. Anyone's got any clues?
It's the perfect lazy stay-in-bed-reading-a-book kinda #Saturday.
Now it's turning into a going-for-a-walk-around-the-lake #Saturday.
Or not. We are drinking fancy tea instead.
Good going #twitter. One more reason to move to #Fediverse.
Upgraded my website generator to use #GHC 9.4 and it took two hours to build. Well, that's the cost I pay for using bleeding edge software.
To clarify, it wasn't GHC that took two hours to build. It was my website builder which uses #Pandoc and Shake.
I wrote the third part of my #blog post series: “Implementing Co, a Small Language With Coroutines #3: Adding #Coroutines”. https://abhinavsarkar.net/posts/implementing-co-3/
Reply to this toot to post comments on the article.
#programming #programminglanguages #plt #compilers #haskell #concurrency
After a gap of 1.5 years since the last part, I have finally finished writing the third part of my post series on implementing Co. Planning to publish it this weekend. #haskell #programminglanguages #blog
Feels like shouting in the void but anybody willing to do a review of the draft? #haskell #blog
My cab is taking an unusual route today and as a result I am back in parts of #bangalore that I have not been in many years. Things have changed but at the same time, they seem very much the same.
I've lived in so many different parts of Bangalore over the last decades that travelling within the city sometimes triggers waves of nostalgia.
Running a massive update on my #nixos VPS today. I wonder what changed to cause this.
I should integrate nvd in my deploy script to be able to see diffs.
The just released #haskell book Production Haskell looks great for making the jump from the forever beginner/intermediate level to professional level. https://leanpub.com/production-haskell
Went to a chafé today for some tea. Some people were sitting with their laptops as usual. But there was this woman sitting next to me with an entire server computer with her. I didn't disturb her. #bangalore
On the other side of my table was sitting a guy with a small laptop, wearing a black hoodie, with the hoodie on in this heat. I overheard him say, “The deployment is broken because some new guys checked in some code in our repo. I think the right way to solve this is to break our repo into smaller repos and create more microservices from them.” I didn't disturb him either. #bangalore
The tea was okayish and very overpriced. ~fin~
I hate how the hum of the cab engine hides the bassline of the #music I listen to while commuting. But I'm too cheap to buy good headphones with noise cancellation. So I guess this is my life now.
What's a reasonably priced and good RSS feed to email #newsletter service that I can use to send my #blog posts to my twelve subscribers?
Went for a morning walk after a long time. It's strange how expending energy makes us feel better compared to conserving energy as a couch potato.
A random Netflix show about a guy going around the world on a #bicycle inspired me to dust off my bike and go out for a ride.
Almost immediately I was reminded of why I don't cycle in #bangalore anymore: Dust and smoke everywhere. Even with mask and goggles on, it was in my nose and eyes. Not to mention, the broken roads with pot holes and the terrible traffic.
5 years ago, I used to commute to work daily on my bicycle. Now it is hard for me to even imagine doing that. 😭
Pulled in the posts from my types.pl Mastodon account to my website's microblog page https://abnv.me/mb. Next, add the posts from my Twitter archive.
#indieweb
Now my website's search indexes my Mastodon posts as well, along with my blog posts and notes. Another step towards #indieweb.
Switched from LocalStorage to IndexDB for caching the search index on the browser. Apparently, that's the recommended thing now. 🤷
I've started downloading files to the temp directory now. That way, I don't have to go back and delete all the junk later on. And if something is important enough to be kept around, I move it the proper location fearing the automatic deletion.
When in #Japan, take a bullet train and make a video.
I need to be more patient with phone charging.
Turns out it was because of adaptive charging in #Android which reduces the charging rate when you charge the phone at night. It expects me to charge the phone for the whole night, but I kept unplugging it in the middle of the night. Turned off adaptive charging and my phone is fully charged now.
Set up a mesh router in my house. Finally I can read Reddit in each of my washrooms.
I have feed reader apps on my phone, my iPad, my laptop, and my Kindle. Now to actually read all these blog posts ...
Tell me #Fediverse, should I swap a Google Pixel 4a phone for an Apple iPhone 12 mini? #Android vs. #ios.
The Man-running-to work-with-a-briefcase metal statue at the Sarjapur junction makes me feel understood when I pass it by on my way to work. #bangalore
I tried out @elk and I've decided that I'll switch to be as soon as they add support for hashtag and account lists.
I must say, I have an unreasonable amount of excitement for being able to simulate logic gates in a #programming language of my own invention.
Some days I wake up inexplicably #tired even after a full night's sleep. Today is one of those days.
I've got to fix my #bicycle and go for a ride one of these days. The weather has been lovely in #bangalore.
Some interesting #blog posts I read last month: https://notes.abhinavsarkar.net/2023/links-22-12
Spent the day thinking about how to compile my small language with coroutines to Javascript, without actually doing a CPS transform of the AST. I think I may have a solution involving yield* and setImmediate. Proof of concept yet to be done.
I wrote a #blog post about implementing a small interpreted #programming language with #coroutines: https://abhinavsarkar.net/posts/implementing-co-1/
#ProgrammingLanguages #plt #haskell
Last week I spend almost three days to figure out a bug in my code. And the final fix was a single line change. It was both infuriating and exhilarating at the same time. #programming
2022 has not been very good for me in terms of physical activities. Hoping that 2023 will be much better. #running #YearInReview #QuantifiedSelf
I'm so glad I deleted my #Lastpass account years ago when they had their first breaches.
Here's the entire saga of the https://fantastic.earth #Mastodon instance's struggle with disk space, summarized in one image:
#mastoadmin
I've got an estimated billion things to read and instead of actually doing that, I'm here tooting about it. 🤷
#reading #procrastination
I really like reading things on my Kindle. I wish there was an easy way to read all these interesting blog posts on it. Maybe a service to which I can send URLs, or points them to an RSS feed and it sends me a #Kindle book for them.
#reading
Is it me or this year's #AdventOfCode seems too heavy on automata, game plays and simulations? I was hoping for more parser and interpreter related problems.
I wrote a note about patching #Mastodon on #NixOS for removing old user avatars and headers https://notes.abhinavsarkar.net/2022/patching-mastodon
Trying to patch #Mastodon source to get the header and avatar cleanup PR running on my instance. Should not be very difficult with #NixOS. #mastoadmin
It worked! Couldn't figure out how to patch the #NixOS service, so I copied the file, made the change in it, and replaced the service module with the copied one.
#mastoadmin
So tempted to drink 5 cups of #coffee today.
Nobody told me that subscribing to relays will make my server's disk usage rate 10x. Sigh. #mastoadmin
It's finally under getting under control after I reduced the caching time to one day. #mastoadmin
I wrote a new #blog post: Writing a Static Site Generator Using Shake https://abhinavsarkar.net/posts/static-site-generator-using-shake/
The new Arctic Monkeys album is even more mellow than the previous one. Maybe I'll grow to like the new AM, but for now I miss the old one. #Music
TBH, I like the albums in the middle the most, around early 2010s. When they started out to mellow out, but were still Rock like.
@pratul शुभ जन्मदिवस ब्रो
A reminder that you can pull your posts from your #Mastodon server using the RSS feed or the JSON API, and put them on your own website, like I did: https://abhinavsarkar.net/microblog/
I use the bookmarking feature on #Mastodon as a read-later list to mark interesting posts that I want to read in depth, but I can't at the moment while scrolling the timeline. After reading them later, I remove the bookmark. Am I doing it right?
Thinking of doing my next personal project in #Clojure. It's been a while.
I wrote a post about how to populate small #Mastodon Instances using #FakeRelay: https://notes.abhinavsarkar.net/2022/fake-relay
cc @g3rv4@mastodonte.tech #mastoadmin #programming
I'm not doing all of #AdventOfCode this year after doing it for past couple of years. Most of the problems seem very similar to those in previous years. So this time, I'm going to pick only the ones that truly interest me.
Throwback to when I visited the graveyard of chairs. #photography
Moved to @abnv@fantastic.earth.
I've been using https://github.com/pwm/nixkell for managing my #Haskell projects with #Nix, but it doesn't support Nix flakes. So I decided to try out a new template for my new project. I tried https://github.com/input-output-hk/haskell.nix but it started to compile GHC from source, so I ditched it. Now, I'm using https://github.com/srid/haskell-template and it works flawlessly. Well, at least till now. #programming
Finally, the #Mastodon GC and #NixOS GC are freeing up enough disk space to make the server sustainable. #mastoadmin
I solved #AdventOfCode day 7 in #Haskell with parsers, zippers and interpreters, and wrote a note about it: https://notes.abhinavsarkar.net/2022/aoc-7
I'm gonna have to read this multiple times over the next few days to understand it completely, but for now, it sounds awesome: https://ziglang.org/news/goodbye-cpp/
#programming #zig #compilers
Time to catch up with #AdventOfCode problems of this week.
My plan this year was to solve them in #Zig. Unfortunately, Zig 0.10 is not available on #Nix and I was too lazy to install it manually. So I defaulted to #Haskell.
Added a Micro Blog page on my website that syndicates from my #Mastodon toots. https://abhinavsarkar.net/microblog/
#indieweb
Also hooked up IFTTT to hit a webhook to deploy my website when I post a toot here.
Finally a challenge that requires writing an interpreter. Solving #AdventOfCode day 7 will be fun.
Looks like I'll also need to write a parser and use a tree zipper. Great!
Saw someone's toot about trying to learn how to drive a geared car (or drive stick, as they say in USA). And here I am driving a geared car, and hating it, being anxious all the time about missing gear changes and driving in wrong gear. I'd love to not drive stick, but I can't buy a new car right now.
I like solving #AdventOfCode problems with one liners, and I cannot lie (split into multiple lines below for your convenience):
solve n input =
(+ (n - 1))
. fst
. fromJust
. find ((== n) . length . snd)
. zip [1 .. ]
. map nub
. transpose
. map (flip drop input)
$ [0 .. (n - 1)]
Is it just me or 80% of songs in #Spotify's Best of Indie India sounds like Prateek Kuhad songs? WDYT @s3thi?
My website is on #Fediverse now, thanks to https://fed.brid.gy. Follow my blog posts at @abhinavsarkar.net.
Turns out, ChatGPT cannot write quines, at least in Haskell. Quite a serious limitation.
Took my 3am server admin sleep break to drink a cup of water and to ban those DDOSsing domains. #mastoadmin
Finally found time to catch up with my feed reader.
Today's #AdventOfCode was easy in #Haskell:
If you are running a #Mastodon instance, be sure to ban the bad bots using Fail2Ban. Otherwise they'll soak up all your bandwidth by crawling the public assets and media. #mastoadmin
I solved today's #AdventOfCode challenge in type-level #Haskell https://notes.abhinavsarkar.net/2022/type-level-rps. #programming
Construction site #photography
TFW you write #Haskell like C. #AdventOfCode day 2
Is this why people hate using Haskell?
TBH, this is how it looked before I golfed it down:
Upgraded the https://fantastic.earth #mastodon server to #NixOS 22.11. Went without a hitch. Took 12 minutes. #mastoadmin
🤷
Going to try to upgrade my VPS to #NixOS 22.11.
The upgrade to #NixOS 22.11 worked almost smoothly! I had to
— disable a python service because of "infinite recursion encountered" error (I wanted to disable it anyway),
— change config of one service, and
— fix dependencies of two services.
I wrote a note about implementing A* #algorithm in #Haskell https://notes.abhinavsarkar.net/2022/astar
#programming
Advent Of Code '22 Day 1 was easy
Solved in GHCI REPL:
λ> import Data.List.Split (splitWhen)
λ> maximum . map (sum . map read) . splitWhen (== "") . lines <$> readFile "input1"
λ> import Data.List (sortOn)
λ> import Data.Ord (Down(..))
λ> sum . take 3 . sortOn Down . map (sum . map read) . splitWhen (== "") . lines <$> readFile "input1"
@deobald Have you?
I agree that I'm a bit slow at discovering music but you don't have to rub it in #Spotify. #spotifywrapped
TFW you finally delete garbage on a #NixOS machine:
I'm a bit disappointed that the #Matrix hashtag is not about the 90's movie about a speeding bus that could travel in time.
Took this many years ago somewhere in Meghalaya #India. #photography
Wrote some user style #CSS to make my 6 column #mastodon interface look better on small and large displays:
I've found and followed so many interesting people from different walks of life on Mastodon in the last one week. I don't think this would be possible on the Twitter of now.
@Preethi Sup. How's the winter going? Also: https://pruvisto.org/debirdify/
#TIL: Mastodon creates and exposes a public key for each user at <instance-url>/users/<username>.json.
I wonder if that can used for signing things we put on internet.
I hate waking up and finding spam comment on my blog 😠
Today I learned how to replace #NixOS modules: https://gist.github.com/LnL7/bd05394218033cff17ec20eb93a44a4a
A lazy #sunset in #Bangalore. #photo
Just found out about https://fedi.directory. Followed a bunch of interesting people and accounts from there.
@arun Welcome to this earth.
Trying to figure out how to write health checks for #Netdata on #NixOS. Can't find anything on Google. Netdata docs are not straightforward.
@Preethi Welcome to the fantastic earth!
#Mastodon / #fediverse protip for people #selfhosting an Nginx server: add the following line to your Nginx virtual host config so that you can be found by a search like @me@yourdomain.com:
rewrite ^/.well-known/webfinger.* https://<your-mastodon-host>/.well-known/webfinger?resource=acct:<your-username>@<your-mastodon-host>? permanent;
For example, my server at abhinavsarkar.net has this config:
rewrite ^/.well-known/webfinger.* https:// fantastic.earth/.well-known/webfinger?resource=acct:abnv@fantastic.earth? permanent;
(Minus the space after https://. Mastodon converts it to a link so I had to put the space.)
So you can find me in Mastodon search by @me @abhinavsarkar.net
(Minus the space between. Mastodon automatically convert it to the resolved account so I had to put a space between.)
I just moved my #Mastodon account from @abnv@types.pl to @abnv. I can't believe how smooth it was. Took 5 minutes!
Hardest part of #selfhosting is fixing the damned fail2ban that is too eager to ban everyone, including myself. But I wrote those ban rules so I'm the one to blame.
Watching Mastodon Sidekiq logs is a very unhealthy obsession.
Welcome message
@deobald welcome
Got a #Mastodon server up and running in 2 hours with 240 lines of #NixOS code. Nix is amazing!
Code to run Mastodon was only 20 lines. Rest was for system setup and security.
I live on a ball of dirt going really fast around a ball of fire.
So this is what happens behind the scene when you post a toot. All of #fediverse sends requests to your server within seconds. I can imagine why Mastodon instances are so overloaded these days.
Wow. I didn’t expect my post to be on top on https://lobste.rs for 12 hours!
I wrote a note: "Self-hosting GoToSocial on NixOS" https://notes.abhinavsarkar.net/2022/gotosocial-on-nixos
Gonna try to self-host #Pinafore and #GotoSocial on my #NixOS VPS. #selfhosting
#gotosocial on #nixos is happening!
Success! I'm @abnv@abnv.me now, running on #gotosocial on #nixos. Took only 170 line of code.
Holding off moving completely to self-hosted #gotosocial instance till it reaches better feature parity with Mastodon. One thing I'll definitely miss is the Glitch-soc UI.
I've been running Debirdify every day and it's nice to see my following numbers climbing with each day. #mastodonmigration
I hear read that Mastodon supports Markdown
.
I wonder if it can show highlighted code?
main = putStrLn "Hello world"
Well, no code highlighting but at least we got:
- numbered
- lists
- Bullet
- lists
I wrote a note: "Monitoring VPS Network Usage with vnStat and NixOS" https://notes.abhinavsarkar.net/2022/vnstat-dashboard
This Tweag article on staged programming with typeclasses in #Haskell is pretty cool https://tweag.io/blog/2022-11-15-unrolling-with-typeclasses/
My website has been my biggest personal project so far, ongoing for more than five years. It has accumulated so many features by now that I had to make a list today (for mostly myself): https://abhinavsarkar.net/about#features
I knew about #Mastodon for at least a few years but I was afraid that the clients would be unpolished. Now that I'm here, I must say I am pleasantly surprised by how good all Mastodon apps are. Both Android and iOS apps are easy to use and reasonably smooth. Though I don't use the web UI much, it's pretty good as well.
Still trying to get Bridgy Fed working on my website. I can see my website on Mastodon but I don't see any posts, neither am I able to follow it. I guess it's time to look at the Nginx logs.
I uninstalled Reddit, Hacker news and Twitter apps from my phone so Mastodon is my only friend now.
@deobald say something Steven
My levels of yak shaving:
1. Get on Mastodon.
2. Enable Activity Pub for my website using Bridgy Fed.
3. Embed h-card on my website's home page.
4. Add support for transclusion in Markdown files.
5. Modify Mustache templating code to add support for chasing dependencies using Shake build system.
Fortunately, the stack has unwound now, for I am posting this on Mastodon, and my website is Activity Pub enabled.
So I got on Mastodon. Next, find people to follow.