Back to healthy behaviors

Yesterday, I ran again for the first time since last Monday, and today I did Yoga again for the first time since last Tuesday. After having injured my back last Tuesday, I had to take a little bit off to recuperate. This was a dangerous proposition, because as I wrote before, it’s exactly this type of situation that raises the risk of me slipping and abandoning my exercise. That’s why I am proud of myself that I made sure to continue, despite those thoughts that said “Maybe take a little time more, just to make sure you’re fully healed.”

My wife, fortunately, trained to be a nurse, and has also learned a lot of massage techniques. She figured out last week that I had just popped a rib, and managed to massage away some of the fluid that was building up. So, I did feel good enough yesterday to run. I was a little concerned during Yoga today, because I worried that I would again overdo it, but I made sure to just stretch gently. After all, it’s not about going to extremes, it’s about doing it.

#RPGaDay2020 3: Thread

RPG-a-Day 2020

I really enjoy it when scenario’s have a rough thread to connect them. Like a good season of Buffy—there’s a set of monster-of-the-week sessions that nonetheless add up to an overall story arc. It’s a type of storytelling I try to strive for, though frequently fail at (I enjoy trying to create, but overall I’m not a very creative person).

Having a monster-of-the-week set of adventures that add up over time makes RPGs low-barrier for me. Too often have I seen campaigns start with the idea of grand epic stories that will span years of storytelling, only to see them peter out as person A can’t make it this week, and person B is going through some things right now, and then the DM just isn’t feeling it next time. That’s just natural. I too at times just don’t feel like it if it’s been a rough week. So having a more loose structure from which larger things may emerge as a backdrop has become my favorite style of storytelling, from both a storyteller as well as a player perspective.

On top of this, my favorite pieces of media right now tend to feature large, epic storylines only in the background. They just form the setting for a much more human and personal story that sits center stage. Novels such as the Witcher series or The Dresden Files, TV shows like Firefly, or videogames like The Last Of Us all make use of this style of storytelling, and each is the more evocative for it. It allows for the allusion of a large, living, breathing world without the responsibility of having to flesh it all out perfectly, while making the actual action relatable. Few of us directly engage with combating late-stage capitalism, but I would imagine many of us at one time or another have dealt with financial pressures.

This is exactly why I enjoy indie RPGs that let us explore human, personal themes, and why I will always recommend RPGs as a means to practice empathy.

#RPGaDay2020 2: Change

RPG-a-Day 2020

My tastes in RPGs sure have changed since those Baldur’s Gate days. I remember that in university, I met a new tabletop group in Groningen. They were people quite different from those I had met before, and as an insecure twenty-something person, I wanted them to like me. The game of choice was D&D (3.5ed by this time), and we were playing in a Forgotten Realms setting. The DM was creative and invested, and combined his interests in history and geography with some storytelling, and that resulted in quite some interesting stories.

Sadly, looking back on those days, there was also a lot of sexism and racism involved. It was that 20-something ironic “joking around with the guys, not hurting anybody” kind of nonsense. We made light of things that in reality not a single one of us had real experience with nor suffered from it. They were jokes that seemed to fit the group culture, but looking back at it they were harmful behaviors. I carry them with me as a reminder of how easily and how quickly we can all fall into harmful behaviors that we, with age, experience, and wisdom can recognize as problematic. I don’t blame them or myself but I do regret having done that.

As time went on, I learned and grew, and also met a new set of people in uni that I admire much to this day. They are open and kind people, who are critical and fairminded. With the first group, I started DMing, but it was with this group that I really learned to enjoy DMing my own material. We explored new types of RPGs, and sometimes we played to squabble amongst ourselves, sometimes we just did fun crazy stuff, and sometimes we explored difficult subjects together. Roleplaying can be a really healthy thing to do with a group, and I’m happy I got to explore that with them.

Now, as we’re all older, we’ve hung out less and less. One in our group moved to the middle of the country, and I mostly had contact with her through the others. The other two live in the city Tracy and I just left, so it’s trickier to meet up with them quickly. However, a little while back we did start up a new Burning Wheel game (my favorite RPG) with the two latter people. It’s a great way to hang out with people, and sometimes it’s easier to just invite people to a game than to say “Hey, I miss hanging out all the time with you all.”

#RPGaDay2020 1: Beginning

Reading the Fublog, I got introduced to the RPG-a-Day writing prompts. It sounded like a really cool idea, so I’ll give it a try! Each day in August 2020, there’s a word prompt to encourage us to create something cool, positive, and awesome about RPGs. As my best creative tool is words, I’ll choose to write some things.

I love that the actual roadmap for this is a hex-grid map. For RPGs with mini-based combat, I do enjoy these.

My first real introduction to RPGs was as a kid with the PC-game Baldur’s Gate. I’d read about it in a magazine, and it seemed amazing! At that time, my father made frequent business trips to America, and he’d always bring each of us kids back a present. So, that time, I asked for a cool RPG. My father went to an American store, and asked what the new cool thing was. Baldur’s Gate had just been released, so naturally the salesman convinced him to get that. When he got back to the Netherlands, I was extatic. Ever since then, I’d been hooked on RPGs in some form or another. I’ve also replayed Baldur’s Gate frequently.

Soon after, D&D 3rd edition became the next big thing in the Netherlands. Fortunately, I had some friends at high school who enjoyed all the nerdy things I did as well, and we invested in a set of D&D 3rd edition books. We played together for years, and had so many wonderful adventures. It wasn’t until we lost touch when we all went to our respective universities that I had a gap in roleplaying.

In one way or another since that first Baldur’s Gate experience, though, I’ve always been finding something to scratch that RPG itch.

Back Problems

On Monday morning, I pulled my back by, well, pulling on my back. Aside from starting running back up, I figured I’d get back into Yoga on my off days. Naturally, I made the same mistake as I did last time I picked Yoga back up. A golden rule in Yoga is that you stretch only as far as is comfortable. That’s not to say you’re not supposed to actually stretch, but that it’s never supposed to be painful. So there I am, with the instruction to touch my knee with the tip of my nose from a three-legged dog position—a thing I used to be able to do with ease. Now, the point is to get some flexibility back and reduce a little ache, so I expected to not be able to do all the things I used to do. However, this one didn’t particularly hurt, so I figured I was fine. I’m stretching my knee to my nose, and can nearly touch it; however, as I turn my head down a little, I hear an audible snap from my back.

Taken from the website https://strengthflexibilityhealtheds.com/three-legged-downward-facing-dog-pose-pocket-yogas-pose-of-the-day/

As you can imagine, I spent most of the Monday having shoots of pain if I moved the wrong way, but thankfully with the care of Tracy I managed to deal with it rather quickly. Tuesday felt a little better but still quite painful. Wednesday, I was a little better still, but still stiff and painful, which, sadly, has meant it was better to skip that run (dangerous territory, there—this is how it starts!). Today, I’m more stiff than painful, fortunately. Not up to one hundred percent, but I also don’t feel as incapacitated as I have. Hopefully, soon, this’ll be no problem at all again.

My First Sed Script (That Became a Bash Script?)

Last post, I wrote about a Sed script I wrote to help me switch configurations. As always, I’ve learned a little in the meantime, and I’ve updated the script to reflect that. As a result, it’s not a Sed script anymore, but a Bash script that calls on Sed directly to perform tasks.

I noticed that I was not being very efficient. For one, I created three files to do something that could be done in one. For another, two of those files (the Sed scripts) were virtually identical, with only two words being changed in four instances. When saw what I had done, I was reminded of a thing I read somewhere, but sadly cannot recall where:

If you’re doing something more than once, you’re not using a computer correctly.

Anonymous?

It’s a little provocative, of course, but I like the central idea of it. A computer is meant to automate tasks, and if you, the human user, are repeatedly performing the same task, surely you should let the computer handle that? Furthermore, there’s an added risk of error: I could edit one file and forget to edit the others to match. Or, of course, were I to write a much, much larger program, copy-pasting the same code only leads to a less legible program in the end.

So, I figured to replace the repeated words with a variable, set in the Bash script, and that reduced the need for two separate Sed scripts. Now that I was down to just the one small script, I realized I could just put it directly in Bash. I would lose the Sed syntax highlighting in Vim (as it would be highlighting Bash), but to be fair the Sed highlights aren’t that great anyway. So, long story short, I ended up with the following, single script:

#!/bin/bash
# switch_config.sj -- Bash script to switch over i3wm configs
# $1 = switch argument

# Check what file to change
case $1 in
    -d|--desktop) to=Desktop
	    	  from=Laptop
		  ;;
    -l|--laptop)  to=Laptop
	    	  from=Desktop
		  ;;
    *) echo "Select either -d, --desktop, -l, or --laptop"; exit 1
	    	  ;;
esac

# Back up file, using \cp to avoid interactive alias
\cp config -f config.old

# Catch potential errors
if [ $# != 1 ]
	then echo "Error: please provide one argument."; exit 1
fi


echo "Swapping i3wm configuration over from $from to $to."

# Using sed, comment out one set, and uncomment the other
sed -i '
/# '"$from"'/,/^$/{
	/# '"$from"'/b
	/^$/b
	/^#/!s/\(.*$\)/\#\1/
}

/# '"$to"'/,/^$/{
	/# '"$to"'/!s/#//
}
' config

My First Sed script

2020.07.22 edit: There’s a followup to this post, that you can read here. It has an updated version of the script.

For the past weeks, I’ve been reading through O’Reilly’s Sed & Awk, 2nd Edition, to learn those powerful commandline tools. The other day, I had a practical problem for which Sed seemed like the perfect solution out of the box. It’s small, and quite trivial, but it made me proud nonetheless.

In brief, the situation I run into is that I run Manjaro Linux using the i3WM windows manager on both my desktop and laptop, and I would like to share configuration files between them; however, due to their different resolutions, I want most but not all settings to be shared. Specifically, I have a few windows I keep on a scratchpad (basically: floating windows that you can hide, as well as keep consistent across workspaces). I still tweak these files every so often as I try to add features I like or adjust the look of this or that. I then share the config file between my two PCs, which leads me to having to adjust a few settings:

 # Laptop configuration
 for_window [class="^popup_term$"] resize set 960 540
 for_window [class="^popup_note$"] resize set 455 758
 bindsym $mod+equal [class="^popup_note$"] scratchpad show, move position 906 5
  
 # Desktop configuration
 #for_window [class="^popup_term$"] resize set 960 540
 #for_window [class="^popup_note$"] resize set 455 1070
 #bindsym $mod+equal [class="^popup_note$"] scratchpad show, move position 2540 324

By the way, you can see the constant tweaks here, because I used to have the popup-term class take different sizes depending on PC or laptop, but I recently settled on using the same resolutions for both. So, that one, for instance, will have to be edited out again into the general settings. The settings above used to be part of those settings, but I split them off to separate the desktop/laptop-specific configurations. Then, using my newly-gained Sed skills I made a tiny script that just comments out one set of code and removes the comments for the other:

# Commands to switch to desktop configuration

# Comment out laptop configurations
/# Laptop/,/^$/{
        /# Laptop/b
        /^$/b
        /^#/!s/\(.*$\)/\#\1/
}

# Uncomment desktop configurations
/# Desktop/,/^$/{
        /# Desktop/!s/#//
}

It’s a fairly straightforward substitution: anything between the start of the Laptop section to the first blank line gets subjected to the code. Using a branch to nowhere (using a branch without a label in Sed means it skips to the end of the script), I make sure to skip the title (I want to keep that a comment), and to skip the blank line (just to keep it looking neat). Then, a basic regex takes every line that doesn’t start with a comment and replaces those lines with a # and the line. Lastly, we do the inverse in the Desktop section: we simply replace the # character with nothing in all lines except the title. Since we’re only removing a character, there’s no need to filter out anything else.

Because I have two scripts, one for the move to desktop and one to laptop, I made a small bash script to switch between them:

#!/bin/bash
# Bash script to switch over i3wm configs

computer=

# Back up file, using \cp to avoid interactive alias
\cp config -f config.old

# Catch potential errors
if [ $# != 1 ]
        then echo "Error: please provide one argument."; exit 1
fi

# Check what file to change
case $1 in
    -d|--desktop) computer=desktop;;
    -l|--laptop) computer=laptop;;
    *) echo "Select either -d, --desktop, -l, or --laptop"; exit 1
esac

echo "Swapping configuration over to $computer."

# Implement the change using sed
if [ $computer == desktop ]
        then sed -i -f desktop.sed config
        else sed -i -f laptop.sed config
fi

This way, I don’t have to take the individual steps myself, and just use the one command to take care of it. Plus, if one day I figure out a way to check if the config file has changed from a previous version, I could use this to automate an adjustment. For now, I’m just happy I figured out a practical means of automating something I used to have to do manually each time I edited the configuration file.

Crimping Cable

Today was another step in the process of making this apartment ours: networking. We have fibre optic internet, so a theoretical 1Gbit network for our ISP; in reality, of course, we get somewhere between 7-800Gbit, but that’s still pretty great. However, up to this point, we had a ratty WiFi connection that only got us about 5-60Mbit—quite unsatisfactory. The harrowing tale of getting the Internet hooked up is for another day (possibly October 31st, given the tale), but for now I’m just happy that the first set is done.

In total, there’s a couple of stages to this project: drawing a cable from the router in the living room to the switch in the living room; installing an ethernet wall outlet there; drawing it through the bedroom, installing outlets on the other side; installing the office switch and hooking up the PCs; and, finally, drawing a cable from the living room switch to the media player switch, and connecting all the Internet media to that switch.

Now, to be clear: I’ve never done something like this before in my life. That is to say, I’ve built a network out of switches and cables, but all the cables were pre-cut, and I never put in a wall outlet before. So, today was a fun experience learning a new skill. I crimped a single cat6 cable, quite nervous about making mistakes (as the videos on it always emphasize how you need to push the cables through, and if you have a slight issue here or there, you’ll lose out on performance!). Fortunately, cutting it down to size was a breeze with the kit I bought, and crimping a new connector on it turned out to be the simplest thing ever. In fact, tacking the cable to the plinth in the living room turned out to be more of a challenge than crimping that cable was!

It’s the first of many cables, so I’m looking forward to continuing the process over the next week.

Gross Keyboard Cleaning

Every now and then, you just need to really clean your keyboard. I snack at my desk (something I really shouldn’t do with a mechanical keyboard), so every once in a while mine really needs a clean. I figured at least some of you must like watching gross stuff like this, right? In case you’re creeped out by that, just go ahead and skip this one, because there’s pictures. Lots of them.

Second Run

This morning was a bit of a victory. Just yesterday I posted that I usually ended up quitting running due to excuses. Well, last night, I could not get a wink of sleep for some reason. Well, probably around three or four hours of restless sleep, in the end, but I didn’t fall asleep until 3am. So, as you will imagine, I woke up rather tired. On top of that, as I look outside, I notice that it’s raining steadily with no sign of letting up any time soon. What a recipe for failing before I even start. So, I doubled down and told myself: Mondays, Wednesdays, and Fridays—just go out and run. And run I did. You know, running in the rain isn’t as bad as it seems. Above all, though, it made me proud of having made that choice.