Categories
Uncategorized

Auto-Bookmark Posting

Linkding

It’s been a while since I posted about bookmarks. Remember del.icio.us? (or Delicious?) How about Ma.gnolia? Scuttle? Oh, Pinboard!

I quit using Pinboard in 2025. Not because it’s bad, in fact, it was quite good! But it seemed like it lost some of the “network effect” that it once had when all my pals used it. I think they also started asking for money, so instead of continuing to use it while not paying (or paying) I moved to a self-hosted solution, which I’ve wanted to do for a long time.

Linkding does pretty much all I need/wait it to do, and it runs on my own server!

Linkding also has an API, and since I’m always messing around with Python. Remember when I made some Mastodon bots?

Well, I had this idea. A new bot that would post one bookmark per day to a Mastodon account. Along the way I abandoned the ides of a new account and decided to just post them to my own account, each night around midnight.

Bookmarks on Mastodon

You can see them all with the bookmarks tag.

Back to the Python! I wrote a script that pulls the most recent 100 bookmarks from Linkding and sticks them in a SQLite database. The data from Linkding is a JSON feed, which I’ve never worked with before in Python, but it was fairly simple. I’m not sure if I’ve use SQLite with Python either, but I did that too!

There is a second script that posts to Mastodon. It’s similar to the bot scripts I wrote before, except (again) it works with SQLite. After it posts a bookmark it will set a flag so that we won’t post it again.

My code isn’t perfect, but it works. I didn’t use any AI or LLMs to create it, I read the docs and looked at examples. I probably won’t release it, but who knows?

Anyway, it was a fun project for me, sometimes someone will like or reply to one of my bookmark posts, and I get to see an old(er) bookmark I created. Win-Win all around!

Categories
Uncategorized

milesBiked – A Bar Graph Generator

In a previous post titled Miles Biked (so far)… I talked about generating bar graphs to show how many miles I biked. And in the post before that I suggested you Share Your Code. So this post is the logical conclusion.

You can find milesBiked on Codeberg, a community-led platform that offers Git hosting and other services for free and open source projects. Codeberg is a non-profit organization based in Berlin, Germany, that respects privacy, supports the commons and celebrates creativity.

When I posted about blogNag – A Blog Post Reminder I decided I should try to do more to share the code I write. It’s not amazing, it’s not worthy of praise, but it’s code that works for me, solves a problem, and others might be able to use it to learn from. In the age of AI, LLMs, and “vibe coding” I think this is important.

In a world where so many applications are subscription-based, or the free version has limitation that can only be unlocked by paying, releasing free software and open source software to the world can be seen as an act of resistance… or rebellion, even.

Code given freely is a gift to the world. I expect no remuneration for the code I share. Save it for larger projects with more impact. I donate to a number of larger software projects that I use all the time. Inkscape, OpenSCAD, CryptPad, and others… Tools I use almost daily that have allowed me to escape restrictive commercial software. Send your money where it will help the most.

Right, so I learned a bit about Matplotlib and used my basic Python skills to write about 25 lines of code… but I stand on the shoulders of giants. Those who created Python, who documented it, the Matplotlib authors, and the people who wrote articles, blog posts, forum posts, and tutorials with example code that made it all very easy for me.

Good software isn’t created in a void… and it’s not created by telling a machine what you want your code to do. It’s created by people like you. Let’s all work together to make a better world.

Categories
Uncategorized

Miles Biked (so far)…

I managed to bike over 500 miles in 2024 and I wrote a post about it. In that post I used screen shots from RunGap which is a great mobile app that imports data from the Apple Fitness stats captured by my watch and phone.

I don’t love the screen shot thing so I figured I should work on some code to make my own bar graphs. I used Matplotlib for Python to do the heavy lifting here. Matplotlib is complex and powerful so I really just started by ducking for python bar graph and found a few pages with examples and started there.

Also, I can’t decide if this post is about Bikes or Python, so it will be both.

After riding 600 miles in 2024 and seeing that I barely rode in four of those months (due to weather, travel, being sick, etc) I set a goal of 1,000 miles for 2025. This works out to about 84 miles each month, or just under 3 miles per day. I figured I could ride 5 miles most days, and double that on a weekend day. So even if I just rode weekends and got about 20 miles per weekend I’d be most of the way there.

I should mention that years ago I would have never imagined trying to bike 1,000 miles in a year. But I guess it’s not too different from walking. I think I did just a few rides in 2024 that were over 10 miles but that’s a regular thing for me now on weekend days.

Here’s my progress for 2025 so far – 569.58 miles. You’ll see April was a bit lower, which was due to work travel. I did also travel in May but I worked overtime to make up for it before and after my trip. I don’t have any other travel planned for this year, and hopefully I can avoid injuries and sickness. I should easily hit 600 before the end of the month, which is the halfway point for the year so… on track!

There’s a lot more data in RunGap, and I can access it via the SQLite database the app uses, so I may try to pull data directly from that, and maybe add in some graphs for other things, like hours biked, etc. And yes, many of the miles during the colder (or rainy) months were indoors on the trainer (Dana’s bike!) but I definitely prefer to get outside and ride when I can.

So here’s to more miles on the bike and more lines of code to create graphs!

See Also: milesBiked – A Bar Graph Generator

Categories
Uncategorized

BearExporter

Codeberg release

I released the code for a Python script called BearExporter over on Codeberg.

It’s a Python script to export all of your Bear notes to Markdown files you can use with Obsidian, read in the terminal, or whatever. I originally started on this when I started using the MintBook and realized I did not have a good way of seeing any of my notes from a Linux computer.

And yes, you can export your notes in plenty of other ways, the idea with this script is that you can automate/schedule it to run whenever you want, as often as you want, for up-to-date files wherever you might need them.

As the old saying goes “it works for me!” but I know it’s not amazingly well-written code, but it is available. I’m not exactly skilled at Python but I’ll try to improve it as time allows.

The README file probably goes way too in-depth about all the shortcomings. There are times I’m proud of the code I write, and then there are times I get something to (barely) work for me and figure others might find a use for it.

I originally tried this bear_backup script but it wasn’t what I was after. But maybe it’s what you need? I should probably steal/borrow a few ideas from it to enhance my code.

Anyway, enjoy the code, use it ignore it, improve it, or tell me what to do better. :)

Categories
Uncategorized

blogNag – A Blog Post Reminder

I recently released blogNag which is a Python script I run once per day via a cron job to notify me how long it has been (in days or hours) since I last wrote a post on this blog. This forces me to think “Hmm, I should write another post…”, thus promoting a cycle of continuous blogging.

I remember back around 2000 so some bloggers had this idea to “bug” each other if they didn’t post for a while. This is the modern day version of that, since most of the 2000 bloggers have stopped long ago. ;p

It uses feedparser and I remember having some issues getting that installed in the past so I set up a virtualenv for Python. I had these two links for notes: venv — Creation of virtual environments and How to Set Up a Virtual Environment in Python – And Why It’s Useful

My short version for setting up a venv since I will probably forget by the time I need to do it again…

mkdir blogNag
python3 -m venv ./blogNag
cd blogNag
./bin/pip3 install feedparser
# now we can run
./bin/python3 ./blogNag.py

Look, I’m not great at Python but It Works For Me.

Also, this is on Codeberg because I don’t plan on putting any of my personal work on GitHub in the future if I can avoid it. (Microsoft acquired GitHub and I prefer not to support them if possible. Others can make their own choices in the matter, and I will try not to judge.)

You’ll probably want to change the code to look for your own feed and do your own notification thing… Again, it works for me, YMMV and all that. Enjoy!