-
Mar 1, 2025
Python script failing via cron
The issue
I had setup a cron task to run my Squirrel Archiver script once per day, but for some reason the task was not executing. Nothing, including any errors, was showing up in any logs. At first I thought there was something wrong with my crontab, but other scripts set up to run in the same way were running without issue.
Copying the commands in crontab to the terminal and running it manually worked. It was only when cron was triggering the run that it failed.
Just to be sure, I changed my script to just
print('hey')
, and this worked! So there must have been something wrong inside the script, and I started the tried and true debugging process of deleting chunks of code until something works.Side note: Since the script had to run via cron, while I was debugging it was set to run once per minute on the dot. I had to rush to make changes in time, but I also had to wait to see results, which made for an interesting experience.
The culprit
I had been declaring
openai_client = OpenAI()
as a global variable, outside of any function. This worked fine when running the script manually, but when cron triggered it, it failed silently.“Why?”
I have no idea.“Is initializing objects outside of functions commonly known to be a bad practice?”
Probably.I wish I knew more about the reasons, but moving the declaration inside a function fixed the issue.
So, maybe to many it is obvious that “yes of course you shouldn’t do that”, but I’m recording it here in case anybody else out there is like me.
What I'm doing /now
Personal Life
Nothing much has changed for our family these past few years, and that is by design. Work is stable, life is stable, everybody is happy. I am very thankful for that.
Work
Since 2022 I have been leading a department that is tasked with making the company better at creating new games. This involves encouraging all staff to submit game ideas at any time, working with people to strengthen game ideas and create attractive pitches, coaching teams through early development phases, maintaining a corporate strategy for the release of new games, and more. It allows me to work directly with a lot of people throughout the company, and has been tremendously fun.
Hobbies
In 2022 I joined a Haiku study group. We decide on a few prompts every month and submit our poems in advance of a meet-up, where we comment on each other’s pieces and have our teacher critique them. Haiku is fascinating because its extreme minimalism (only 17 characters allowed) makes it feel like putting together a puzzle. It is also a great way to learn about nature and Japanese culture.
Last year I set up GoToSocial as a solo instance to join the Fediverse, and that has been a lot of fun. It’s nice to be social on the internet again. I think this has helped motivate me to update this site more, and I’m having a lot of fun making little updates to the site as well.
AI tools have been super useful for programming as a hobby. It has made it so much easier to finish and ship my little projects, and I have already developed a slew of little utilities that I use often. I’m still writing words by hand though, because I think being able to organize my thoughts into communicative sentences is such an important skill.
I also started keeping a physical journal at the beginning of this year, and one month is the longest I have ever kept up the habit so I am hopeful that it will continue. I had always admired people who keep physical journals; I thought it was a wonderful habit. I never could get into it though, and had resigned myself to thinking that I just wasn’t that kind of person. But my wife convinced me that if that is the kind of person I want to be, then it’s worth putting in the effort to make the change.
So far, I am really enjoying it. I’m using the most simple interpretation of Bullet Journal. It’s turning to be a super helpful framework to guide the kinds of information I should keep, and the format for recording it.
Katamari Damacy postmortem
https://www.gamedeveloper.com/design/postmortem-the-singular-design-of-namco-s-katamari-damacy-2004-By Game Developer Magazine:
We recently received a request to publish the Katamari Damacy postmortem from the December 2004 issue of Game Developer. It has been posted here in full for the first time in 2024 to celebrate the game’s 20 year anniversary. Please enjoy.
This article was written by the game’s director, Keita Takahashi, and has been translated into English from the original Japanese. I wish I could find the original text, but this is a great read regardless.
It’s easy to take a successful game and say “Here are its unique features and the reasons why we think they led to success.” But this portmortem also includes regrets from the game’s development, which gives a really rare, close look into what the team’s ambitions were and how they thought about the game’s design.
Feb 8, 2025
CrossPooter - Poot your toots around the web
CrossPooter logo, showing a smiling cartoon face among arrows branching away CrossPooter is a simple script for personal use, that reads the RSS feed of this website and posts the latest article to GoToSocial and Bluesky. It was inspired by EchoFeed, but I wanted to try my hand at making something similar myself.
You can see the source code here.
Features
CrossPooter reads the RSS feed of this website and checks if the latest article has been posted yet. If not, it will grab the article’s OpenGraph tags to construct a post.
The post will include a link to the article, the article’s title, and the article’s description. It will also attach an image if one is available.
The script is inteded to be run via cron every hour or so. I’m assuming that I won’t be posting new articles faster than that, so the script only checks the latest article.
Things I learned building this
Bluesky was very straightforward since I just used the official python sdk. GoToSocial probably would have worked with the Maston library, but the API was simple enough that I wanted to try just sending HTTP requests.
I’m still very inexperienced when it comes to creating complex HTTP requests, so I stumbled a lot with setting the correct headers and formatting the data in the correct way. But it was a good exercise in reading source code and documentation, and now I have a stronger handle on how to do it.
Good grief, I thought this was The Onion.
Google removes pledge to not use AI for weapons from website
https://techcrunch.com/2025/02/04/google-removes-pledge-to-not-use-ai-for-weapons-from-website/Feb 5, 2025
The geometric nests of the white-spotted pufferfish
The white-spotted pufferfish, or Amami hoshizora fugu, is a species of pufferfish newly discovered in 2014 near Japan’s Amami-Oshima Island. The males spend roughly a week constructing an elaborate circular nest about 2 meters in diameter to attract females.
Divers had known about these structures that appear in early summer every year, but apparently it took a while to catch the fish in action.
The circular nest of the white-spotted pufferfish
So the latest Stormlight Archive book is apparently the last of its arc, so I guess I will read it after all.
And I don’t remember what’s been happening at all, so I guess I will go read all five of them now…Feb 2, 2025
Hobbies that I am no good at
A distinguished actor appeared on TV and talked about their love for juggling. They had taken lessons at various times and always sets aside time to practice because they enjoy it so much. They then recounted how they recently met their juggling teacher of ~10 years past, displayed their current juggling skills, and was met with astonishment at how they had not improved one bit in all that time!
It was a funny story, but what struck me was just how nice it was that juggling was a constant source of enjoyment for this person despite apparently being no good at it. That’s a hard thing to do.
I think that the internet is partly to blame, since the entire world’s top talent is now at our fingertips. It is too easy to see the best of the best, compare ourselves to them, and end up thinking, “Well what is the point of me doing this at all, then?”
But we must allow ourselves to enjoy things, even in the face of our clear mediocrity. Is there anything I enjoy doing – and let myself enjoy – that I am not good at? Am I denying myself of any hobbies just because of a lack of skill? Let’s dig in.
Hobby: Web development
This one is tricky, because I used to be decent at it but am now well behind the curve. I can slap together some HTML + CSS + JavaScript and make an OK web page. I was adept at Ruby on Rails 10 years ago and can still fuddle through making a web app.
But I touched python for the first time last year. I used Docker for basically the first time last year. I have no idea how to fix a Linux server when things don’t go exactly according to Getting Started guides. I have never touched a JavaScript framework. I have a small comfort-zone and am totally lost outside of it.
These things don’t bother me though, because I enjoy the time I spend tinkering. Occasionally I decide I want to try something new, and I stumble and fumble my through it and maybe learn a little along the way. This is possibly the only creative activity that I can enjoy in a pure, for the love of the craft kind of way. I like that.
Not-yet-a-Hobby: Drawing
Sometimes I get a hankering to draw a picture, and I always enjoy the time I spend doing it. But I am not a good artist. I’m especially terrible at drawing faces. Awful.
I can’t call it a hobby, since I rarely make time to draw. I have a suspicion that I would enjoy it if I let myself, and that the main thing holding me back is that I think I’m no good at it.
Hobby: Haiku
A few years ago I developed an interest in Haiku. The hyper-minimal structure makes it so that changing just one preposition, or modifying the word order a little, can have a huge impact on the poem’s overall meaning and impact. I think that’s fascinating.
I was lucky to find a group of people that meet regularly for Haiku. We decide on a few prompts, spend a month writing 3 Haiku each, and come together to comment on each other’s pieces and have our teacher critique us.
I think that I’m not bad at Haiku, but to be honest, I thought that I would’ve gotten a little better at it by now. This isn’t discouraging though, as I find myself not really caring how skillful I am. The exercise of distilling a scene to its barest core and painting its picture with my words is fun. I feel like there are some low-hanging fruits for improvement if I put more effort into study, but I’m pretty happy just puttering along at my own pace.