I was looking at the some more pythonanywhere docs and came across a way to do an embeddable console. That seemed like an interesting trick, so I put it in a post. Only problem, it doesn’t show up. Instead there is a comment in the generated HTML that says Raw HTML omitted. I did a bit of searching around the Hugo site and found that you can make it work if you add the following to your config.
Read MoreChecking out pythonanywhere
I’m looking into building a simple recommender in Python and was looking for a place to host it. I know I can create a server in Hetzner. That’s easy and pretty flexible but I wanted to try something different. I did some DuckDuckGo searching and found pythonanywhere. They have a free tier and it looked like an interesting platform. I signed up and had the hello world site up in a few minutes.
Read MoreUpdates to harbor theme
As I posted before, I switched my theme over to harbor which I quite like. However, I wanted to make some changes to the look and feel of the page. There is a way of overriding the CSS in a Hugo theme but it wasn’t part of harbor. So, I created an issue on github to see if had just missed the feature. Much to my delight, the author of the theme picked it up and did a change to the theme this weekend so I could do a simple override and change up a few font colors.
Read MoreThe Python Walrus
Python evolves over time. Mostly for the good as it adds features that make things easier and more sensible. One of those is the assignment expression. If you have a C background, you are used to assignment expressions. In C, x = 10 both assigns the value 10 to x and also returns the value 10 so you can use it in logical expressions and the like. In Python, this is not the case.
Read MoreFixed a few things
I listed three things to fix after my theme migration. I added some reasonable text to the about page and found the source of the weird cruft on the last page of posts. It turns out that somehow I had corrupted the text of one of my old posts and substituted the contents of a PNG file. I’m not sure how that happened but the fix was easy: delete it.
Read Moregit submodules
As part of my switch to a new theme, I followed the instructions in the harbor theme to add the theme: $ # install $ mkdir themes $ cd themes $ git submodule add https://github.com/matsuyoshi30/harbor.git harbor That worked and everything was rendering fine using hugo serve on my main system. Sometimes, I use a different system to write posts and I wanted to get the updated code on there. After merging my pull request in github, I ran git pull to get the site updated on my laptop and created a new post.
Read MoreChanging my Hugo Theme
I wanted to change my site theme from Ghostwriter to Harbor. I like the look better and Harbor has a nice search feature which seems useful. I had hoped that this would be simple, but Hugo Themes don’t follow a strict standard for where things go and how they are configured. Instead, I had to move my post files around (restructuring my naming convention at the same time) and redo the config.
Read MoreEl Reg
awk tidbit
I like to take notes in Simplenote to capture the steps I take on any projects that I do. Today, I was doing an install for a little project that I’m working on (which might be a future topic if it comes to anything) and wanted to capture the recent history of the command lines I had used in a format that I could just copy and paste into my notes.
Read MoreBash strict mode
I’d been starting bash scripts with set -euo pipefail. I don’t really know where I got it from but it was something I’d picked up over the years. Aaron Maxwell has an excellent description of how this works and why it is a good idea. I also learned about the Internal File Seperator setting in that blog post and why that is a good idea. Read his excellent post. The net is that you should start your bash scripts with the following:
Read More