Re-reading K&R

Craig Maloney - Wed, 03/01/2017 - 12:57

I think for the month of March I'm going to try an experiment. Something that I've long wanted to do, but something that has gone by the wayside more often than not.

I'm going to read through Kernighan and Ritchie's classic book "The C Programming Language".

I liken this to reading books when you're younger vs. when you're older. "The Lord of the Rings" is a great example of this. When I read it as a youngster it was a mystical and fanciful world. When I re-read it (around the time of the movies) it started off mystical and fanciful but with my older eyes I could see things I'd missed before. I'd missed what Tom Bombadil represented (though I still do not care for that character in the slightest). I'd missed that the over-arching theme is that the world of magic is still dying, and that the quest of the ring was whether it ended in fire or in quiet contemplation.

So what does this have to do with K&R?

First off it's a classic text of programming. You can't mention the C language without someone piping up "K&R". As I mentioned in the last post there's also a certain comfort in hanging around in the C language. Plus I've never read the book all the way through. Something always happened to keep me from reading the book and I feel that I've done it a disservice by not making my way through all of the pages. Plus I'm not the same programmer that I was back then. I've grown with wisdom and I understand more of how computers work. Granted the version of C they present is not modern C, but I have other books to help me make that transition. And GCC / GDB are much better tools than when I last played with them.

How far will I get? Who can say? But I feel like I have to try.

Categories: LugNut Blogs

Comfort Code

Craig Maloney - Sun, 02/19/2017 - 22:37

Last week I found myself doing something I haven't done in a while.

For some reason I got it in my head that I needed some comfort. And part of that comfort was re-learning the C language. Now, I have no immediate reason to learn C. None of my job prospects seem to want C (at least not at the dabbler level) but here I was pulling out my C books to give it a whirl again.

Part of the reason is because there was a sense of comfort to me in sitting with just a compiler and a debugger looking at code flying by. I wasn't doing anything strenuous (just some Fibonacci sequences, or variable passing) but watching gdb change values and looking at the stack frame gave me a sense that I was in control. That I was changing something.

Too often I think developers sit back and take code for granted. Not that our thoughts become code without effort (Lord knows there's a handful of developers who have ever had something work the first time without wondering what the hell went wrong). No, I mean that we just assume that the building blocks that we piece together will always work and we won't have to think too deeply about what goes on under the abstraction layers. I think pulling back the abstractions and peeking in to see what's happening can be a comforting experience. It's a gentle reminder that no matter how convoluted the outside world gets that we have the ability to pause and see that there are still some rules that apply. That there are places where we can derive joy from seeing an integer variable increment from a 1 to a 2.

Maybe I'm crazy for finding comfort in this, but I can't deny that it works.

Categories: LugNut Blogs

Writing a Snake Game in Pygame

Craig Maloney - Fri, 02/10/2017 - 11:32

I'm mulling over making a quick series on how to write a "snake" game in Pygame. Part of this is because I've been stalled on writing this down in the book about Pygame and game development / design and I'm thinking this may be an approach to uncork the bottle of inspiration. Because writing in the book? That's hard. But writing a blog post? That's simple, right? (Don't answer that; I don't want smarter me to wake up and say they're the same thing. :) ).

Categories: LugNut Blogs

Cleaning up the blog a bit

Craig Maloney - Fri, 02/10/2017 - 09:12

I realized the blog was getting a bit crusty around here, so I cleaned up a few pages. I've put as many of the MUG presentation videos as I could up in the projects page, and added the slides for the Penguicon Presentations from 2015 / 2016. I'm probably going to update a few more of the pages because they really don't make sense for the current layout. (Breaking links? That's why I'm here. :) )

Also added some scripts that I use in my daily GTD / todotxt routine into a github repo so if you want to play with them you're welcome to them.

As always, if something doesn't look right please let me know. I probably missed a few things along the way.

Categories: LugNut Blogs

Upgraded to Pelican 3.7.1

Craig Maloney - Mon, 01/23/2017 - 19:44

Finally upgraded to Pelican 3.7.1. Had a few issues related to summary fields in the feeds. If something doesn't look right please let me know. Thanks!

Categories: LugNut Blogs

Pepper & Carrot, Rea, and Fate-based Magic

Craig Maloney - Sat, 01/21/2017 - 12:36

One of the issues I've had with working on the Fate-based version of Pepper & Carrot is how the magic system works. Magic in Pepper & Carrot is manifested in potions and spells (moreso potions than spells, but that's another story). So in the case of episode 20 there is no show of preparing the potions: potions just happen, and the story moves from there. The only time we ever see Pepper preparing potions is in episode 1 and episode 4 (and to a certain extent episode 2 and episode 3). The group makes potions in episode 9. We also see the efforts of making way too many potions in episode 12 and Pepper working on her potions classes in episode 14. In each of these cases there's very little in the way of showing how Pepper and the rest of the cast manifest the magic into making these potions. They just do it and the story continues. Even in cases where she casts spells there are few details on how Pepper summons up the strength to cast powerful spells (episode 18 shows this in more detail).

In an earlier incarnation of the Pepper & Carrot wiki it mentioned Rea hand how Rea worked inside the universe. Rea is short for "reality" and witches could use Rea to bend reality to their will. It defined Rea as something that a magic-user would need to cast spells. Rea could be acquired by putting effort toward working on a task, or could be purchased through potions and other materials. The wiki specifically stated that it was a unit that could be measured, so you could tell how much Rea a person had. It sort of worked for the fiction, but it didn't set well with me. And when it came time to put that into game terms it made even less sense. Was there going to be a box for "Rea" that someone would need to track? Potions to recover Rea? Costs for casting different spells? How many points would one need to create the black hole in episode 12? How much Rea would one need to make any of the spells in episode 11 work?

The more I thought about it the more I didn't like where I was headed with tracking Rea. What started as an integral part of the characters looked like it could turn into a mess.

A recent article by Johan Herrmann did some digging to the Rea concept. It tried to make sense of Rea in more scientific terms, and gave David and I some food for thought on what Rea really is.

One of the thoughts that percolated was the idea of Rea being something that you're just aware of. I compared it with caffeine. Most folks know when they've had enough caffeine (headaches if you haven't had enough, jitters if you've had too much). But few folks really pay attention at the milligram level to see how much they've ingested. (There are some who do, but most folks aren't as mindful of their consumption. I know I'm not as mindful as I should be.) So if we take the caffeine metaphor and extrapolate it to the Witches of Hereva we start to see where we can mold it to the fiction. Witches in Hereva instinctually know when they are running out of Rea and do what is necessary to fix the issue. Much like the gravitational pull of coffee for me in the morning, a Witch of Hereva would know when they need to come up with more Rea.

How does this work in the game then? Instead of Rea being a number or a box that requires a statistic it then becomes a complication that can be pulled out (either on a bad roll, or when the GM wishes to extract a fate point from the character). It becomes a story beat that characters become aware of when it makes sense to the story. Picture a grand battle where the cast of Pepper & Carrot are up against some big baddie. They're firing off spells, consuming potions, and wreaking havoc. And then the thrilling climax comes along where Pepper is about to deal the fatal blow to the big baddie. Everyone is waiting for the conclusion to this battle.

Which is more appropriate? Looking at the character sheet and realizing you have a 0 in your Rea stat? That's boring. There's no drama in that. You're just left with "I can't cast any more spells because my Rea is at 0". What's more exciting is casting the spell, rolling the dice, and having to take a complication "Running out of Rea". Because in the fiction when the Chaosah Witches ran out of Rea at the end of The Great War really bad things happened.

The other problem with defining Rea as a unit is the underlying metaphor of Rea. Rea is akin to shaping our own reality through effort, emotional engagement, and love for one another. Rea is generated every time David completes an episode of Pepper & Carrot. Rea happens when the translators translate the episodes into a myriad of languages. Rea is in the people engaging with the comic; coming up with new games, fan artwork, and theories about how the whole thing works together. It's a disservice to Rea to make it a simple stat on a character sheet.

After some discussion I re-wrote the page for Rea in the Pepper & Carrot Wiki. I'm sure it'll need some more clarification as the episodes progress but I'm happier with where it is. I also think it makes for more interesting stories to put Rea more into the underlying fabric of the universe rather than something that needs active tracking. And it's also opened up how I can think about Rea in the Pepper & Carrot Fate-based game. Now the only thing keeping players from casting amazing spells and producing potent potions is dice rolls, aspects, and Gm discretion. That's more in-line with the fiction of Pepper & Carrot and the underlying philosophy of the comic and the comic-making process.

I can't wait to write this up in the game itself, but I wanted to get some of the underlying ideas out so I had a record of them to re-read and understand.

(Pepper & Carrot and the Hereva universe: created by David Revoy, with contributions by Craig Maloney. Corrections: Willem Sonke, Moini, Hali, Cgand and Alex Gryson. Artwork: David Revoy. Released under a Creative Commons Attribution, CC-By license. This article and the ideas in it are released under the same license as Pepper & Carrot / The Hereva Universe.)

Categories: LugNut Blogs

Pepper & Carrot, Rea, and Fate-based Magic

Craig Maloney - Sat, 01/21/2017 - 12:36

One of the issues I've had with working on the Fate-based version of Pepper & Carrot is how the magic system works. Magic in Pepper & Carrot is manifested in potions and spells (moreso potions than spells, but that's another story). So in the case of episode 20 there is no show of preparing the potions: potions just happen, and the story moves from there. The only time we ever see Pepper preparing potions is in episode 1 and episode 4 (and to a certain extent episode 2 and episode 3). The group makes potions in episode 9. We also see the efforts of making way too many potions in episode 12 and Pepper working on her potions classes in episode 14. In each of these cases there's very little in the way of showing how Pepper and the rest of the cast manifest the magic into making these potions. They just do it and the story continues. Even in cases where she casts spells there are few details on how Pepper summons up the strength to cast powerful spells (episode 18 shows this in more detail).

In an earlier incarnation of the Pepper & Carrot wiki it mentioned Rea hand how Rea worked inside the universe. Rea is short for "reality" and witches could use Rea to bend reality to their will. It defined Rea as something that a magic-user would need to cast spells. Rea could be acquired by putting effort toward working on a task, or could be purchased through potions and other materials. The wiki specifically stated that it was a unit that could be measured, so you could tell how much Rea a person had. It sort of worked for the fiction, but it didn't set well with me. And when it came time to put that into game terms it made even less sense. Was there going to be a box for "Rea" that someone would need to track? Potions to recover Rea? Costs for casting different spells? How many points would one need to create the black hole in episode 12? How much Rea would one need to make any of the spells in episode 11 work?

The more I thought about it the more I didn't like where I was headed with tracking Rea. What started as an integral part of the characters looked like it could turn into a mess.

A recent article by Johan Herrmann did some digging to the Rea concept. It tried to make sense of Rea in more scientific terms, and gave David and I some food for thought on what Rea really is.

One of the thoughts that percolated was the idea of Rea being something that you're just aware of. I compared it with caffeine. Most folks know when they've had enough caffeine (headaches if you haven't had enough, jitters if you've had too much). But few folks really pay attention at the milligram level to see how much they've ingested. (There are some who do, but most folks aren't as mindful of their consumption. I know I'm not as mindful as I should be.) So if we take the caffeine metaphor and extrapolate it to the Witches of Hereva we start to see where we can mold it to the fiction. Witches in Hereva instinctually know when they are running out of Rea and do what is necessary to fix the issue. Much like the gravitational pull of coffee for me in the morning, a Witch of Hereva would know when they need to come up with more Rea.

How does this work in the game then? Instead of Rea being a number or a box that requires a statistic it then becomes a complication that can be pulled out (either on a bad roll, or when the GM wishes to extract a fate point from the character). It becomes a story beat that characters become aware of when it makes sense to the story. Picture a grand battle where the cast of Pepper & Carrot are up against some big baddie. They're firing off spells, consuming potions, and wreaking havoc. And then the thrilling climax comes along where Pepper is about to deal the fatal blow to the big baddie. Everyone is waiting for the conclusion to this battle.

Which is more appropriate? Looking at the character sheet and realizing you have a 0 in your Rea stat? That's boring. There's no drama in that. You're just left with "I can't cast any more spells because my Rea is at 0". What's more exciting is casting the spell, rolling the dice, and having to take a complication "Running out of Rea". Because in the fiction when the Chaosah Witches ran out of Rea at the end of The Great War really bad things happened.

The other problem with defining Rea as a unit is the underlying metaphor of Rea. Rea is akin to shaping our own reality through effort, emotional engagement, and love for one another. Rea is generated every time David completes an episode of Pepper & Carrot. Rea happens when the translators translate the episodes into a myriad of languages. Rea is in the people engaging with the comic; coming up with new games, fan artwork, and theories about how the whole thing works together. It's a disservice to Rea to make it a simple stat on a character sheet.

After some discussion I re-wrote the page for Rea in the Pepper & Carrot Wiki. I'm sure it'll need some more clarification as the episodes progress but I'm happier with where it is. I also think it makes for more interesting stories to put Rea more into the underlying fabric of the universe rather than something that needs active tracking. And it's also opened up how I can think about Rea in the Pepper & Carrot Fate-based game. Now the only thing keeping players from casting amazing spells and producing potent potions is dice rolls, aspects, and Gm discretion. That's more in-line with the fiction of Pepper & Carrot and the underlying philosophy of the comic and the comic-making process.

I can't wait to write this up in the game itself, but I wanted to get some of the underlying ideas out so I had a record of them to re-read and understand.

(Pepper & Carrot and the Hereva universe: created by David Revoy, with contributions by Craig Maloney. Corrections: Willem Sonke, Moini, Hali, Cgand and Alex Gryson. Artwork: David Revoy. Released under a Creative Commons Attribution, CC-By license. This article and the ideas in it are released under the same license as Pepper & Carrot / The Hereva Universe.)

Categories: LugNut Blogs

Learning Challenge: Addendum

Craig Maloney - Sat, 01/21/2017 - 11:15

Last night I was looking for some details on Z80 assembly and I decided to look at my blog. (Surely there was somewhere that I had a screenshot of a safe memory location for ORG). As I wandered through my previous learning challenges I noticed a pattern:

  • I had a tendency to abandon them about mid-month because something came up that I felt was more important to work on.
  • I think I've only finished one of them (Z80 Assembly).
  • The unprocrastination challenge sort of drifted into the miasma of being laid off.

I was a little surprised by these results. Surely I had to have some success somewhere. Yes, but not quite as much as I'd thought. The blog entries showed my thoughts at the time and most of them said the same thing: something else came up that circumvented what I was doing.

Part of this is my natural desire to have several large projects running at the same time. Currently I have projects for learning JavaScript better, writing the Fate-based Pepper&Carrot RPG, updating the license extraction script for Open Metalcast, and finishing up the release of the Pygame Photobooth. I'd be happy as hell to count any one of those projects as complete, but right now they all have some equal precedence. And my reasons for finishing each of them are pretty much as equally valid:

  • I want to learn JavaScript and front-end web development better so I can expand my work options.
  • I want to finish up the Fate-based Pepper&Carrot RPG so folks can play around in this magical and wonderful world.
  • I want to finish up the Open Metalcast license extraction script so it pulls out the license information quicker so I don't have to hunt for it as much.
  • I want to add the finishing touches to the Pygame Photobooth so others can use it better.

There's also other projects that I have that I consciously moved to my Someday / Maybe list because I know that I won't have a chance to work on them in the upcoming weeks.

Reading through those learning challenge posts reminded me that I've been noodling around with the Pepper&Carrot RPG for a while now. At the time I thought this was something that I could whip out in a few months. I was a tad mistaken in that assessment, but it also got me working on the Pepper&Carrot Wiki and got me involved in some of the world-building of Hereva. So I'm getting there, but a lot slower than I would have liked.

So what have I learned from this? I've learned a few things:

  • I need to not worry so much about working on one thing at a time for one month. It's rare that I can concentrate an entire month on something without wondering why I'm not working on the other things.
  • I need to do the work with no expectations. I recently re-read "The Effortless Life" by Leo Babauta. In there he talks about living a life without expectations. I can't know what I want to work on later this evening, so rather than try to force the issue I'm trying a tactic of just showing up and seeing what I'm passionate about working on.

I may do learning challenges in the future, but I'm also not going to get upset with myself if they don't pan out. I'm human, and my inclinations change from moment to moment. Learning is a process, and learning is also about changing behaviors. I'm working on being more mindful of what my mind is telling me and recognize the difference between procrastination and "I'm just not interested in this anymore".

At the very least I'm going to keep on being a practicing human being. I'm planning on documenting my progress here so others can see. Who knows who might be reading this late one night?

Categories: LugNut Blogs

Learning Challenge: Addendum

Craig Maloney - Sat, 01/21/2017 - 11:15

Last night I was looking for some details on Z80 assembly and I decided to look at my blog. (Surely there was somewhere that I had a screenshot of a safe memory location for ORG). As I wandered through my previous learning challenges I noticed a pattern:

  • I had a tendency to abandon them about mid-month because something came up that I felt was more important to work on.
  • I think I've only finished one of them (Z80 Assembly).
  • The unprocrastination challenge sort of drifted into the miasma of being laid off.

I was a little surprised by these results. Surely I had to have some success somewhere. Yes, but not quite as much as I'd thought. The blog entries showed my thoughts at the time and most of them said the same thing: something else came up that circumvented what I was doing.

Part of this is my natural desire to have several large projects running at the same time. Currently I have projects for learning JavaScript better, writing the Fate-based Pepper&Carrot RPG, updating the license extraction script for Open Metalcast, and finishing up the release of the Pygame Photobooth. I'd be happy as hell to count any one of those projects as complete, but right now they all have some equal precedence. And my reasons for finishing each of them are pretty much as equally valid:

  • I want to learn JavaScript and front-end web development better so I can expand my work options.
  • I want to finish up the Fate-based Pepper&Carrot RPG so folks can play around in this magical and wonderful world.
  • I want to finish up the Open Metalcast license extraction script so it pulls out the license information quicker so I don't have to hunt for it as much.
  • I want to add the finishing touches to the Pygame Photobooth so others can use it better.

There's also other projects that I have that I consciously moved to my Someday / Maybe list because I know that I won't have a chance to work on them in the upcoming weeks.

Reading through those learning challenge posts reminded me that I've been noodling around with the Pepper&Carrot RPG for a while now. At the time I thought this was something that I could whip out in a few months. I was a tad mistaken in that assessment, but it also got me working on the Pepper&Carrot Wiki and got me involved in some of the world-building of Hereva. So I'm getting there, but a lot slower than I would have liked.

So what have I learned from this? I've learned a few things:

  • I need to not worry so much about working on one thing at a time for one month. It's rare that I can concentrate an entire month on something without wondering why I'm not working on the other things.
  • I need to do the work with no expectations. I recently re-read "The Effortless Life" by Leo Babauta. In there he talks about living a life without expectations. I can't know what I want to work on later this evening, so rather than try to force the issue I'm trying a tactic of just showing up and seeing what I'm passionate about working on.

I may do learning challenges in the future, but I'm also not going to get upset with myself if they don't pan out. I'm human, and my inclinations change from moment to moment. Learning is a process, and learning is also about changing behaviors. I'm working on being more mindful of what my mind is telling me and recognize the difference between procrastination and "I'm just not interested in this anymore".

At the very least I'm going to keep on being a practicing human being. I'm planning on documenting my progress here so others can see. Who knows who might be reading this late one night?

Categories: LugNut Blogs

What about plan C?

Craig Maloney - Wed, 01/18/2017 - 07:26

With the closing of The Ringling Bros. and Barnum & Bailey Circus it appears my backup plan of running away to join the circus is less of a viable option.

Categories: LugNut Blogs

What about plan C?

Craig Maloney - Wed, 01/18/2017 - 07:26

With the closing of The Ringling Bros. and Barnum & Bailey Circus it appears my backup plan of running away to join the circus is less of a viable option.

Categories: LugNut Blogs

mismatch_cnt, RAID1, and a clever fix

Craig Maloney - Tue, 01/03/2017 - 15:55

This past weekend my computer showed an ominous error:

Jan 1 04:06:16 lister mdadm[8317]: RebuildFinished event detected on md device /dev/md/0, component device mismatches found: 9856 (on raid level 1)

Huh, that doesn't look particularly good. Mismatches between drives tend to lead to bad things.

Once the original panic subsided I checked online.

please explain mismatch_cnt so I can sleep better at night seemed promising for an explanation of what was going on. I read through this. "Aha! Swap files cause this problem!" I exclaimed to myself. "That has to be the culprit".

Except my machine didn't have a swap file on a RAID1 device.

Shoot. That would have been an easy explanation.

Much like looking up symptoms online the more I searched the more my heart sank. Data corruption seemed the most obvious cause.

I checked the SMART data on all of the drives. Nothing looked amiss there.

I re-ran the checks:

echo check > /sys/block/md0/md/sync_action

and ran:

watch cat /sys/block/md0/md/mismatch_cnt

My heart sank as I watched the counter tick up and up.

So I pulled out my copy of Spinrite and ran a read-test on all of my drives. Spinrite said there was nothing wrong with the hardware. So it had to be something up with the software RAID1 itself.

I kept reading that the problem could one of two issues. Either: 1) there was a memory-mapped file that wasn't in sync between the drives, or 2) the free space between the drives didn't 100% match. I was still holding out that it wasn't 3) corrupted data.

At this point I could have done:

echo repair > /sys/block/md0/md/sync_action

but that thought scared me. I had one of the drives on this machine corrupt a Virtualbox instance before when I mirrored the bitmaps between them (one drive had issues, and suddenly both copies of the file had issues). Add to that the somewhat scary notion that it was anyone's guess which mismatch would become the canonical version. That path seemed a certain way to ensure something got corrupted.

I'm not currently able to find the exact article but someone mentioned that one way to test to see if it's the free space of the RAID is to do a dd if=/dev/zero of=foo bs=8K and just let it fill up the disk. The reasoning is that the free space will be reclaimed and will be set to a known quantity.

Note: If you decide to do this make sure that you do this in single-user mode (shutdown now) rather than with a running system. Filling up a filesystem while things are running can make your machine very cranky.

So I ran dd if=/dev/zero of=foo bs=8K as root and let it fill up the remaining space on the disk. I then ran sync;sync;sync to make sure everything was synchronized before removing the file (and re-running the sync;sync;sync command again.

I booted the machine into multi-user mode and re-ran the scrubbing check. I kept an eye on the progress and the mismatch_cnt variable.

When it kept at a steady 0 count I breathed a sigh of relief.

Moral of the story: The free space on RAID1 can get out of sync (especially if there's a power outage or if you have memory-mapped files like swap files). You can do a "repair" on it, but you might run into corruption if the mismatches are pointing to real data. You may want to instead create a known-good file in the free-space of the drive and see if that clears it out.

Hope this helps someone else who runs into this. If I re-run into the original article that mentioned this nugget I'll update with a link.

Categories: LugNut Blogs

mismatch_cnt, RAID1, and a clever fix

Craig Maloney - Tue, 01/03/2017 - 15:55

This past weekend my computer showed an ominous error:

Jan 1 04:06:16 lister mdadm[8317]: RebuildFinished event detected on md device /dev/md/0, component device mismatches found: 9856 (on raid level 1)

Huh, that doesn't look particularly good. Mismatches between drives tend to lead to bad things.

Once the original panic subsided I checked online.

please explain mismatch_cnt so I can sleep better at night seemed promising for an explanation of what was going on. I read through this. "Aha! Swap files cause this problem!" I exclaimed to myself. "That has to be the culprit".

Except my machine didn't have a swap file on a RAID1 device.

Shoot. That would have been an easy explanation.

Much like looking up symptoms online the more I searched the more my heart sank. Data corruption seemed the most obvious cause.

I checked the SMART data on all of the drives. Nothing looked amiss there.

I re-ran the checks:

echo check > /sys/block/md0/md/sync_action

and ran:

watch cat /sys/block/md0/md/mismatch_cnt

My heart sank as I watched the counter tick up and up.

So I pulled out my copy of Spinrite and ran a read-test on all of my drives. Spinrite said there was nothing wrong with the hardware. So it had to be something up with the software RAID1 itself.

I kept reading that the problem could one of two issues. Either: 1) there was a memory-mapped file that wasn't in sync between the drives, or 2) the free space between the drives didn't 100% match. I was still holding out that it wasn't 3) corrupted data.

At this point I could have done:

echo repair > /sys/block/md0/md/sync_action

but that thought scared me. I had one of the drives on this machine corrupt a Virtualbox instance before when I mirrored the bitmaps between them (one drive had issues, and suddenly both copies of the file had issues). Add to that the somewhat scary notion that it was anyone's guess which mismatch would become the canonical version. That path seemed a certain way to ensure something got corrupted.

I'm not currently able to find the exact article but someone mentioned that one way to test to see if it's the free space of the RAID is to do a dd if=/dev/zero of=foo bs=8K and just let it fill up the disk. The reasoning is that the free space will be reclaimed and will be set to a known quantity.

Note: If you decide to do this make sure that you do this in single-user mode (shutdown now) rather than with a running system. Filling up a filesystem while things are running can make your machine very cranky.

So I ran dd if=/dev/zero of=foo bs=8K as root and let it fill up the remaining space on the disk. I then ran sync;sync;sync to make sure everything was synchronized before removing the file (and re-running the sync;sync;sync command again.

I booted the machine into multi-user mode and re-ran the scrubbing check. I kept an eye on the progress and the mismatch_cnt variable.

When it kept at a steady 0 count I breathed a sigh of relief.

Moral of the story: The free space on RAID1 can get out of sync (especially if there's a power outage or if you have memory-mapped files like swap files). You can do a "repair" on it, but you might run into corruption if the mismatches are pointing to real data. You may want to instead create a known-good file in the free-space of the drive and see if that clears it out.

Hope this helps someone else who runs into this. If I re-run into the original article that mentioned this nugget I'll update with a link.

Categories: LugNut Blogs

War of Ashes: Fate of Agaptus

Craig Maloney - Thu, 12/29/2016 - 11:47

  • Title: "War of Ashes: Fate of Agaptus"
  • Game Creators: Sophie Lagacé, Karen Twelves, Mike Olson, Edmund Metheny, and Sean Nittner
  • Publisher: Evil Hat Productions
  • System: Fate Accelerated

It's taken me way too long to write up a review of War of Ashes: Fate of Agaptus. I've wanted to write the perfect review, detailing just how much I love this game. I wanted to show just how much thought and world-building this book has in it, and how the different factions / characters in this book blend together to make an interesting, "lived-in" world.

I may still write that review at some point: poring over each and every page, detailing what I found interesting.

But I'll sum it up as best I can:

"This is the book I wish I'd wrote."

Not that I feel the authors did a disservice to the material that only I can fix; I mean that I wish that games that I wrote even approached how wonderful this book is.

The source material for this book is the miniatures game "War of Ashes" by Zombiesmith games. Generally speaking miniatures games don't put a whole lot of depth into their characters. Sure they may have some backstories and motivations, but the objects of those games is to annihilate the opposing forces.

What "War of Ashes: Fate of Agaptus" does that is so brilliant is it takes what is ostensibly a hack-and-slash game and transforms it into a living world. And the world they present is a fascinating world.

Each "race" believes different things about their pantheon of gods. The Elvorix believe in many gods, the Vidaar believe in one god, and the Jaarl ignore their gods. (The Kuld believe in a diffuse, impersonal universal force). While on the surface that feels a bit trite, the interactions between the gods and the races is what really shines in this book. There are certain gods for which the Elvorix do not want to draw attetion. Agaptus, the God of Sky and Stars, is a bit heavy-handed whenever he arrives, so the priests do things like burn smelly incensei, and make the temples and themselves unattractive to keep the god away. The Vidaar have one god: Akka -Maas, which the Elvorix claim is another name for Agaptus and which the Vidaar vehemently deny. It's writing like this that breathes life into the world and makes for interesting interactions between characters.

Apart from religion each society has their own ways of thinking and behaving. While they share some similarities there is enough differences between them to make for interesting interactions for characters. The world feels lived in, with reasons for each of the factions to live, work, and behave the way they do. And all throughout the book there are seeds and ideas that give direction for what sorts of adventures the characters could have.

The book is written in the perspective of an in-world historian, along with conversations between her and other in-world participants, gives a unique flavor to each of the races and how they interact and interpret the events in the world.

I won't go too in depth about the system itself. Suffice to say it's a stand-alone version of Fate Accelerated that I am looking at carefully for my own designs. :)

And the artwork. I really love the artwork and the style of this book.

In short I think "War of Ashes: Fate of Agaptus" is an excellent book, and I hold it as a standard for what I want to achieve with my own writing and design. It builds a world, shows how to best participate in it, and creates interesting obstacles for the characters to interact. I would see small skirmishes in this world, and epic campaigns. It has depth and mythology that make sense, and draws out a sense of humor that fits the characters and setting.

Highly recommended.

Categories: LugNut Blogs

War of Ashes: Fate of Agaptus

Craig Maloney - Thu, 12/29/2016 - 11:47

  • Title: "War of Ashes: Fate of Agaptus"
  • Game Creators: Sophie Lagacé, Karen Twelves, Mike Olson, Edmund Metheny, and Sean Nittner
  • Publisher: Evil Hat Productions
  • System: Fate Accelerated

It's taken me way too long to write up a review of War of Ashes: Fate of Agaptus. I've wanted to write the perfect review, detailing just how much I love this game. I wanted to show just how much thought and world-building this book has in it, and how the different factions / characters in this book blend together to make an interesting, "lived-in" world.

I may still write that review at some point: poring over each and every page, detailing what I found interesting.

But I'll sum it up as best I can:

"This is the book I wish I'd wrote."

Not that I feel the authors did a disservice to the material that only I can fix; I mean that I wish that games that I wrote even approached how wonderful this book is.

The source material for this book is the miniatures game "War of Ashes" by Zombiesmith games. Generally speaking miniatures games don't put a whole lot of depth into their characters. Sure they may have some backstories and motivations, but the objects of those games is to annihilate the opposing forces.

What "War of Ashes: Fate of Agaptus" does that is so brilliant is it takes what is ostensibly a hack-and-slash game and transforms it into a living world. And the world they present is a fascinating world.

Each "race" believes different things about their pantheon of gods. The Elvorix believe in many gods, the Vidaar believe in one god, and the Jaarl ignore their gods. (The Kuld believe in a diffuse, impersonal universal force). While on the surface that feels a bit trite, the interactions between the gods and the races is what really shines in this book. There are certain gods for which the Elvorix do not want to draw attetion. Agaptus, the God of Sky and Stars, is a bit heavy-handed whenever he arrives, so the priests do things like burn smelly incensei, and make the temples and themselves unattractive to keep the god away. The Vidaar have one god: Akka -Maas, which the Elvorix claim is another name for Agaptus and which the Vidaar vehemently deny. It's writing like this that breathes life into the world and makes for interesting interactions between characters.

Apart from religion each society has their own ways of thinking and behaving. While they share some similarities there is enough differences between them to make for interesting interactions for characters. The world feels lived in, with reasons for each of the factions to live, work, and behave the way they do. And all throughout the book there are seeds and ideas that give direction for what sorts of adventures the characters could have.

The book is written in the perspective of an in-world historian, along with conversations between her and other in-world participants, gives a unique flavor to each of the races and how they interact and interpret the events in the world.

I won't go too in depth about the system itself. Suffice to say it's a stand-alone version of Fate Accelerated that I am looking at carefully for my own designs. :)

And the artwork. I really love the artwork and the style of this book.

In short I think "War of Ashes: Fate of Agaptus" is an excellent book, and I hold it as a standard for what I want to achieve with my own writing and design. It builds a world, shows how to best participate in it, and creates interesting obstacles for the characters to interact. I would see small skirmishes in this world, and epic campaigns. It has depth and mythology that make sense, and draws out a sense of humor that fits the characters and setting.

Highly recommended.

Categories: LugNut Blogs

Stupid JavaScript Tricks

Craig Maloney - Wed, 12/28/2016 - 20:15
> bar = ['width', 'height'] [ 'width', 'height' ] > bar [ 'width', 'height' ] // Nothing up my sleeve > bar.indexOf['length'] 1 // Presto!

In case you haven't guessed what's up here: JavaScript automatically surfaces a value called 'length' in all arrays. So you can get the length of bar by typing bar.length and bar['length'].

Categories: LugNut Blogs

Stupid JavaScript Tricks

Craig Maloney - Wed, 12/28/2016 - 20:15
> bar = ['width', 'height'] [ 'width', 'height' ] > bar [ 'width', 'height' ] // Nothing up my sleeve > bar.indexOf['length'] 1 // Presto!

In case you haven't guessed what's up here: JavaScript automatically surfaces a value called 'length' in all arrays. So you can get the length of bar by typing bar.length and bar['length'].

Categories: LugNut Blogs

Habit tracking: Shaving

Craig Maloney - Mon, 12/26/2016 - 11:25

I've been quietly implementing a new habit for myself. As part of the Habit Guide from Zen Habits I've decided to start with a ridiculously small habit in order to get myself back into the habit of making good habits. (Play along at home with the "Craig says 'habit"" game: take a drink whenever this post says habit.)

That habit? Shaving.

Now you may think "that habit has a natural trigger, doesn't it? If you look like a mountain-man, then you need to shave, right?" Yes, but I decided on this habit for the following reasons:

  • I grow facial hair like a pre-pubescent boy (it takes me a week to get to "mostly stubble")
  • It has an easy trigger (I see the razor, and three-minutes-later I have a clean face).
  • It has a positive effect (I have a shaved face).

Is it a major, life-changing habit? Hardly. Most folks won't even notice the effects. But the benefits for me are making a habit that I can see results. I'm already 35% through in tracking the habit via Loop Tracker and I'm seeing progress. That's the real reason for doing this.

I'll add different habits in the near future. But for now I'm going to enjoy a clean-shaven (or some facsimile thereof) and see where this leads.

(And yes, it hasn't escaped me that someone could call this yak shaving. I'm OK with shaving this yak. :)

Categories: LugNut Blogs

Habit tracking: Shaving

Craig Maloney - Mon, 12/26/2016 - 11:25

I've been quietly implementing a new habit for myself. As part of the Habit Guide from Zen Habits I've decided to start with a ridiculously small habit in order to get myself back into the habit of making good habits. (Play along at home with the "Craig says 'habit"" game: take a drink whenever this post says habit.)

That habit? Shaving.

Now you may think "that habit has a natural trigger, doesn't it? If you look like a mountain-man, then you need to shave, right?" Yes, but I decided on this habit for the following reasons:

  • I grow facial hair like a pre-pubescent boy (it takes me a week to get to "mostly stubble")
  • It has an easy trigger (I see the razor, and three-minutes-later I have a clean face).
  • It has a positive effect (I have a shaved face).

Is it a major, life-changing habit? Hardly. Most folks won't even notice the effects. But the benefits for me are making a habit that I can see results. I'm already 35% through in tracking the habit via Loop Tracker and I'm seeing progress. That's the real reason for doing this.

I'll add different habits in the near future. But for now I'm going to enjoy a clean-shaven (or some facsimile thereof) and see where this leads.

(And yes, it hasn't escaped me that someone could call this yak shaving. I'm OK with shaving this yak. :)

Categories: LugNut Blogs

Happy Holidays and Merry Christmas

Craig Maloney - Thu, 12/22/2016 - 21:21

Wishing you and yours the best of the holiday season.

2016 Holidays by David Revoy (src CC-BY 4.0)

Categories: LugNut Blogs

Pages