Regrets

Craig Maloney - Tue, 04/11/2017 - 12:18

I try not to dwell on certain decisions that later turn out to be bad moves, but one that keeps popping up is my insistence on putting a hard disk drive on my Atari 800XL computer.

Let me explain.

Putting a hard disk drive (HDD) on my Atari 800XL was not cheap. It was around $800 back in the 1990s (which is around $1,400 in 2017 money). Contrast that with the Amiga 500 which was released in 1987 at around $699 and it seems like putting a lot of money into old technology. And indeed it was. By the time I'd purchased the Black Box, the cables, and the SCSI drive / enclosure (40MB) it was around $800 for the whole kit. But I was bound and determined, as this was running my BBS and other assorted goodies (terminal program, etc.).

So why the regret? Seems like a pretty cool purchase, right?

Unfortunately I was also going into computer science at the time. And the 8 bit processors were rather long in the tooth by the time I was purchasing said HDD kit. The Atari 800XL also didn't have 80 column screens so I had to use a software-emulated terminal in order to connect to the school's VAX and Sun SPARC station computers. And the C compiler that I had purchased (Deep Blue C) was pretty weak in an era where better compilers existed for the IBM compatible machines (and the Amiga).

So my one regret is not taking that money and plopping it into a 16 bit computer. Who knows if it would have changed my course much? Perhaps I wouldn't have been so eager to get onto Linux when I graduated college. But it's something that pops into my mind from time to time.

Categories: LugNut Blogs

Why companies want a convoluted tax system

Craig Maloney - Wed, 04/05/2017 - 15:55

I can see why companies in the "tax preparation" service are reluctant to just let the government figure things out:

  • Fee for the software (because navigating the tax code is for chumps).
  • Fee for the state versions (because just filing federal is for chumps)
  • Fee for e-filing the state version (because the state thinks paper is for chumps).
  • Fee for using a credit card for paying large tax bill (because carrying around a large wad of cash for paying the govt. is for chumps).

No wonder they want lobbyists to ensure that the tax code isn't changed.

Categories: LugNut Blogs

Installing Cisco Packet Tracer on Linux

Ken Leyba's blog - Sun, 04/02/2017 - 03:16
Packet Tracer is a cross-platform visual simulation tool designed by Cisco Systems that allows users to create network topologies and imitate modern computer networks. (1)Packet Tracer was previously not available to everyone, but since version seven, has been available to anyone who creates a Network Academy account. (2)  The software allows you to create virtual networks without the need of physical hardware.  Some of the hardware included are routers, switches, and PC's.

After creating an Network Academy account, you are able to download the software for either 32-bit or 64-bit Linux platforms (Figure 1).  Though the site indicates support for Ubuntu 14.04 64-bit, I was able to install on Linux Mint 18.1 64-bit with no issues.

Figure 1: Linux downloads.


Click on the download for your system, in my case the 64-bit compressed tar archive.  After the download, open the Nemo file manager and right click on the archive, then select Extract Here to un-compress and un-archive to a folder, PacketTracer70.  Navigate into the folder and double click on the install bash script file (Figure 2).

Figure 2: Installation Folder ContentsDouble clicking on the installation file will bring up a dialog box with some options.  Click on Run in Terminal to begin the installation process (Figure 3).

Figure 3: Click on the Run in Terminal button. In the resulting terminal window, you will be asked to accept the EULA (End User License Agreement).  Press the ENTER key to display the EULA, and progress through until the end.  When prompted to accept the EULA, type Y and press the ENTER key (Figure 4).

Figure 4: Accepting the EULA.After accepting the EULA, the installer asks where to install Packet Tracer, press the ENTER key to accept the default /opt/pt directory (Figure 5).

Figure 5: Choosing the installation directory.Since the installation was performed by a regular user and not as root or superuser, the installer cannot install to the /opt directory.  The installer will prompt to install as root using sudo (Figure 6). Type Y then press the ENTER key and then type in your password and press the  ENTER key to continue with the installation.

Figure 6: Prompting for root access.To complete the installation the installer will ask to create a symbolic link to the Packet Tracer executable in the /usr/local/bin directory (Figure 7).  This will allow you to run Packet Tracer using just the executable command (packettacer), rather than the full pathname to the executable (/opt/pt/packettarcer) .  Type Y then press the ENTER key to complete the installation.

Figure 7: Creating a symbolic link to Packet Tracer.To run Packet Tracer as a detached process from the terminal, type packettracer & in a terminal window followed by the ENTER key (Figure 8).

Figure 8: Running Packet TracerUpon first run a dialog box will indicate the default directory where Packet Tracer files will be saved (Figure 9).  You can change this later in the preferences of the application. Click on the OK button.

Figure 9: Default save location.When Packet Tracer is started, you have the option to log in to your Network Academy account to use the full features of Packet Tracer.  If you do not have an account, the second option is to use the Guest Login (Figure 10).

Figure 10: Network Academy login.
Now you can design and test your own network with Packet Tracer (Figure 11).

Figure 11: A running Packet Tracer
1. https://en.wikipedia.org/wiki/Packet_Tracer
2. https://www.netacad.com/about-networking-academy/packet-tracer/

Categories: LugNut Blogs

Try, try again

Craig Maloney - Sat, 04/01/2017 - 00:14

So the "re-reading K&R" book thing got side-tracked again. This time around life happened again and I got side-tracked with the other things that took precedence. But the one thing that I would like to be my constant companion is the willingness to keep trying and keep at things until they work. If nothing else I will be my endless source of amusement.

I haven't completely decided on what I'd like to work on for April. Front-end Development is calling me, but I also want to work more on REST development. Plus I also discovered the Phazer library which looks really cool for developing games. And there's the old stand-by of just letting myself try something small like meditation for 15 minutes a day.

Perhaps the one thing I can work on is just letting myself work on one thing at a time. It's hard to choose when you feel like you need to work on everything at the same time.

Categories: LugNut Blogs

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