How to Interview


A couple weeks ago I wrote about resumes. The obvious follow up is about interviews. Again, this post reflects my own experiences and opinions, not any official policies or procedures of my company.

I’ve done more technical interviews in the last few years than I could count. But I’m not going to talk about technical interviews here. What I’ve been doing for the past month or so is the initial screening calls, where I just have a conversation with the person, do introductions, ask some general questions about background, skills, likes, dislikes, experience, etc. It’s been a really nice break from the tech interviews. And I’ve learned so much from doing these.

Like resumes, there’s no real magic in passing these interviews. But there are all kinds of things that you can do really easy to mess it up and ruin any chance of going further in the process. We go into interviews with the principle of “start with yes.” We start with the idea that we’re going to hire you, and it’s up to you to convince us not to do so. Sadly, people are really good at convincing people not to hire them.

The way I do these screening interviews is I give a quick introduction to myself, my background and what I do now. 30-45 seconds max. Then I invite the person to do the same. I figure they’ll kind of mirror what I did and give a brief intro. It’s probably more important for them to tell me about themselves than vice versa, so they usually go a bit longer than I do – maybe a minute or two. But some people go on and on and on, giving me a life history, every job they had, everything they did and every technology they used in every job. Some people just take control of the interview. I don’t encourage them to do so, but I don’t try too hard to stop them either. How they relate with me in the interview is probably how they’re going to relate to their coworkers on the job. It tells me a lot.

Generally though, people don’t screw that part up too badly. They might talk a bit much, but I’ll attribute that to nerves. No problem.

Then I get to my first question.

What interested you in this position?

It might sound harsh, but 10-20% of candidates blow the interview right then and there. Some of the worst answers I’ve had, but which I hear surprisingly often:

  • I’m just applying to every front end job I see.
  • I don’t remember.
  • I just need a job.

If that’s how someone answers my first question, and they just leave it at that, I’m done. I’ll go through the rest of the interview, but unless they do something amazing, I’m totally checked out and my mind is made up. If that’s the level of effort someone puts into getting a job, I have no interest in finding out how much effort they’ll put into doing that job if they get it.

Table stakes for this kind of question is something how it’s a great match for your skill set, the tech stack, etc. You haven’t particularly impressed me with that, but you haven’t annoyed either.

Even better is, “I really like the idea of your business and what you’re doing…” or a personal anecdote that shows some connection with you and the business.

Then there’s the really good ones. “Well, I was reading on your site about how recently you…” or “I was doing some research and read about your partnership with…” Yes! This person spent a few minutes reading our site, or did a Google search and read something and remembered it. You’re interested in us. Now I’m interested in you.

Tell me about your current or most recent job.

And what you do / did there. What you liked / didn’t like there. Interesting things you worked on, etc.

It’s hard to screw this part of the interview up. I think the only way you can really destroy this part is by being totally bored. “I built some apps,” kind of answer. Or you could totally trash your previous company. Surprisingly few people actually do that though.

This part of the interview is a good place to make some points though. Talk about a really cool project you got to work on and tell me how interesting it was and what the challenges were and what you learned doing it. As you are talking about your last company in the past, I’m envisioning you working at our company in the future. What are you going to be like? Are you going to be into your job and get excited about challenges? Or are you going to be bored and lifeless?

What are your strengths (and weaknesses)?

To be honest, this part is like a well choreographed dance. You’re going to state some strengths whether they’re true or not. Then when I ask about you’re weaknesses, you’ll reiterate those strengths as “weaknesses”.

“It’s a double edged sword…”

“Attention to detail, but I sometimes get too caught up in making things perfect.”

Or a million variations.

If you have less experience, you’re going to tell me that you’re a fast learner.

Of course not everyone plays along. Someone recently told me that one of their weaknesses was that they were a slow learner. I was stunned. Nobody ever said that in an interview, ever. Everyone says they’re a fast learner in an interview.

Sometimes more senior developers have just gotten beyond that game and will just flat out tell me what they are good at and what they are not so good at. It’s refreshing.

Usually, I don’t get too much out of this question anyway. So play along or be honest. But not too honest. 🙂

What are you looking for in your next job?

Worst answer: parrot back the job title you are interviewing for, or the tech stack.

What are you looking for? A front end React position.

No kidding. I want to know what you are hoping for, what you are envisioning.

Less experienced developers will very often talk about learning, mentorship, growth, etc. More senior candidates will talk about taking on more responsibility, new challenges, and also growth.

I think the learning and mentorship answer from newer candidates is fine. But way too many candidates go too deep on this theme, mentioning it several times throughout the interview. Again, it’s not horrible. If you’re junior, we’ll definitely be mentoring you, and helping you learn and grow. But even if you’re junior, I want to know what you are going to bring to the table. You could earn some points here by talking about how you want to take on responsibility, contribute to the team, mentor people with less experience than you, or whatever value you think you can offer.

What questions do you have for me?

This question forms a pair of bookends with the first question. If you really don’t want the job, just say, “none.” You won’t get the job. If you want the job, ask at least 3-4 good questions. The more, the better, but don’t go over schedule. Like the first question, it shows that you are interested and prepared. One good example a few people have asked:

“I saw that your competitors are companies X, Y, and Z. How do you differentiate yourself from them?” Great again because it shows you prepared and have an interest in the company.

Almost everyone asks about the tech stack we use. But some follow that up by asking why we chose that tech stack, are we happy with it, do we think we’ll be changing it, and why / why not? That shows interest.

Sometimes I get quirky questions like, “tell me one fact about the company that I couldn’t find on Google.” I actually had fun answering that one, but it didn’t particularly do anything about my feelings for the candidate. It was just a gimmicky question and it felt like it came from some article like “10 quirky questions to ask to nail that job interview.”

I won’t give any more examples, as this is not a list of questions to ask article.


A huge part of passing a screening interview is showing interest in the company, interest in the job, interest in your career, interest in your previous work. The more interest you show, the more the interviewer is going to be interested in you. Well, maybe it’s better to say that the less interest you show, the less interest the interviewer will be interested in you. Hopefully they are starting from yes. Don’t push them towards no.

Skill and experience don’t have much of a part at this stage. I’ve already seen your resume. We’ll do some technical interviews later to see if you actually know how to do what you say you know how to do. Of course, sometimes the resume is inflated and that becomes obvious on the screen, but that is not very common.

Do some research, show some interest. If you aren’t interested, why are you applying for this job anyway?

Introducing “version”


Yesterday I picked up a book on a writing compilers and interpreters. This particular book’s code is written in Java. It’s been a while since I’ve coded in Java and I had no idea what Java dev tools I had on my system. So I created a simple hello world Java class and ran javac and java main and got the result I was hoping for. Yay! Then I figured I’d check what version of Java I had installed. So I did what I thought was obvious:

java -v

Unrecognized option. Oh, I know some language uses a capital V instead. Must be Java.

java -V

Nope. OK. I guess I just have to use the long version.

java --version

No luck. All right. We’ll just start going through every possible iteration…

java --Version
java -Version
java -version

Finally! That last one told me I had version 1.8.0_262.

It got me thinking that finding the version of various tools and programs is something you have to do now and then and I rarely get it right on the first try. Some other examples:

gcc --version
node -v
python -V
perl -v
go version
lua -v
rustc --version

Then I got to thinking that it would be pretty easy to write a utility script to capture a bunch of this stuff. Here’s the meat of what I did, just capturing a few of the above examples:

case $1 in
    $1 -version

gcc | rustc)
    $1 --version

node | perl | lua)
    $1 -v


I fleshed it out a bit, added a bunch more programs to it, threw it up on github and tweeted about it. I’ve already had a couple of PRs adding additional tools to it. Hoping to get some more. As of this writing, it can recognize 36 different programs. It checks to see if you have the program installed at all before trying to find its version, and displays a message if it doesn’t yet know about the program you are checking. Also supports a -h version for help, -c to display the count of how many programs it recognizes, and of course -v for displaying its own version.

And yes, it can be used to check its own version “recursively”!

version version

If it sounds useful, grab it here:

Just put the version script somewhere in your path and you should be good to go. You can add whatever other tools you use to pretty easily. If you do, I’d love to know about them, either through a PR or just let me know the tool and how you find the version.

I’ve only actually tested it on a couple of Linux machines. It should work on Mac as well, but I’ve got to put in the time to test it later today.

How to Resume


Note 1: You can spell it “resume”, “resumé” or “résumé”. I’m going to go accent-less.

Note 2: This article represents my own views and experiences and is no way meant to represent the views, policies or practices of my company.


My company,, found itself well positioned in an environment where suddenly people want to do transactions on line rather than in person. Our traffic and business has increased massively in the past few months and we’ve attracted the attention of a lot of big companies that want to work with us. We’re building all kinds of new things to accommodate this new surge and we need new engineers.

Thus, I’ve been interviewing a lot of candidates lately, and looking at hundreds and hundreds of resumes. You may have heard things about how hiring managers spend so many seconds looking at a resume before making a decision. I’m here to tell you that this is absolutely true. When you have 30 resumes to get through and you have a half hour between meetings with plenty of other projects vying for that time, you learn to judge a resume quickly.

I know there are plenty of people out there on the other end of this process, so I wanted to share some of what I go through, and maybe it will help you in your job search. I hope that none of the examples come off as too demeaning, snarky or fun-poking. I’m just trying to point out some pitfalls to avoid and give you examples of why certain things are really bad.

First let me say that there is no magic resume trick that will guarantee you an interview. And there isn’t some special specific thing that all hiring personnel are looking for in a resume. What I’m looking for is a person who fits the qualifications we are looking for. That is obviously going to be different from company to company, and is even going to vary at different periods within a single company. Sometimes I might be looking for a senior engineer to fill a particular role. Other times I might be fine with hiring a more junior person or even someone right out of school. In the past we were only looking for local candidates in Boston. Now we are totally open to remote engineers.

So, while there is no magic trick that will automatically get your foot in the door, there are plenty of things you can do wrong that will annoy the person looking at your resume and get it rejected even though you might actually be a good fit.

Hiring managers are looking for specific things

When someone is looking at a resume, there’s a list of things they are trying to find out right off the bat to see if you are someone they should interview. If they can find that information quickly and easily, then they can make an informed, logical decision. If they can’t find that info, they’re going to start making guesses. And since you just made their job just a little bit harder, there’s a good chance they’re going to be just a little bit biased against you when they start making those guesses.

So rule number one of writing a resume is:

Don’t make the reviewer guess about anything. Make it easy for them to find out what they are looking for.

I swear to you, when I read a resume that gives me all the info I need up front, I silently thank the candidate. In fact, if I’m alone in the room I might even verbally thank them. I may not decide to interview them because they may not fit what I’m looking for in this round. But… if they fall into that maybe category, the fact that they made my job easy will nudge me towards bringing them in.

So, what am I looking for? Obviously, this will be different for different companies and different hiring managers, but I’ll tell you what it is for me. And it’s surprisingly little. Remember, I’m trying to get through it as quickly as possible.

1. Where are you located?

I don’t need to know your full address, or even necessarily your city. But are you local? In a different time zone? In a different country? Back when we were only looking for local candidates, this was a huge annoyance. It’s shocking how many people don’t put any kind of location at all on their resume. Sometimes you can get a hint by their phone area code if they give it, or the location of their previous jobs, but in the end, you are left making a guess. If I absolutely have to hire a local candidate, am I going to schedule a 30 minute screening call with you to find out where you live? Chances are I’m going to guess you’re not local and move on.

As I said, currently we are hiring remote engineers, but I still want to know roughly where you live. And I can only hire people who live in the US, so I really need to know at least that much.

2. What is your work history?

Where do you work now, or where was your last job? How long did you work there? What was your role there? What did you work with and what technologies did you use? And the same for your last few relevant jobs. This can be really brief.

Big Mega Corp, Senior Software Engineer, Jan 2017 – Present
Developed and maintained features on the Big Mega site and web apps. Used React, Typescript, GraphQL and Apollo. Was the tech lead for a team of 5 engineers.

This is beautiful. It tells me everything I need to know. You might want to pad it out a little bit, but not a whole lot more than that. Don’t list every thing you ever did over the whole time you worked for the company. Nobody’s going to read all that.

If you have any major holes in your work history, it’s nice to account for them. Not a deal breaker, but someone’s going to ask you eventually, so you should have an answer ready.

If you’ve held at least one or two jobs that are relevant to the position you are applying for, only list those relevant jobs. I really don’t care about your cashier or security guard or dog walking experience if you are already an experienced software developer. If you are straight out of school and are looking for your first role in a new career, then, yeah, list other jobs you’ve had that show you can actually hold a job and haven’t just been leeching off your parents for your entire life. 🙂

3. What technologies do you know?

Somewhere in a sidebar or something, list the technologies that you are experienced with. Keep this high level and don’t get too hung up on any kind of experience rating system. If I’m looking for someone who knows Ruby on Rails and right there at the top of the list is Ruby on Rails, you’re getting an interview (assuming everything else listed here checks out).

If Rails is two-thirds down a list of 87 different technologies, programs, platforms, languages, tools and frameworks, I’m going to think, “They don’t really know Rails. They just used it once.”

Of course, don’t lie. You’re going to get caught. And you won’t get the job.

DON’T make this a wall of acronyms. A dozen or so high level items is great. Languages, frameworks, high level technologies. “React, GraphQL, Apollo, TypsScript, Ruby on Rails, Postgres SQL, Redis, AWS, Heroku” and you’ve won me over. I don’t need to know what editor or IDE or shell you use, or what OSes you like or what phone you use. I don’t care that you have used Microsoft Office or Photoshop or Gmail, Chrome, Firefox or Internet Explorer 9. I saw a resume recently that listed every CSS property the person had experience with. Literally. It was several lines of, “CSS color, CSS fonts, CSS padding, CSS margins, CSS borders, CSS spacing, …”. Don’t do that.

4. What education do you have?

To be honest, if a candidate has more than a couple of years of experience in the field, I personally don’t pay much attention at all to their education. Of course some companies require degrees, and other hiring managers might be more hung up on this, so you should definitely put it down, but IMO it should come below any relevant job experience.

I’ve seen some candidates with 10-20 or more years of engineering experience listing their GPA, dean’s list status, academic achievements, from the 1990s. Totally irrelevant as far as I’m concerned.

If you are right out of school and looking for an entry level position, that’s a whole different story. In that case, your education is one of your big selling points, along with any personal and school projects and internships and coops you might have done.

5. What is your work authorization status?

This is a sensitive one because it can start to get mixed up with bias and exclusion and discrimination. But the bottom line is, a company needs to know that it can legally hire you.

If you’re a citizen or have a green card or some kind of visa that means you can start work tomorrow, let them know that up front. If you need visa sponsorship or transfer, that’s also important. Some companies may not be able to accommodate that, but hiding that fact and bringing it up at the last minute isn’t going to change that situation.

Other tips

Show, don’t tell.

“I’m a fast learner, a hard worker, super responsible and get along great with people.” This is like a sign that says, “Best pizza in NY!” Everyone says it and everyone reading it ignores it. Show what you can in your experience section, and the rest should come out in the interview. I’m not saying don’t talk positively about yourself, but don’t go overboard and don’t really expect it to have much of an impact.

Don’t exaggerate.

A pet peeve of mine is candidates who list multiple “CEO”, “CTO”, “Founder” roles on their resumes. And when you dig into it, you find out that this means they published a couple of mobile apps with a friend when they were in college.

If I’m hiring a junior software developer, your “CEO” experience is irrelevant. If you’re positioning yourself as a CTO, why are you applying for a developer position? This isn’t to say I don’t want to know about these kinds of projects. They are cool and very relevant. Just don’t try to impress me with inflated titles.

How long?

A really complete resume that answers all my questions and is one page long is a thing of beauty. But in reality, it’s often tough to get everything in to a single page without cramping it. Especially if you do have several jobs worth of experiences. I don’t have any problem at all with two-pagers. But more than that is too much. I had one resume come in a while back where page one was a table of contents to the other 8 pages. I kid you not. Guess how much of that I actually read. About 20% of the first page. Maybe.


Again it’s all about answering the things the hiring manager needs to know to determine if you are a fit or not.

If you are not a fit, you are not going to get the job. Period. You can hide things and obfuscate and misdirect. But all that is probably not going to help you get an interview. And if it does, you’re still not going to get the job. Because you’re not a fit.

If you are a fit, making your resume clear and answering those questions right up front is the best way to get in the door.

2020 Desktop Build!


After upgrading my 2011 desktop recently with a new CPU and RAM, I caught the PC building bug and started wanting to build a whole new machine. My initial plans were to take it slow. But there’s only so much I can do there. If I got a modern motherboard, my existing CPU and RAM isn’t going to work, so those three need to be done at once. But I figured I could start with a case anyway.

I went with Phanteks Enthoo Pro.

A few things I was looking for that influenced my decision:

  1. Plenty of space for internal storage. I boot from an SSD, but have my home directory on a 3.5″ HDD, with another one for backup, and yet another for dual booting Windows. And I’d like to have the option to add more if I want to set up a RAID down the line.
  2. Front bays. I do use a CD/DVD drive regularly and want to have the option for other front bay add-ons in the future.
  3. Good cable management. In my 2011 build, I paid no attention to this at all and getting to the RAM was like pushing your way through an overgrown jungle. I cleaned it up a bit during the recent upgrades, but wanted to make it as clean as possible this time.

The Phanteks case excels in all these areas. It has 6 internal 3.5″ bays, with the clip-and-slide mounting slots. These come in two cages of three bays each.

It also has three front bays. The top one you see in the photo is actually a preinstalled front panel bay that pivots open. It’s got 2 USB 3 and 2 USB 2 ports, audio jacks, reset and LED buttons. Then three open bays below that.

I watched a few YouTube video reviews of this case and everyone raved about the cable management. Lots of grommeted pass-through holes to the back space, which has something like an inch of space for cables, and pre-installed velcro strips all over the place. Really really nice.

Also… this case is GIGANTIC. I didn’t realize how big it was till I got it and opened it up. Not a problem for me, but I was definitely surprised. It’s cavernous inside. But I like it a lot. A real quality build and only just over $100. So a really good buy. Very satisfied.

The case came in mid week a couple of weeks ago, so I was planning to move my existing build into it over the weekend. Then, over the coming months I’d do some research, shop around and look for some good deals on a motherboard, CPU and RAM.

Then, my wife saw the new case and said, “Cool! You should get the rest of the stuff now and just build it.” You don’t ask twice about an offer like that.

Years ago I was very much an AMD guy. I went Intel with my 2011 build (not sure why) and all the laptops I’ve had since then have been Intels. But I figured this would be a good time to go back to AMD. It took a bit of research to figure out what chips were compatible with what motherboards and figure out a good price/value combination on everything.

As it turned out, I came into this project at a really good time. The much anticipated new AMD 550 series boards just came out recently. And in fact were hard to get for a while. People had preordered the first round and there were waiting lists for the next available ones. It seems like I came in just at they were all back in stock.

With the giant case I had, there was no way I wasn’t going with a full size ATX board. After looking around, I went with the ASRock B550 PRO4 AM4. It seemed like a good value without going crazy on cost.

And got a Ryzen 5 3600 to go with it. The price on these dropped about $20 from the time I was first looking at them to when I pushed the button, so I lucked out there. Could have spent an extra $50 on the 3600X but I think this will suit my needs just fine.

And 2x8GB sticks of G.Skill Ripjaws DDR4 RAM. This starts me out with 16GB and leaves two slots open for expansion.

While I was at it, I added a TP-Link Wifi card to get some better reception up in the office. Better than the stupid USB Wifi dongle I was using.

Everything but the motherboard arrived one day a couple of weeks ago. But the mobo was way slower, so I had to spend last weekend just staring at everything.

Actually, I did install the wifi card in my existing desktop and it was so much better. One of my wife’s desktops (yes, one of her desktops) was also using one of those USB dongles so I decided to give her an upgrade. I decided to get an upgraded model with external antennas (and bluetooth) for my final build and give her the one I just bought.

Finally the Build!

Last week, the motherboard finally arrived. I had some plans for that night, but those got cancelled and I started building!

Just going to give you a giant dump of all the photos here.

This all went really well and was a lot of fun. The case set up and cable management features are very nice. What you can only partially see in some of those photos is that there are two SSD / 2.5″ HDD mounting brackets in the front. I have my root SSD and one extra 500GB HDD mounted there. There are even two more brackets in the cable management space. I might end up moving them back there at some point. I thought it would look neat to have them up front, but … not so much.

The Moment of Truth

Now came the scary part. I have a fairly complex setup. As I said, I boot off an SDD, with a 2TB HDD for my home folder on Linux, another 2TB HDD for backups, another 1GB HDD for dual booting Windows, and this other 2.5″ HDD that I just had lying around.

I plugged the boot/root SSD into SATA port 1, but I was fairly certain that I was going to have to go into the bios and mess around with boot options. And I figured it was even money that I was going to have to re-install one or both OSes to have them work right. But you never know till you hit the switch.

It powered up and went right into my grub OS selection screen. WTF. I chose Manjaro (Linux) and it booted up. I logged in and everything worked perfectly, like nothing at all had changed (other than being noticeably more performant).

OK… reboot and choose Windows…

Windows of course had to do some extra hardware setup and reboot one more time, but then it was working. I then had to manually install the drivers for the new wifi card, but that went well. And now both OSes are totally functional.

I do get some IRQ warnings that weren’t there before when I boot into Linux. But they just flash on for a second and then it boots fine. I’ll dig into that this coming week.

A few follow up items. One is that I was unable to get a SATA power cable up to the optical drive. Just because the case is so cavernous. So today I went and got a molex to 2x SATA converter and that works fine.

Also, everything is a bit dark in there.


In this photo, I’m actually shining a flashlight in there! So I have a couple strips of addressable RGB lighting on order. But I also picked up an RGB fan and stuck it in one of the roof slots today. The effect is subtle in daylight, but should look nice at night.

The motherboard has two RGB LED headers as well as two addressable RGB LED headers. It also has some on-board LEDs. ASRock has Windows software for setting up the different modes on all the different RGB lighting devices you can cram in there. There are some hacky Linux solutions that I’m going to avoid for now. I just set it up in Windows and the settings get saved and continue to function when you boot into Linux, so that’s fine. I have it set on a slow rainbow cycle.

And the case itself has some RGB LED headers with a button in the front panel to turn them on and off and cycle through effect modes. I might try that out when the new strips come in.

So, all in all, it went really, really well and I’m very happy with this build. In Windows I was able to jump into Steam and continue my progress through the Halo Master Chief Collection right where I left off. Linux all works perfectly too. I don’t think I’ve experienced a crash or major glitch yet. Core temperature is high 30s / low 40s when idle, which is a bit higher than my older Intel chip, but I understand that Ryzens run somewhat hotter.

Up Next

I got that extra lighting coming in some time this week, and might want to get a more powerful CPU cooler. Definitely not going with liquid cooling though. More hassle than it’s worth for my use cases.

And now I have my old case with the upgraded motherboard, CPU and RAM to think about. It’s a perfectly good system. I’ll need a new power supply and graphics card and possibly some more storage and yet another wifi card because all that stuff went into the new build. Not sure what I’ll do for an OS on that or what I’ll even use it for. But I can’t let it go to waste.

Backups, XFCE, Bit-Box v2?



Over the last few weeks I’ve been working on upgrading my home desktop computer, and I’ve documented much of the process here. New RAM, new CPU and cooling fan, several missteps along the way, but I got it all working nicely. Which of course meant that something new had to go wrong.

First, let me tell you about my current backup system for this box. For a number of years, every time I switched computers or OSes, I would back up the entire disk (or at least my home/user directory) to an external hard disk. And then I’d copy back all the stuff I needed, but kept the old copy around. Eventually, all of these copies got consolidated into my desktop computer. There’s all kinds of good stuff in there. Old documents, old code, old programs and downloads, photos, plans, projects, on and on.

In addition to that, I have a well-curated collection of audio, video, and ebooks. All told, this is about 800 GB of data. It all currently lives in my Dropbox folder, so it’s backed up to the cloud that way. And in addition to that, I do an rsync backup of my Dropbox folder to another 2TB drive.

The rsync job runs via crontab every night at midnight, and I’ve been using to monitor that job. It’s a great service. You just add a ping to healthchecks when your backup (or whatever) job is done. If healthchecks gets the ping, all is good. If it doesn’t get a ping within a specified period, it alerts you. I have mine set up to alert me via email, but there are a ton of other integrations. It’s free to use if you just have a few personal jobs like this.

Generally, when I’ve gotten a ping on this, it turns out to be the Internet was down, or I dual booted into Windows and forgot to switch back before midnight, or the computer was just turned off (because, say, I broke my cooling fan mount). But the other week I started getting pings and my logs showed that rsync was failing to copy files to the backup drive. A couple of times I just ran the job again and it worked, but some files still had problems. Then, the other day I booted back into Manjaro after doing playing some Halo on Windows, and… well, actually I did NOT boot back into Manjaro. Because fstab was failing to mount my backup disk. I got into recovery and edited fstab and was able to boot fine. Mounted the disk manually and found 1,900 something errors. Luckily, it was just the local backup disk, so no data loss. Wiped it and repaired it, and it seemed to work fine. The errors are still there, but marked as areas of the disk to not use. But … yeah. This is the 2TB disk that I bought back in 2011 when I built this machine. It’s had a good life. But I’m not going to trust it for anything vital at this point.

I was going to buy a 2TB SSD for around $200. But decided on a new HDD for about a quarter of that price. The way I have my Linux system set up is with a 256 GB SSD on root /. Then my /home directory mounted on a separate 2TB hard disk. So I copied my whole home directory over to the new disk, wiped the old one and now that’s the backup disk. A bit of trial and error editing fstab, but once I got it right, it all booted up like nothing ever happened.

But it got me thinking about my backup strategy. Dropbox has served me pretty well, but it’s not a really professional backup system. They do keep copies of deleted files for a while, but you have no control of that. If I corrupt or change some file incorrectly, once it gets backed up, that’s that.

[Edit: Just discovered that Dropbox Pro, which is what I’m on, also gives you 30 days of file versioning, which is not too shabby. Other plans offer up to 180 days of versioning.]

My rsync strategy wasn’t much better. It was just overwriting and deleting copies to make a mirror of my source data.

I will note that any non-trivial code I write gets checked into github or gitlab or bitbucket on any major changes.

So I started looking into better tools. My first attempt was using restic and Backblaze B2. This will allow me to do incremental snapshots, so I can go back and get a previous good version of a file that might have been deleted or corrupted. Backblaze B2’s storage is pretty cheap. But they also charge for downloads. And I discovered that when you run a restic check or restic prune it makes a bunch of api calls to get file data and Backblaze counts these as downloads. This seems to have the potential of inflating the cost. But I’m not really sure how serious of an issue it will be until I try it and see the real world usage numbers and charges. It may wind up just being a few cents per month.

The other service I looked at is Wasabi. This service caters more towards enterprise accounts, but there’s nothing to stop you from using it personally. On the plus side, they only charge for storage, not downloads or any kind of data resulting from api calls. On the minus side, you have to pay for a minimum of 1TB of storage, and they have a 90-day retention policy, which means that if you upload a large file and delete it the next day, you still pay for 90 days worth of storage for that file. Not a big deal for a backup solution that is going to be a pretty stable size. And it’s only $5.99 for that 1TB, with $0.0059 per GB beyond that. Since I’ll be backing up close to 800GB, this is not bad.

So, I’m still figuring out what I want to do about all of this. For now, I’m at least switching over to restic for my local backup to give me some more security there. I need to clean up all my old archived files because there is a ton of duplicate stuff there. Then I’ll probably go with Backblaze for a month or two and see how that pans out.


This is just a fun little thing I have been playing with the last couple of days.

As you may have gathered, I run Linux on my personal machined and after spending plenty of time on many different desktop environments, I keep coming back to XFCE as my favorite. It hardly changes year after year, so there are plenty of XFCE memes making fun of its nonexistent “exciting new features”, but it’s stable as hell, quite customizable and very minimal, which I like.

I use multiple workspaces (virtual desktops) and I use the workspace switcher panel plugin to indicate which workspace I’m in. By default, it looks like this:

I run four workspaces. The switcher shows a preview of what’s on each screen. The config is minimal:

I turn off the miniature view, so it just shows the number of the workspace, like so:

That’s fine, but rather boring. But it turns out that just about everything in XFCE is visually configurable via CSS. You just edit (or create) the file: ~/.config/gtk-3.0/gtk.css. Then you need to reload the thing that you’ve changed. The workspace switcher is part of the XFCE panel, so you can reload it with xfce4-panel -r. The tough part is knowing what the element names, ids and classes are. To help you inspect the “DOM”, there’s a GTK debugger tool. First, you quit the panel: xfce4-panel -q, then you restart it in debug mode by running GTK_DEBUG=interactive xfce4-panel.

This restarts the panel and opens up a bunch of windows – one for each gtk element running on the system. Here’s the one where my workspace switcher is:

You can see the XfcePanelWindow, the PanelItemBar, and under that the workspace switcher is the XfcePagerPlugin with XfcePagerButtons. There’s all kinds of views into what’s going on. This one I found most useful:

Now you can see each element, its ID and class, if any, and all the CSS properties for that element. Armed with this tool, some helpful tips from some posts on reddit, and a lot of hacking and slashing, I wound up with this in my gtk.css file:

#xfce-panel-toggle-button:checked {
  background-color: #cccccc;
  color: black;

#xfce-panel-toggle-button {
  font-size: 12px;
  padding: 0 2px;
  margin: 6px;
  background-color: #444444;
  border-radius: 12px;
  box-shadow: 0 0;

And when I reload my panel now, my workspace switcher looks like this:

This is life changing… not. But I like it and it was fun to do. Maybe I’ll mess with some other elements, but right now I’m pretty happy with how everything else already looks.

Bit-Box v2

No real significant updates here, but a few ideas I’ve been kicking around.

For one, I learned about how you light up keyboard keys. I assumed you had to buy switches that had LEDs in them. Maybe you can, but there are two other methods that are more prevalent. One is to just have a surface mounted LED under a clear switch or a switch that has an opening to let the light shine through. The other method is to insert the right sized LED into your switch. Little did I know that the switches I bought do actually have a little LED-sized cutout in the top, with two holes that go right through the switch to the back.

Some research led me to buying 100 3mm flangeless 3 volt LEDs for something like $5-6. They pop right into the switches like this:

Since they are 3 volt, they can run right off the Arduino micro board.

I think I have this mounted upside down, but whatever. I also think it might be too bright, so if I ever get to the point of adding these to all my switches, I’ll have to see how bright it looks and might need to add a resistor, or maybe even a knob to control the brightness. Or… I just thought, another control to have the Arduino to it via PWM. So many things to try.

I’ve also been thinking about alternate build ideas to get around printing switch plates each time. I printed out the switch plate template I have on paper, used it to mark up a piece of 1/4″ oak, and chiseled out a cherry-mx-sized square hole.

This worked surprisingly well and was surprisingly non-difficult. It fits snugly and securely. This opens up all kinds of other build ideas, which are mostly just floating around in my mind for now until I get back down to the workshop and actually try something.

RAM, Bit-Box, Attractors, Interpreters


What have I been up to over the last week? A few things.


I got my next 16GB batch of RAM in for my desktop. Out with the old, in with the new. It works. With the upgraded CPU and double the RAM, this 9 year old computer feels like new.

16 GB of shiny new (old DDR3) RAM

Now I have an extra 32 GB of DDR3 RAM that I will probably never use.

4x4GB, 4x2GB, 2x4GB

The four on the left didn’t work in my computer, but I suspect it might work in some other motherboard. The rest of it all works fine. It’s going to end up in a drawer somewhere, so I’d love to get it to someone who can use it. Open to any offers. Shipping, plus whatever you want to pay. I’m not looking to profit, but if I could recoup some fraction of what I spent, that’d be nice.


I was really enjoying my Bit-Box for the last week or so. Until I was messing around with the USB cable for some reason and managed to tear the connector right off.


The problem, I think, was that I used way-too-heavy, solid wire to connect everything. Everything was far too stiff so when I put a bit too much strain on the USB cable, the connector was the first thing to go. Also, soldering everything directly to the board wasn’t the greatest idea either. So the first step was to remove the old one…

Not ideal

Then I soldered on the pins that came with the Arduino boards. I had some ribbon cable with connectors on it, so I cut some of that to size and plugged it onto the pins.

Much better

Now it’s much more flexible and in the event that something does go wrong with this board, I can easily pull it and put in a new one.

I still have plans on making a larger one, but haven’t started anything on that front yet.


I’ve been continuing to work on learning GTK3 desktop Linux apps, working on making an app that does live drawing based on changeable UI parameters. It’s been fun and I’ve made some good progress. I figured out enough of the architecture to feel some confidence in how to set something like this and started in on making a real app using this idea.

One app that I’ve done multiple times over the years is what I call “Strange Explorer”. It presents different formulas for strange attractors, allows you to change their parameters in real time and see and save the outcome. I’ve done it in Flash and JavaScript, and even made a native iOS version. Here’s what I’ve come up with so far:

Two things about this project that I’m really happy about so far. One is that the different formulas are created as external configuration files that get read in at run time. They look like this:

name Hopalong Attractor
x_formula y-1-sqrt(abs(b*x-1-c))*sign(x-1)
y_formula a-x-1
z_formula n/a
scale 10
iter 50000
init_x 0
init_y 0
offset_x 0
offset_y 0
rotation 0
a -0.537
b 2.797
c 2.973
d 0

The code reads all the files in the formulas directory at startup. So to create a new attractor, I just have to create the new config file for it and start the app. It will automatically populate and function.

The other part is the formula parsing itself. Note that the formulas in the above configuration file are just lines of text that populate text fields in the UI. And those text fields are editable. And yet, it winds up as runnable code. To accomplish that, I’m using a library called tinyexpr. You just feed it a string of text and it is evaluated. There are ways to bind variables to it so a, b, c, x and y are all plugged in to the formula at run time as well. It handles all the standard C math library stuff. But you can also define your own functions, like I had to for the sign operation in that example.

Eventually, I’ll create a way to bookmark settings and define brand new formulas right in the UI. Having a lot of fun with this project though.


To be honest, the attractors project has been a bit sidelined during the latter half of the week, as I’ve started down a whole new giant rat hole.

When I was creating the configuration files for that project, I needed a way to read and parse them at runtime. I thought about JSON and YML. There are C libraries that handle those. There’s also libraries that are totally designed for reading configuration files of various formats. In the end, I decided all of those were overkill for what I needed. I just needed to read lines from a file, separate the first word (name of property) from the rest of the line (property value) and add that to a model object.

So I wound up making my own parser. It does just that – reads each line, splits each line on white space. Takes the first element as the property name and joins the remaining elements as the value. If it’s a numeric property, it converts it to a number. Super simple, but it works fine. I’ll need to bolster it up a bit with some error checking, but it’s all I really need.

But it reignited my interest in building an interpreter. And reading up on tinyexpr fanned those flames a bit more.

I’ve had this idea for a while now to build my own DSL (Domain Specific Language) for creating graphics. It would sit on top of something like Cairo Graphics, parse a simplified source file and create a picture. Mainly so I could do away with a ton of setup and boilerplate and just write the commands that make the pretty shapes. It would probably wind up looking something like Processing, but even simpler.

Now before you start throwing links at me to projects that already exist like that, or ask why don’t I just use ____? … that’s not the point. The point is that I want to make something like this. Even if it’s only for myself.

A while back, when I was doing more with Go, I picked up two books:

Writing an Interpreter in Go

Writing a Compiler in Go

I got a little ways into the interpreter book, but never finished. Not a criticism on the book, which seemed pretty good actually, but I got distracted.

Anyway, I decided to go back into this idea and found a few really good online resources. The one I’m working through now is Let’s Build a Simple Interpreter.

When I first started this series, I assumed it was maybe up to five parts and I saw that it was started 5 years ago, so figured I’d get through it fairly quickly. It turns out that it’s now up to 19 parts and the last installment was earlier this year.

And it is amazing.

As an author of technical books myself, I really appreciate it when someone can explain complex subjects clearly. There are so many poorly written technical books and tutorials, when you find one that is really well done, it is a joy. This is one of those.

Writing an interpreter is a complex thing. He takes it one step at a time, in bite sized chunks that you really can wrap your head around. The overall goal is to write an interpreter that will handle most of the Pascal language. I’m on lesson 9 right now. And I don’t recall being this excited over some technology in a while.

This series focuses on Python as the language that the interpreter is being developed in. But I’ve been re-writing it in C. Porting it while learning it has been a great way to force myself to really fully understand what each line of code is actually doing. Much better than just copying and pasting. In fact, I think from now on, if I want to learn something that is not totally language dependent, I’m going to seek out tutorials in a language other than the one I’ll be using.

If you’ve ever thought about learning more about this subject, this particular series is a great place to start. Along the way I’ve found some other resources that I plan on looking into when I work my way though this one. I’ll list them here.



(These were all taken from the simple interpreter series I’m working through now)



I’ve been working on a custom keypad build. I think I’ll call mine a Bit-Box. In my post last week I shared the initial proof of concept breadboard build and the second prototype build. This past week I finished the “final” version. I put “final” in quotes because I’m already thinking of how to make a better one. Anyway, here’s how it came out:

The previous iteration used an Arduino Micro clone, a plastic project box and some push-button switches. For this one, I wanted a nicer enclosure and better switches. I got some Cherry MX keyboard switches from Amazon. A dozen for around $10. And ten X-Keys customizable key caps for about the same amount. These are clear key caps with a top cover that snaps on. You can pop the top off and put a slip of paper in there to create a custom key.

I found some templates here: Just go down to the section entitled “Templates for Pre-cut Legends”. Pull one of those templates into your favorite image creation program and create the keys however you want them to look and print out at 100%. Cut them out and they should fit just right.

Next, I needed some way to mount these switches and keep them in place. There are two methods generally. One is to get or create a custom circuit board with holes drilled in it. The bottom of each switch has plastic nubs as well as the leads sticking down. Those go in the holes and you solder each switch in place. The other method is to have a plate with square holes in it. The entire key fits through the hole and snaps in place. I couldn’t find anywhere to buy such a switch plate, but I did find a model for one at Thingiverse:

I downloaded the model and had it printed at Shapeways. I printed it on the cheapest plastic and it was very reasonable. They kill you on the shipping though. Would be better to buy in bulk probably. Here’s the plate I got, with the switches inserted:

They snapped right in perfectly. Then, I put the key caps on…

And then printed up the inserts and inserted them.

Top row is to switch to workspace 1, 2 and 3, close the current app, close current window. Bottom row is terminal, firefox, slack, clementine (music player) and file manager. I was pretty excited about how this was looking so far. Now on to wiring it up.

I got a few more Arduino Micro clones and soldered wires to one of them and connected those leads to the switches. One switch leg went in common to the ground terminal of the Arduino. And one to each of 10 input terminals.

At this point I was able to plug it in, send my program to it and test it out. It works! Now I wanted to create a nicer enclosure.

I got some 1/2″ oak and set about fabrication. I’m a bit rusty on the woodworking skills, but it all started coming back to me. Ruined a few pieces by measuring wrong, but got there in the end. This was a bit more challenging than a lot of my other woodworking projects because it the inside of the box has to be exactly 2 3/4 x 1 1/2 inches, with fairly tight tolerances, in order to fit the switch plate. That took some careful math to but the outside dimensions of each piece so that the inside would come out right. Not rocket science, but easy to mess up, as I proved.

I cut some grooves in the side pieces and inserted some rails in them. The switch plate goes down into the top of the box and sits on these rails. It worked perfectly. I left the bottom open and filed a groove on the bottom of one of the sides for the cable to pass through. All very low tech, but I like that there are no screws or other fasteners holding the guts in place, and nothing to disassemble to get the switches out if I need to. Just turn it over and they come right out. I didn’t put any finish on the wood yet. I might do some shellac later, but I like the look of raw oak.

Post Mortem

What went well:

  • Key caps, switches, switch plate, Arduino, box build.

In short, I’m really happy with how it turned out.

What could have been better:

  • I used solid wire, probably too heavy for the purpose. Made it hard to arrange everything. If I do another one of these, I’ll use lighter weight stranded wire. Maybe think about using some connectors.
  • The box came out a bit chunkier than I want. It could easily have been half the height. (I am thinking about cutting this one down in fact.) And I’d probably go with 1/4 or 3/8 inch rather than 1/2 inch wood next time.
  • The graphics look great, but maybe a bit washed out. I might try printing them on photo paper to have them be a bit more vibrant.

Thoughts for next time:

  • I want to make a larger model, with maybe 15-20 keys. This will mean designing a custom switch pate, which might need more support in the middle. It also means altering the circuitry and software to use a matrix rather than have each key tied to its own pin. That will be a fun learning process.
  • I might also look into white LED switches and print the graphics with a white background so the light shines through.
  • It might be fun to think about some other controls. A rotary control for volume or brightness or whatever. Toggle switches for… something? Just go all out steam punk on it.

Computer Upgrades


A lot of things going on this week, so I’m probably going to have to make more than one post.

This one will be about some general computer upgrades I’ve been making.

Dell XPS 13 Battery Replacement

So, I bought a Dell XPS 13 back in 2016. It’s a sweet little computer. Really thin, lightweight, almost no bezel. But in 2018 I was really yearning for another Thinkpad and got myself a T-480, which I really love. I haven’t been using the XPS much but felt bad about that since it really is a great machine. So I pulled it out and discovered the battery was totally dead. It would run fine if it was plugged in, but the battery would not charge at all.

My wife had a Dell laptop some years ago and exactly the same thing happened to it. And I’ve heard similar stories from others. Seems to be a thing with Dell.

Well, I went on Amazon and found a replacement battery. Checked out some videos on line that made the replacement look easy. Turns out, it was really easy. Nice job on that Dell. Half a dozen screws to take the bottom panel off. Then 4-5 screws to remove the battery. I took some photos so I’d know that I was putting it back together right.

Yeah, it’s dusty in there.

It all worked just fine and now it’s fully operational. If I ever get back to going into the office, this will be the perfect device for creative commuting.

Like new.

Desktop Upgrade

OK, that was the one that went well. Next project was my desktop. I built it from scratch in 2011. It had an i3 540, 4 GB RAM and a 2TB spinning rust disk.

The original build. 2011.

Here’s the post on my old blog from when I first put this machine together:

Over the years, it’s seen a lot of upgrades. I boosted the memory to 8 GB. I think the power supply died at one point. I know there’s a newer one in there now. And recently I added an Nvidia GeForce 1050 graphics card. All kinds of storage in there now. At this point it boots Manjaro Linux XFCE from a 256 GB SSD, with a 1TB drive mounted as the home directory, and another 2TB drive as a backup. Then another drive that dual boots into Windows 10. Despite its aging specs, it’s been totally functional and I don’t really have any complaints about it for what it is. Mostly a home server, file storage and backup (also have offsite backup), sometimes media server, general browsing and email, etc.

But things can always be better and I’ve been thinking for a while about upgrading it completely. New motherboard, CPU, RAM. That was going to run $300-400 for what I wanted. But I realized I could go from the i3 540 to an i7 870 and upgrade the memory to its max of 16 GB, for just around $120 total. So I bought those items and they arrived this week.

The memory arrived first and that was easy to pop in. The computer booted right up and I’m pretty sure it was notably faster than before. Until it rebooted itself about a minute in. Repeatedly. Ran a memory test and that crashed it consistently. Tried swapping out different sticks to see if maybe it was just one bad one, but no luck. From what I can tell, it’s either bad RAM or just incompatible. I’ve read something about low density vs. high density RAM and apparently my old motherboard likes the low density stuff. So out with the new and back in with the old, at least for the time being, because my CPU was now here.

I popped off the fan, took out the old CPU, cleaned things up, put in the new CPU, got some thermal paste on there, and struggled to get the fan back in. It’s the fan I bought 9 years ago. It’s cheap and has those expanding plastic tabs that go through holes in the board and snap in. Well, in my case, they snap OFF. Two of them broke. I was hoping I still had good enough contact with the heat sink.

It booted up OK, but it got real hot real quick and shut itself right down. So, I spent a day without a desktop, while I waited for a new fan to arrive. I was just hoping I hadn’t fried the CPU.

The new fan came the next day (thanks Amazon!) and has a back plate that goes behind the motherboard and the heat sink/fan screws into that. This meant I had to take the whole computer apart and get the motherboard out. More than I was hoping to have to do, but OK.

Luckily, I’ve held on to this for 9 years. It seriously came in handy.

I gave it a good cleaning and did some better cable management while I was at it. Put it all back together and booted it up. I mixed up the SATA cables a bit, so had to go into BIOS and let it know which drive I wanted to boot from. Once that was done, it booted right up. I also mixed up one of the audio connections, but it was easy to fix. All running good now, and nice and cool! Can’t say definitively that it feels a lot faster. But I feel good knowing that it’s theoretically faster. 🙂

New CPU, new fan. Same old RAM.

Now that I knew I hadn’t totally melted the CPU, I did a bit of research on RAM and ordered another 16GB which is specifically compatible with my system. That will arrive next week.

But later the same day I was rummaging through a box of old cables and gadgets and found two 4 GB sticks of RAM. I vaguely recall getting them some years ago and remember that they were causing the computer to crash, which is why they wound up in a box. But I figured I’d try them out again. So far, so good. I’ve been running with 12 GB (4, 4, 2, 2) for a few days now and it’s been rock solid. Did some stress testing seeing how much RAM I could use at once, and it was all just fine. I’m not sure what was wrong before. Maybe I had put them in the wrong slots or something.

Next Tuesday, I have another 16 GB coming in. I’ll own 48 GB of RAM for this computer – 3 times as much it can hold. And it’s all old DDR3, which is kind of useless in any new system I might build. Oh well.

So, a rough start, but pretty happy with where things wound up so far – even though with the second batch of RAM and the new fan, I’m closer to $200 in on this round of upgrades.

Of course now after taking out the motherboard and putting it all back together again, I’m going back to the idea of getting a modern board and CPU. And more RAM (weep). And possibly a new case. Maybe a project for later in the year.

I’m looking at the B550 boards that have come out recently. I used to build my own computers and always went for AMD. But I’ve been all Intel for the last decade.

Weekend Update June 26, 2020


I’m going to try to do some kind of weekly update about different things that are going on, things I’m working on etc. Maybe just rambling thoughts.

Lately, there are two major projects I’ve been keeping busy with.

  • One is a custom Arduino-based keypad.
  • The other is a GTK based live algorithmic drawing tool.

The Keypad

I’ve wanted something like this for a while. I did a bunch of searching but couldn’t find exactly what I was looking for. But then I found the Elgato Stream Deck and that looks amazing. It’s also not cheap at all.

Strangely though, after I found that, I found all kinds of similar devices. I don’t know where they were hiding during my earlier searches. Then I found this post:

And again, once I found that, I found a ton of similar projects. I decided to do it and bought a 3-pack of Arduino Nano clones. When I got them, I discovered that they will not work for this purpose. You need a device with a 32u4 chip in it, which will act as a keyboard/mouse interface. But while I waited to get the right Arduino, I was able to mess around with the code from the above article on the Nano and figure out how it all worked and started customizing it more to my needs. It wouldn’t connect as a keyboard, but I could trace things out to the serial port and see what happened when I pressed buttons. Here’s the nano, ready to go:

In the meantime, I got the right board, which is an Arduino Pro Micro clone and hooked that up on the breadboard, plugged it in and actually go it sending keys to my computer.

Then I got some pushbutton switches and plastic cases, soldered it all up, drilled some holes in the case, plugged it in and set up my shortcuts. And YES! It all works! Here’s prototype 2, which I’ve been using daily for the past week:

One of the ways I changed the software is that I created a separate callback function for each button, and a library of functions to call. It makes it easy to swap around buttons by just changing what they do. The article’s code hard-coded each button to a function key. My approach allows me to send other combos like Super-F to open my file manager or Super-W to open my browser, Super-T for terminal, etc. Also, Alt-F4 to close a program or Ctrl-W to close a window. All this is super easy on Linux, because it’s really simple to set up keyboard shortcuts to do virtually anything there. On Macos, you have to jump through additional hoops, using Automator or Karibiner. But I’m not using it on a Mac, so I’m good.

The worst part right now is remembering which button does what. I know have a sticky note next to it with a legend. Not ideal. So the next phase will include cherry mx keyboard switches with customized key caps.

Here’s a sneak peak at the final build in progress:

I hope to finish this up this weekend and I’ll post more details next week.

GTK Drawing App

The other project I have going on is a desktop app which will will display live graphics generated from code, with various controls in the UI to update the code in real time.

When I was working mainly in JavaScript, I had built up a library of useful drawing functions that sat on top of the Canvas drawing API. I called this “bitlib”. I ported that to Go a couple of years ago, calling it “blgo” and have done a whole lot of work on it since. The Go version sits on top of Go wrappers to the C-based CairoGraphics library, which is part of GTK. Some weeks back I decided to try and go native with it, skip the wrappers, work directly with the C libraries, writing C code. I ported all of blgo to C and named it bitlib_c.

My reasons for getting away from JavaScript were mainly to get out of the browser. There are various limitations, security restrictions, performance considerations, etc. With Go and now C, I can write code, then compile that code, run the app, save an image and view that image with a press of a key. I can create an animation by saving hundreds or even thousands of files directly to my disk and then convert them to a gif using ImageMagick or even a video using ffmpeg. Again, all with one key press. I really love the set up that I’ve created over the last couple of years.

But one thing I missed from the browser is the immediacy and live feedback. In the browser, I was using my QuickSettings panel to alter the parameters for a drawing or animation in real time. This is not possible just running a program from the command line and saving to images. So I decided to build something myself.

One of the two major UI frameworks on Linux is GTK (the other being QT). Since Cairo is part of GTK, it made sense to build a desktop app with GTK. I could display a Cairo-based image surface in the app and then alter it with controls in real time. It was a bit of a learning curve, but I now have a proof of concept working.

Here you can see an image panel on the right and a control panel on the left. The sliders control the parameters of the drawing code and the drawing is updated in real time. This is a trivial example, but eventually I’ll be able to use this for any level of complexity of algorithmic drawing. My goals so far have been to get something working, learn GTK, and learn the various patterns to create a non-trivial application in C. I’m starting to get a decent MVC-type setup going on there which is nice. I want an easy way to create parameters and have that create the sliders or other controls, much like QuickSettings. Something more imperative, and less declarative than creating and initializing each control like it is now.

I’ll be continuing to work on this and share project. It’s still very much in the proof of concept phase, and I’m not sure it’s ever going to be something I share outright. But who knows.

A Cool Tool

I’m always looking for something cool to improve my computing life. What’s the one command line you probably use most often? ls is one of mine (though I usually alias ll to ls -la). I recently found a mostly drop-in replacement called exa. Check it out here:

It has great use of color coding, metadata and attributes, better defaults, built-in tree view and integrates with git. It’s built in Rust, is open sourced, MIT licensed, has executables for Linux and Mac OS (and Windows is on the horizon). Here’s a screenshot from exa’s github repo:

I just alias ls to exa and that mostly does all I need. Note that I said it’s a “mostly” drop-in replacement. There are some differences, but IMO, most of those differences are improvements.

I just alias ls to exa and that mostly does all I need. Note that I said it’s a “mostly” drop-in replacement. There are some differences, but IMO, most of those differences are improvements.

Is it life changing? No. But it’s a nice little quality of life improvement. Now if I ever see a non-exa ls output, it just looks lame.

Animated Sinusoidal Cardiods


I think I just made up a thing. Usually when I think that, it just means fewer than a few hundred people have thought about it before me, so who knows.

Let’s start with cardioids. A cardioid is a heart-shaped curve. One way to create a cardiod is to roll a circle around another circle of the same size, tracing the path of a single point on the moving circle. Like so:

I discovered another neat way to create a cardioid while checking out the math art challenge.

#MathArtChallenge Day 7: Cardioids!

In this method, you divide a circle into an arbitrary number of points around the radius. Then, for each point n, you draw a line from point n to point n*2. Point 1 to 2, point 2 to 4, point 3 to 6, etc.

Here’s some JavaScript/Canvas code showing this in action:

context.translate(400, 400);
const radius = 350;
const res = 100;
const slice = Math.PI * 2 / res;
const mult = 2;

for(let i = 1; i < res; i++) {
let a1 = slice * i;
let a2 = slice * i * mult;
context.moveTo(Math.cos(a1) * radius, Math.sin(a1) * radius);
context.lineTo(Math.cos(a2) * radius, Math.sin(a2) * radius);

And here’s what that gives you:

You’ll notice in the code that I’ve divided the circle into 100 points, which is is rather low-res. If I up that to 360, we get something nicer:

So I’m calculating the points by getting two angles, a1 and a2, calculating those with slice * i and slice * i * mult as described above. slice being a full circle divided by res and mult equals 2 for now.

   let a1 = slice * i;
let a2 = slice * i * mult;

What if I change that to mult = 3 instead?

Or, mult = 4 ?

You see that for each multiplier, m, you get m-1 nodes in the cardioid. Let’s just go crazy and see what happens when we set res to 1440 points and mult to 25:

Here’s the code for those of you following along at home:

context.translate(400, 400);
const radius = 350;
const res = 1440;
const slice = Math.PI * 2 / res;
const mult = 25;

context.lineWidth = 0.25;
for(let i = 1; i < res; i++) {
let a1 = slice * i;
let a2 = slice * i * mult;
context.moveTo(Math.cos(a1) * radius, Math.sin(a1) * radius);
context.lineTo(Math.cos(a2) * radius, Math.sin(a2) * radius);

All very interesting, but I wanted to start changing things up even more. I decided that rather than using a simple circle, what if I varied the radius of the circle with a sine wave? Here’s the code I came up with:

context.translate(400, 400);
const radius = 300;
const res = 1440;
const slice = Math.PI * 2 / res;
const mult = 5;
const waves = 6;

context.lineWidth = 0.25;
for(let i = 1; i < res; i++) {
let a1 = slice * i;
let a2 = slice * i * mult;
let r1 = radius + Math.sin(a1 * waves) * 100;
let r2 = radius + Math.sin(a2 * waves) * 100;
context.moveTo(Math.cos(a1) * r1, Math.sin(a1) * r1);
context.lineTo(Math.cos(a2) * r2, Math.sin(a2) * r2);

First I created a waves constant that controls how many sine waves will go around the circle. Then an r1 variable that is based on radius, multiplied by the sine of a1 * waves times 100. And an r2 variable based on a2 * waves. So for each point, it’s radius will get larger and smaller as they progress around the circle. The result (setting mult back to 5):

You can get all kinds of interesting shapes by varying how many nodes and how many waves and the size of the waves and the resolution.

Of course, I had to have a go at animating these. The first idea was to vary the height of that radial wave. Here, it’s going back and forth from -80 to +80:

I’m not going to give the source for the animation examples, because it was written in another system entirely, but if you’ve followed along so far, you’ll be able to figure it out.

Next, I thought about varying the phase of that radial wave, so that the wave itself seemed to be animating around in a circle. This produced some really striking animations. I’ll close the article by posting animations for 2, 3, 4, 5 and 6 wave animated sinosoidal cardiodids. Enjoy!