My Blog

Using a ROBO3D Printer on Linux

Published on June 19th, 2018

I bought a new 3D printer yesterday, and am in the process of setting it up. 

The Printer
A ROBO3D R1 printer (purchased second-hand)

My Setup
Desktop computer running Ubuntu 18.04

The Struggle
As per the manufacturer recommendations, I downloaded MatterControl v1.7 as the software used for actually printing the files (specifically, converting the .gcode and preparing slice files). This software wasn't able to connect to my printer, running on /dev/ttyACM0.

The Solution
Turns out that the user running my print job didn't have file privileges to connect to this port. This was dumb and I should have thought of it earlier. But I didn't, so instead I'm writing up the steps to make the connection work here:

sudo usermod -a -G dialout robert

Then, just remember to log out and log back in as your user to allow the change to take effect. I strongly advise against running the software as root. This is just as easy, and protects you from nasty security issues.

Properly Backing up PostgreSQL

Published on April 26th, 2018


Disaster befalls databases set up by even the most competent of developers, and I am far from the most competent of developers. With that in mind, it makes all the sense in the world that I would be a practiced hand at setting up databases and backups so as to save myself from my own inevitable mistakes. Unfortunately, I also get distracted by shiny things and run out of time to follow best practices, so I'm awful when it comes to making sure that my sites have good database backups.

The CMS I'm currently typing this into (Wagtail powered by PostgreSQL) is a perfect example of this: the the database has no backup scripts currently running. If something bad happened to this server, I'd have to go hat-in-hand to the Wayback Machine and pray that they've archived my pages.

But this is no way to live! I want to rest assured that my site would be fine if my database ever decided to stop being a database and instead move to Jamaica to teach guitar to drunk tourists on the beach. I want a script that I can throw into a cron job, and forget about it. Specifically, the script should:

  1. Create compressed backups in a sensible directory 
  2. Contain all PostgreSQL databases contained on the server
  3. Clean up after itself so that the script doesn't fill up the hard disk and bring down the server it was supposed to protect.

You Either Die A Hero

The Script

My preferred script is taken from a version we've made at Atlantic Media, which is in turn taken from a script produced by Aaron Axelsen in 2005, which is a port of an older MySQL backup utility informed by Friedrich Lobenstock, with work based off of a MySQL backup utility at If I have prevented myself from losing a site to dumb migration issues, it is by standing on the shoulders of these giants.

Download the script from my github repo and place it in /var/lib/pgsql/. Then, open your root user's cron file with crontab -e and add the following:

0 4 * * * /var/lib/pgsql/ >> /var/log/postgres_backup.log 2>&1

And that.. is it! You may now do the database equivalent of running with scissors on this server, and restore from compressed, auto-rotating backups as needed. The script will run at 4:00am every day, making backups as appropriate and deleting old backups as needed. You can look through monthly or weekly archives, or restore from the previous day's backup in the event of a disaster. The world is your oyster!

Next Steps

Technically, if the server went down or got lost, we'd be in bad shape. The backups can and should live elsewhere as a means of avoiding total data loss. This can be accomplished by either mounting the backup directory to an NFS, or by grabbing the backups periodically and saving them to a second server and/or your local machine.

But it's like my great-grandpa used to say: "Don't let the perfect devops platform be the enemy of incrementally-better database recovery mechanisms" (the man was ahead of his time). With this script running, we can all sleep much better at night.

I am a man with a slow-cooker.

Published on August 30th, 2017

I am a man with a slow-cooker.

As others ponder what they’d like to eat tonight, I forecast what I’ll want tomorrow. The meal I’ll eat tonight was chosen by a person who’s no longer me. I remember that person, and how he haphazardly threw whatever ingredients sounded good into this pot. I don’t blame him for doing so: mine is a forgiving endeavor, and in a slow cooker this large, there’s always room for mistakes and improvisation. Plus, he’s an experienced chef who’s made exactly the same number of slow cooker meals as I have, so I trust his sensibilities.

There’s only another half an hour left on the timer, and the soup would probably be just as good now. But I wait anyway, enjoying the smells that have since permeated throughout my building. I take care of tasks and check emails while a ceramic pot and a heating coil do all of the hard work. When I was younger, and first coming to know my slow cooker, I used to not wait. Back then, I regarded time as an obstacle and a bully, maliciously keeping me from my food until it was inevitably bested. Now, I consider time to be my sous chef.

While letting time and heating coils prepare my food, sometimes I let muted Tasty videos try to convince me that what I’m doing isn’t cooking. Real cooking, as the videos explain, happens in perfectly-lit, 45-second montages. Real cooking is performed by disembodied hands who never make mistakes or munch on raw ingredients. Real cooking never sets off the smoke alarm. I watch those videos and know that it will be decades before I’m as good a chef as those disembodied hands.

Lucky for me, I have decades to spare. I was schooled in the culinary arts by a grandmother whose soups and stews were a day-long affair. I’ve caused grease fires while trying to rush, and proudly wear hairless spots on my arms as a reminder of those mistakes. I can meditate through 3 hours of making corn tortillas by hand, and consider it time well spent. Having surveyed the shelves of Whole Foods, and experimentally purchased every fruit in Chinatown without an English name, I can confidently say that my favorite ingredient is patience, and I use it liberally inside and outside of cooking.

I’m a slow learner in the lifehack era; a composer of paragraphs in the age of the Tweet. I’m a picky consumer of mountains and cityscapes, preferring those that require a hike or a plane ticket to enjoy over those that disappear in 10 seconds unless you take a screenshot. I’m a New Yorker who studied the busy city’s ebb and flow and chose studied diligence over frenzy.

But if these observations are true; if I’m a tortoise living in the hare’s epoch, I can wait for my turn. More than anything else, I’m patient, and I have some awesome soup to sustain me while I wait.

The Longest Day of the Year

Published on June 21st, 2017

Today's the longest day of the year. Astronomers will tell you that it's because the earth's tilted rotation relative to our orbital plane gives the northern hemisphere prolonged exposure to daylight as the sun's zenith approaches the tropic of cancer.

But it's actually because I need to migrate 20,000 emails into a new database, and I forgot my headphones.

Two Forks

Published on May 23rd, 2017

One of my favorite lunch places mislabels their plastic cutlery bins every day. Forks are reliably in the knife bin. Spoons are everywhere. One day, there were straws in the fork bin. They truly couldn't care less about this aspect of restaurant operation.

Compounding the problem, I don't really care that much either. If it bothered me more, I'd condition myself to examine the things I grabbed before hurriedly shoving them into a to-go bag. But I don't, so I just eat with whichever of six possible combinations that I draw that day. Knife-knife days are tricky, but mercifully rare.

Either because they stock more forks than knives or spoons, or by improbable fate, I've gotten the "double fork" combo the last three times that I've gone fishing for cutlery. This has gotten me used to eating food with two forks. It doesn't work well for every meal; I wouldn't recommend trying to rip apart steak with little fork claws like some over-imaginative child who just watched Jurassic Park. But when it does work (cakes, rice plates, peas, etc) it feels natural and beautiful.

I was curious about whether anyone else agreed with me, and stumbled across a Facebook page with just 18 likes, called "Eating Food With Two Forks." I'm now an engaged and impassioned member of this community of like-minded dining etiquette visionaries.

The point of this post is not to evangelize eating with two forks (that's for a longer post). Instead, I'm sharing this to inform everyone about a Facebook group that proves, once and for all, that there's a place for everyone in this great big word, no matter what sort of dumb little things make you happy.

Soul Cycle

Published on August 10th, 2017

Went to my second Soul Cycle class yesterday and absolutely crushed it!!! "it" I mean "my phone". I was too exhausted/sweaty to properly handle electronics, and it slipped out of my hand. Rather than gracefully catching it mid-flight, I just fumble-launched it into the concrete like a volleyball player going for the spike.

On the plus side, I think these past few weeks of working out are showing some results: I don't think I was strong enough to have broken my phone so thoroughly a few weeks ago.

Broken Phone

My new exercise goal is to get so strong that when I accidentally break my phone after a Soul Cycle class, you can't tell from the pieces whether I had an iPhone or an Android.

Somewhere In DC

Published on July 12th, 2017

Somewhere in DC, a man parks his expensive car. He gets out and stares at his destination. He's nervous, and it's an unfamiliar emotion for him. He's a successful corporate attorney, turned K Street lobbyist, turned captain of industry. He's not used to being the least powerful man in the room.

Yet here he stands in front of an unremarkable townhouse with a remarkable chill in his heart. Stern bodyguards congregate at the entrance, their fashionable suits unable to conceal a demeanor and poise earned through extensive military experience. He starts towards them, rehearsing in his head his identity and reason for being at the gathering. He starts to speak, "Good evening, this is my first—" but their expressions and slight shift in body weight wordlessly inform him that they know who he is, and that he may enter.

He recognizes only half of the people at the table. Senators, CEOs, and celebrities intermingle with leaders of former and current dictatorships. He takes his seat next to the prince of a country he's never heard of, and accepts the disinterested glances of a dozen men and women to whom his tens of millions mean nothing. He's grateful to have this solid, wooden chair take over his weight. He feels small, and sits quietly while others slowly fill every remaining seat at the table.

As though sensing a desire to start the meeting, the entire room stops casual conversation and all divert their eyes to the man at the front of the room. A grayed man of 66, his comfort in leading this organization—and by extension the world—is a humbling sight. He firms his stance, acknowledges the room's attention with a slight nod, and begins to speak.

"Regarding the question of grain prices, it is the decision of the organization that they will continue to rise at a rate of 3% per quarter. Please inform your respective ministers and secretaries of agriculture."

Over the next two hours, the director carves up the world. Elections are decided. Coups are set in motion. Life-saving technological discoveries are surreptitiously swept under the rug. All the while, the room is silent and not a single emotion crosses the director's face.

"Finally..." the director forebodes. "Regarding the question—"

"...oh God help us..." someone interrupts quietly under his breath.

The director, taken aback by the break in hours of silence, stares direly into the eyes of the man who, through lack of self-discipline, broke a sacred decorum that dates back to the days of Jefferson.

"Forgive me, it's just that, it's just—"

"You have made your objections known, sir."

The man behind the outburst retreats further into his seat. The room returns its undivided attention to the director. The director begins again.

"Regarding the question of Washington DC's dress code, it is the decision of the organization that we'll continue to force people to wear dark, full suits when it's 105 degrees and humid outside."

Quiet sighs are the only audible reaction from the gathered attendants. The director dismisses them unceremoniously, and the group collectively returns to the helm of 21st century society, an unspoken question on their lips: "What have we done..."

I imagine this scene pretty much every time I see someone in Western Business Attire in July.

Getting my site up and running

Published on April 29th, 2017


I use my personal site as my playground for learning new skills. I host it myself on a server I maintain, and try to give it the latest and greatest features as I learn them. Because of time and use-case, that's not always something I can follow through on, but I'm trying to be better about it going forward.

Current State (as of April 2017)

  • Backend: I built this site using Django 1.10 and serve it up with Gunicorn and Nginx. Data is stored to PostgreSQL. Site content and page layout is managed through a Wagtail CMS.
  • Frontend: Most of the Javascript is plain ol' jQuery. The site uses Bootstrap for responsiveness and helper classes. Behind the scenes I'm compiling the CSS with Sass.  I'm not using any frontend JS frameworks currently.
  • Devops: The site is housed on a Digital Ocean droplet running Ubuntu 16.04. App workers are restarted via Supervisor. New code is deployed with a Fabric script. Error logging is done through Version control/issue tracking is done through Git/GitHub.

Things I'd Like To Do

  1. Docker-ize the app to make builds and deployments easier.
  2. Set up Jenkins for Continuous Integration/Deployment
  3. Experiment with some fancier frontend development on a few sub-modules. I've done a bit of ReactJS but want to really solidify this.
  4. See why people keep talking about Kubernetes.

  5. Experiment with different Django configurations. Today I'm playing around with CookieCutter Django and hope that this (combined with the aforementioned deep, abiding mastery of Docker) will help me spin up new projects quickly and easily.
  6. Adding proper levels of test coverage.

I'll be posting updates and hopefully even some tutorials as I go through this process, so stay posted!

First Blog Entry

Published on April 25th, 2017
My Blog

This is paragraph content. Here's an image!

Pottery Chris

Or code!

         <h1>Hi Rory!</h1>