Teach me to draw

I got a drawing tablet last week. It’s an XP-Pen Deco 02. I used to be pretty good at drawing with pencil and paper, but I left that all behind when I was about 15 as school work piled up. Art for the Leaving Cert (the state exam in Ireland before university/college) was as much about art history as drawing a still life or a 3D projection, and it didn’t appeal to me.

Many years ago I bought a small Wacom tablet, but I could never get it working properly in Linux, so it was thrown aside. This tablet is a different beast. It’s huge in comparison with the small tablet I had before and much more sensitive. For a horrified hour, I thought that the pen pressure wasn’t being picked up by the computer. I reinstalled drivers a few times, rebooted, installed Wacom drivers too, in desperation. In the ends, I figured it out. I was using a brush in Krita that didn’t have any pressure controls!

In days gone by, I’d buy a book on drawing, but now I looked up YouTube. There are so many drawing tutorials!

This one by Marc Brunet had some solid ideas for progressing through 30 days, practising drawing circles and cubes and projections, but I needed a more basic introduction to using a tablet to draw.

Next up was Brad, who had this video showing some simple exercises to do, drawing circles in each corner of the canvas, drawing circles around them, and then joining them. Flushed with success, I looked at his other videos and found another video explaining how to draw digitally for beginners.

While it was good for practise, I probably should have stuck to drawing circles and other simple shapes, but this video did make me more aware of layers and different brushes. The result of my efforts may not look quite like what Brad had drawn on his video, however.

Onwards and upwards!

KSP has tutorials now!

I noticed that Kerbal Space Program recently added another Easter egg to the Mun, which was enough reason for me to fire up the game again. (It was given away for free on Epicgames recently, so you probably have it!)

I had to reinstall it as it wouldn’t launch with my mods, but when I fired it up I saw there are now training missions.

I jumped ahead to the two Mun missions. The first one is getting from Kerbin orbit to the Mun. The instructions are clear and fairly easy to follow, I imagine, for someone who hasn’t done it before. The second part starts with you in orbit around the Mun and you have to land. I wish I had that ten years ago! Setting the apoapsis to a low altitude of about 6km and with a 4 star pilot it was simple to land. Just set the rocket to retrograde. The instructions to power up or down got a bit much and I forgot you can feather the throttle with CAPSLOCK (but I’ve mapped ESC to that key anyway…) which would help. When you’re only travelling at 3-5m/s it’s easy to reverse course.

When you try getting to the Mun outside the training missions, you’ll need about 7500 Delta-V to get there, land and return to Kerbin according to this old tutorial on the KSP wiki, but there are other tutorials now.

If you want to install mods, you should probably use CKAN. I need to get it working again and install Mechjeb and whatever the kids are playing with these days. My old computer isn’t that powerful, so I guess I’m not going for any of the graphical upgrades.

The training missions were a success. I landed on the Mun and returned to Kerbin in both missions. That was very satisfying.

TIL to search date ranges in Google Photos

I learned something new about Google Photos. I can examine the photos taken between two dates by entering :YYYYMMDD-YYYYMMDD in the search box.

I have images going back more than twenty years in Google Photos so a way to view a selection of those images is really useful!

St Patrick’s Day, 2019

I haven’t been using Google Photos as much since they added space limitations, but this search will still be useful!

Goodbye to 2022

The great Oli Frey created the cover for Zzap!64 issue 68, 1990. It was the last picture in the Zzap!64 2022 calendar. It celebrated the release of Chase HQ 2. I don’t remember playing that game, but I must have. I definitely played the first game and it wasn’t great. Here’s a play through of it. Are those Dick Tracy adverts at the side of the road? Oh dear!

Time to put the calendar away but I guess I can use it again in 2033, 2039, 2050, 2061, 2067, 2078, 2089, 2095, 2101, 2107, and 2118. I wonder if people will still use paper calendars in 2118?

The Mastodon Onslaught on your blog

You might not be on Mastodon yet, but your blog could get a torrent of traffic from Mastodon, or other Fediverse network if it’s shared there.

If your website is mentioned there, it might be the “victim” of an inadvertent denial of service attack, as hundreds or thousands of servers request the URL in the 60 seconds or so afterwards. That is precisely what JWZ blogged about last month when his site was taken down by Mastodon servers.

Every time I do a new blog post, within a second I have over a thousand simultaneous hits of that URL on my web server from unique IPs. Load goes over 100, and mariadb stops responding.

JWZ on Mastodon Stampede.

JWZ has over 8,000 followers. Every time he shares a post on Mastodon, the instances (servers) where those followers live will send a request to his blog to generate a preview. Actually, two requests will be sent:

  • A request for the wp-json embed for the page.
  • A request for the page that was shared.

Eventually, he blocked the Mastodon user agent. That stops previews of his website showing up on Mastodon posts, but resolves the problem for his website.

Yesterday morning, I decided to see what effect sharing a link on my Mastodon account would have on my server. My Mastodon account has 1.8K followers. A far cry from the number of followers JWZ has, but still enough to test my server.

I wanted to test several scenarios:

  • Caching the post before sharing.
  • Changing Apache configuration.
  • Sharing without caching on my server.

My server is at Linode. I pay an average of $24/month to run this site and my photoblog is on it too where I share a daily photo + link on Mastodon. It’s not a heavy-duty server that can withstand a huge amount of traffic.

If you’d like to skip the details, my server coped fine with sharing a URL from here to Mastodon. The load average went up for about 20 seconds, topping out at the max for about 5 seconds before things calmed down. It was responsive the whole time. Install a full-page caching plugin like WP Super Cache, Jetpack Boost and WP Rest Cache and your site will probably be fine. Jetpack Boost and the Jetpack Image Accelerator will help when human visitors arrive.

The first test resulted in:

  • 261 requests for the page embed.
  • 359 requests for the page itself.
  • 1 minute load average topped out at 1.34 for 5 seconds.

The page was cached by WP Super Cache, but I had set the garbage collection TTL to 60 seconds and I believe it expired halfway through the test, so it had to generate the cache again. Once I adjusted that, and set the TTL to 600 seconds, the second test performed better. The page remained cached throughout:

  • 273 requests for the page embed.
  • 289 requests for the page itself.
  • 1 minute load average topped out at 0.71 for 5 seconds.

The main points of my Apache configuration:

  • Keep alives are disabled.
  • 5 start servers
  • Minimum 10 spare servers

When I reduced the start and minimum spare servers to 1, the next test took longer to complete, and the load average rose to 1.24, even on a fully cached page. This was expected as the server didn’t have the spare capacity to deal with the sudden traffic.

After reverting the changes to Apache, I disabled caching on my blog and shared another URL. The load average only rose to 1.12 for a very short time. I was pleased with that. While caching does help, my server could cope with that traffic.

A sample of the user agents used by Mastodon instances hitting my blog for previews

I suspected that there was one hit per Mastodon instance on my site. I checked my logs and was proved right. For all the accounts that follow me on mastodon.social, only one request was made. That does mean the onslaught of requests isn’t as bad as it might be. Instead of 1,800 requests for a page, there were far fewer. I did notice that a Friendica instance requested one of my test URLs several times.

Mastodon and other Fediverse servers will start requesting a preview within a second of you sharing your post on the network. It helps if your server is running some sort of caching.

If you have many Mastodon followers or if you’re worried about a DDoS from Mastodon, the following will help:

  • Make sure Apache/Nginx has the spare capacity to grow quickly and respond to a sudden torrent of requests.
  • Install a caching plugin like WP Super Cache.
  • Use “expert caching” in WP Super Cache which serves the cached page using mod_rewrite. That will mean your blog post is served almost as fast as requesting a text file from the server. No PHP is executed at all.
  • Install WP Rest Cache as it will soon cache the embed page request.
  • Install Jetpack and enable the Image Accelerator and Jetpack Boost for human visitors who come later.

This problem has existed for a long time. Popular blogs had the same issue when they published new content and people following their blogs (through RSS feed readers, remember them?) hit the server looking for the new post. At least with Mastodon, you can load the post in a private browser window and cache it before sharing it. I want to write a WP Super Cache add-on plugin that allows the site owner to preload a new post as it’s published. That will ensure the new content is ready for sharing. I haven’t started work on that yet, so don’t ask when it’ll be done. Maybe someone else will beat me to it and claim all the credit!