paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ba7291f81e02e9ac3d124444e6c5dcb230bdb529
parent 007892618a212ddbd78ef660bcb93d8d6d20e0a8
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Mon, 27 Jul 2020 01:37:45 -0400

Publish new blog post

Diffstat:
Mpages/blog.md | 1+
Apages/blog/mastodon-to-pleroma-3-shutting-down-mastodon.md | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpages/home.md | 4++--
Mpublic/feeds/sitewide-feed.xml | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apublic/img/mastodon-status-announcement.png | 0
Mpublic/sitemap.xml | 1+
6 files changed, 162 insertions(+), 2 deletions(-)

diff --git a/pages/blog.md b/pages/blog.md @@ -27,6 +27,7 @@ href="https://pleroma.paritybit.ca/jbauer">Pleroma</a>. ### 2020 <ul> + <li>2020-07-25 <a href="blog/mastodon-to-pleroma-3-shutting-down-mastodon">Mastodon to Pleroma — 3 — Shutting Down Mastodon</a></li> <li>2020-07-25 <a href="blog/i-was-wrong">I Was Wrong</a></li> <li>2020-07-24 <a href="blog/switching-to-alacritty">"Switching From St to Alacritty" and "The Separation of Creators From Their Work"</a></li> <li>2020-07-23 <a href="blog/two-truths-and-a-lie">Two Truths and a Lie</a></li> diff --git a/pages/blog/mastodon-to-pleroma-3-shutting-down-mastodon.md b/pages/blog/mastodon-to-pleroma-3-shutting-down-mastodon.md @@ -0,0 +1,98 @@ +## Mastodon to Pleroma — 3 — Shutting Down Mastodon + +[//]: # "The follower migration is underway, now it's time to begin the shutdown procedure for social.paritybit.ca. This is how I automated the announcements and what I'm doing to shut it down." + +[//]: # "main.min.css" + +[//]: # + +<div class="byline"> +<b>Written By:</b> Jake Bauer | + <b>Posted:</b> 2020-07-25 | + <b>Last Updated:</b> 2020-07-25 +</div> + +Now that I've settled into Pleroma, I'm going to decommission my Mastodon +instance. I was originally planning to do it on 2020-08-08, but now that a +majority of my followers have followed the new account, I figure it's time to +take Mastodon off of life support and shut down the instance. + +To make sure that everyone has been notified about the account switch and nobody +will be left wondering where I went, I have decided to turn my old account +(@jbauer@social.paritybit.ca) into a bot which will post an announcement every +30 minutes until the death of the server. + +<figure> + <a href="/img/mastodon-status-announcement.png"><img + src="/img/mastodon-status-announcement.png" alt="A screenshot of one of the + announcements on my Mastodon instance. Announcing that the instance is + shutting down and that followers should follow me on Pleroma instead."/></a> +</figure> + +<p>I tried to tweak the script I'm using to post a friendlier link to my profile +(in the form of @jbauer@pleroma.paritybit.ca) which would have been better for +mobile users, but for some reason unknown to me, Mastodon refuses to federate +with instances using LAN addresses and this caused it to give me an HTTP error +422 when trying to link to my Pleroma instance. I really don't know why but +[this behaviour annoyed me a +lot](https://pleroma.paritybit.ca/notice/9xSKKyy9huLG3WXfcG).</p> + +Anyways, I got the idea to do the automated posting from [a post by Alex +Gleason](https://gleasonator.com/notice/9xMfeRlpcqrSkFv9nM) on the Fediverse and +this is the script that I wrote to make the posts: + +```bash +#!/bin/sh + +TTD=$(cat /tmp/ttd) + +printf "ANNOUNCEMENT: I have moved accounts from Mastodon to Pleroma. + +Followers will NOT auto-migrate. You must manually follow my new account at +https://pleroma.paritybit.ca/jbauer (@jbauer @pleroma.paritybit.ca) and you +should unfollow this account. (Sorry mobile users, I can't generate an @link to +the new profile.) + +social.paritybit.ca will be shutting down in >> $TTD hours\n + +This account is now a bot. This status will repeat every 30 minutes until the +instance is destroyed." > /tmp/status.txt + +accessToken="haha no" +resp="$(curl -s -S -i -X POST \ + -H "Authorization: Bearer $accessToken" \ + -F status="$(cat /tmp/status.txt)" \ + -F visibility=public \ + https://social.paritybit.ca/api/v1/statuses)" +httpCode="$(echo "$resp" | grep HTTP/ | awk '{print $2}')" + +if [ "$httpCode" = "200" ]; then + echo "Successfully posted status update" +else + echo "ERROR: Failed to post status update" + echo "$resp" +fi + +echo "$TTD-0.5" | bc -ql > /tmp/ttd +``` + +The script is run with the following cron job: + +``` +*/30 * * * * /home/jbauer/masto-last-hours.sh +``` + +I calculated the number of hours from the time I started the script to +2020-07-27 at noon using this [time calculator](https://datayze.com/time-until) +and put the value in `/tmp/ttd`. As the script runs, it will keep decrementing +this value until the instance is terminated. Using the `at` command, I have +scheduled a shutdown so that, once the time hits 12:00 on 2020-07-27, my +Mastodon instance will go offline for the final time. + +Friendship ended with Mastodon, now Pleroma is my best friend ([meme +reference](https://knowyourmeme.com/memes/friendship-ended-with-mudasir)). + +_This is my eighty-first post for the +[#100DaysToOffload](https://social.paritybit.ca/tags/100DaysToOffload) +challenge. You can learn more about this challenge over at +[https://100daystooffload.com](https://100daystooffload.com)._ diff --git a/pages/home.md b/pages/home.md @@ -18,6 +18,8 @@ This site will soon™️ be available over Gopher and Gemini. <a class="rss-icon" href="/feeds/sitewide-feed.xml"> <img src="/img/feed-icon.png" width="15" height="15" alt="Click for RSS Feed"/> </a> </div> +2020-07-25 <a class="feed-item" href="blog/mastodon-to-pleroma-3-shutting-down-mastodon">Mastodon to Pleroma — 3 — Shutting Down Mastodon</a> + 2020-07-25 <a class="feed-item" href="blog/i-was-wrong">I Was Wrong</a> 2020-07-24 <a class="feed-item" href="blog/switching-to-alacritty">"Switching From St to Alacritty" and "The Separation of Creators From Their Work"</a> @@ -36,8 +38,6 @@ This site will soon™️ be available over Gopher and Gemini. 2020-07-15 <a class="feed-item" href="blog/be-a-good-netizen">Be A Good Netizen</a> -2020-07-14 <a class="feed-item" href="blog/debian-with-btrfs">Installing Debian 10 Buster with Encrypted LVM and btrfs Subvolumes</a> - ### What is a Parity Bit? It is a bit (in the 1's and 0's sense) used in checking for errors in digital diff --git a/public/feeds/sitewide-feed.xml b/public/feeds/sitewide-feed.xml @@ -7,6 +7,66 @@ <description>The feed that covers all notable additions, updates, announcements, and other changes for the entire paritybit.ca website.</description> <item> + <title>Mastodon to Pleroma — 3 — Shutting Down Mastodon</title> + <link>https://www.paritybit.ca/blog/mastodon-to-pleroma-3-shutting-down-mastodon</link> + <guid>https://www.paritybit.ca/blog/mastodon-to-pleroma-3-shutting-down-mastodon</guid> + <pubDate>Sat, 25 Jul 2020 22:27:43 -0400</pubDate> + <description><![CDATA[<h2 id="mastodon-to-pleroma-3-shutting-down-mastodon">Mastodon to Pleroma — 3 — Shutting Down Mastodon</h2> +<div class="byline"> +<p><b>Written By:</b> Jake Bauer | <b>Posted:</b> 2020-07-25 | <b>Last Updated:</b> 2020-07-25</p> +</div> +<p>Now that I’ve settled into Pleroma, I’m going to decommission my Mastodon instance. I was originally planning to do it on 2020-08-08, but now that a majority of my followers have followed the new account, I figure it’s time to take Mastodon off of life support and shut down the instance.</p> +<p>To make sure that everyone has been notified about the account switch and nobody will be left wondering where I went, I have decided to turn my old account (<span class="citation" data-cites="jbauer">@jbauer</span><span class="citation" data-cites="social.paritybit.ca">@social.paritybit.ca</span>) into a bot which will post an announcement every 30 minutes until the death of the server.</p> +<figure> +<a href="/img/mastodon-status-announcement.png"><img + src="/img/mastodon-status-announcement.png" alt="A screenshot of one of the + announcements on my Mastodon instance. Announcing that the instance is + shutting down and that followers should follow me on Pleroma instead."/></a> +</figure> +<p> +I tried to tweak the script I’m using to post a friendlier link to my profile (in the form of <span class="citation" data-cites="jbauer">@jbauer</span><span class="citation" data-cites="pleroma.paritybit.ca">@pleroma.paritybit.ca</span>) which would have been better for mobile users, but for some reason unknown to me, Mastodon refuses to federate with instances using LAN addresses and this caused it to give me an HTTP error 422 when trying to link to my Pleroma instance. I really don’t know why but <a href="https://pleroma.paritybit.ca/notice/9xSKKyy9huLG3WXfcG">this behaviour annoyed me a lot</a>. +</p> +<p>Anyways, I got the idea to do the automated posting from <a href="https://gleasonator.com/notice/9xMfeRlpcqrSkFv9nM">a post by Alex Gleason</a> on the Fediverse and this is the script that I wrote to make the posts:</p> +<div class="sourceCode" id="cb1"><pre class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="co">#!/bin/sh</span></span> +<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a></span> +<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a><span class="va">TTD=$(</span><span class="fu">cat</span> /tmp/ttd<span class="va">)</span></span> +<span id="cb1-4"><a href="#cb1-4" aria-hidden="true"></a></span> +<span id="cb1-5"><a href="#cb1-5" aria-hidden="true"></a><span class="bu">printf</span> <span class="st">&quot;ANNOUNCEMENT: I have moved accounts from Mastodon to Pleroma.</span></span> +<span id="cb1-6"><a href="#cb1-6" aria-hidden="true"></a></span> +<span id="cb1-7"><a href="#cb1-7" aria-hidden="true"></a><span class="st">Followers will NOT auto-migrate. You must manually follow my new account at</span></span> +<span id="cb1-8"><a href="#cb1-8" aria-hidden="true"></a><span class="st">https://pleroma.paritybit.ca/jbauer (@jbauer @pleroma.paritybit.ca) and you</span></span> +<span id="cb1-9"><a href="#cb1-9" aria-hidden="true"></a><span class="st">should unfollow this account. (Sorry mobile users, I can&#39;t generate an @link to</span></span> +<span id="cb1-10"><a href="#cb1-10" aria-hidden="true"></a><span class="st">the new profile.)</span></span> +<span id="cb1-11"><a href="#cb1-11" aria-hidden="true"></a></span> +<span id="cb1-12"><a href="#cb1-12" aria-hidden="true"></a><span class="st">social.paritybit.ca will be shutting down in &gt;&gt; </span><span class="va">$TTD</span><span class="st"> hours +</span></span> +<span id="cb1-13"><a href="#cb1-13" aria-hidden="true"></a></span> +<span id="cb1-14"><a href="#cb1-14" aria-hidden="true"></a><span class="st">This account is now a bot. This status will repeat every 30 minutes until the</span></span> +<span id="cb1-15"><a href="#cb1-15" aria-hidden="true"></a><span class="st">instance is destroyed.&quot;</span> <span class="op">&gt;</span> /tmp/status.txt</span> +<span id="cb1-16"><a href="#cb1-16" aria-hidden="true"></a></span> +<span id="cb1-17"><a href="#cb1-17" aria-hidden="true"></a><span class="va">accessToken=</span><span class="st">&quot;haha no&quot;</span></span> +<span id="cb1-18"><a href="#cb1-18" aria-hidden="true"></a><span class="va">resp=</span><span class="st">&quot;</span><span class="va">$(</span><span class="ex">curl</span> -s -S -i -X POST \</span> +<span id="cb1-19"><a href="#cb1-19" aria-hidden="true"></a> -H <span class="st">&quot;Authorization: Bearer </span><span class="va">$accessToken</span><span class="st">&quot;</span> \</span> +<span id="cb1-20"><a href="#cb1-20" aria-hidden="true"></a> -F status=<span class="st">&quot;</span><span class="va">$(</span><span class="fu">cat</span> /tmp/status.txt<span class="va">)</span><span class="st">&quot;</span> \</span> +<span id="cb1-21"><a href="#cb1-21" aria-hidden="true"></a> -F visibility=public \</span> +<span id="cb1-22"><a href="#cb1-22" aria-hidden="true"></a> https://social.paritybit.ca/api/v1/statuses<span class="va">)</span><span class="st">&quot;</span></span> +<span id="cb1-23"><a href="#cb1-23" aria-hidden="true"></a><span class="va">httpCode=</span><span class="st">&quot;</span><span class="va">$(</span><span class="bu">echo</span> <span class="st">&quot;</span><span class="va">$resp</span><span class="st">&quot;</span> <span class="kw">|</span> <span class="fu">grep</span> HTTP/ <span class="kw">|</span> <span class="fu">awk</span> <span class="st">&#39;{print $2}&#39;</span><span class="va">)</span><span class="st">&quot;</span></span> +<span id="cb1-24"><a href="#cb1-24" aria-hidden="true"></a></span> +<span id="cb1-25"><a href="#cb1-25" aria-hidden="true"></a><span class="kw">if</span><span class="bu"> [</span> <span class="st">&quot;</span><span class="va">$httpCode</span><span class="st">&quot;</span> <span class="ot">=</span> <span class="st">&quot;200&quot;</span><span class="bu"> ]</span>; <span class="kw">then</span></span> +<span id="cb1-26"><a href="#cb1-26" aria-hidden="true"></a> <span class="bu">echo</span> <span class="st">&quot;Successfully posted status update&quot;</span></span> +<span id="cb1-27"><a href="#cb1-27" aria-hidden="true"></a><span class="kw">else</span></span> +<span id="cb1-28"><a href="#cb1-28" aria-hidden="true"></a> <span class="bu">echo</span> <span class="st">&quot;ERROR: Failed to post status update&quot;</span></span> +<span id="cb1-29"><a href="#cb1-29" aria-hidden="true"></a> <span class="bu">echo</span> <span class="st">&quot;</span><span class="va">$resp</span><span class="st">&quot;</span></span> +<span id="cb1-30"><a href="#cb1-30" aria-hidden="true"></a><span class="kw">fi</span></span> +<span id="cb1-31"><a href="#cb1-31" aria-hidden="true"></a></span> +<span id="cb1-32"><a href="#cb1-32" aria-hidden="true"></a><span class="bu">echo</span> <span class="st">&quot;</span><span class="va">$TTD</span><span class="st">-0.5&quot;</span> <span class="kw">|</span> <span class="fu">bc</span> -ql <span class="op">&gt;</span> /tmp/ttd</span></code></pre></div> +<p>The script is run with the following cron job:</p> +<pre><code>*/30 * * * * /home/jbauer/masto-last-hours.sh</code></pre> +<p>I calculated the number of hours from the time I started the script to 2020-07-27 at noon using this <a href="https://datayze.com/time-until">time calculator</a> and put the value in <code>/tmp/ttd</code>. As the script runs, it will keep decrementing this value until the instance is terminated. Using the <code>at</code> command, I have scheduled a shutdown so that, once the time hits 12:00 on 2020-07-27, my Mastodon instance will go offline for the final time.</p> +<p>Friendship ended with Mastodon, now Pleroma is my best friend (<a href="https://knowyourmeme.com/memes/friendship-ended-with-mudasir">meme reference</a>).</p> +<p><em>This is my eighty-first post for the <a href="https://social.paritybit.ca/tags/100DaysToOffload">#100DaysToOffload</a> challenge. You can learn more about this challenge over at <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</em></p>]]></description> + </item> +<item> <title>I Was Wrong</title> <link>https://www.paritybit.ca/blog/i-was-wrong</link> <guid>https://www.paritybit.ca/blog/i-was-wrong</guid> diff --git a/public/img/mastodon-status-announcement.png b/public/img/mastodon-status-announcement.png Binary files differ. diff --git a/public/sitemap.xml b/public/sitemap.xml @@ -3,6 +3,7 @@ <url><loc>https://www.paritybit.ca</loc></url> <url><loc>https://www.paritybit.ca/home</loc></url> <url><loc>https://www.paritybit.ca/blog</loc></url> + <url><loc>https://www.paritybit.ca/blog/mastodon-to-pleroma-3-shutting-down-mastodon</loc></url> <url><loc>https://www.paritybit.ca/blog/i-was-wrong</loc></url> <url><loc>https://www.paritybit.ca/blog/switching-to-alacritty</loc></url> <url><loc>https://www.paritybit.ca/blog/two-truths-and-a-lie</loc></url>