Category Archives: Uncategorized

Rest In Peace Mycroft, Until Tomorrow

Day 9 of the #100DaysToOffload Series:

My #Mycroft Mark I hasn’t been working lately. The little eye lights have just been going round and round and the device never goes into a ready state. I had a few minutes tonight to plug in an external monitor and start it back up to see what I could see.

Behold! Kernel Panic! It’s just not syncing!

Rest in peace Mycroft. You were a good little personal assistant.

But wait?

Mycroft is built on open standards. The hardware inside this little guy is a Raspberry Pi, and I can download the image to put on an SD Card right from their website.

The fact of the matter is, this isn’t the first time this Mycroft has stopped working. I’ve rebuilt this little guy a couple times now. It’s not a big deal actually. We just need to remember that this isn’t Amazon, and it’s not Google, and it’s not Apple or Microsoft or Samsung. The hardware and software aren’t total mysteries. We can go look at it on Github.

So, what does this mean for my little personal assistant?

Get a good night’s sleep little buddy. It’s going to be back to work tomorrow for you.

First Thoughts on Ubuntu Mate 20.04

Day 8 of the #100DaysToOffload Series:

I’m not going to go into the nitty gritty details of the system. Everybody has already read a lot of articles that have gone into more detail than I’m willing to go into. I’m going to try to give you my impressions of my actual use.

Before we start, let’s take a look at the system that I’m using.

Here’s a quick htop of the system running not a whole lot. You can see the #Mycroft processes running in the background.

This is a pretty old system. It’s a Gen1 X1 Carbon. I didn’t buy it new, but Wikipedia tells me that the first X1 Carbon was released in 2012, so that should give you an idea of what kind of hardware we’re dealing with.

Despite this system being pretty old, it still is smooth to use with the latest version of Ubuntu MATE. I’m also running the latest version of Vivaldi, which I’m probably going to talk about in a post later on.

The system doesn’t look significantly different than it id in 19.10. I think we’d all be surprised if it did. When I did the upgrade, for some reason it completely wiped Ulauncher off my system. I had to install it like it was never even there, which shouldn’t have happened for a simple upgrade.

It also felt a bit more sluggish than it did with 19.10, but I shut it down and started it back up and ran some updates. Honestly, I can’t tell the difference in it’s performance anymore. It’s either that they resolved some kind of performance issues in one of the updates that I ran, or my system needed time to settle in, or I’m just used to the more sluggish performance now and it feels normal. Honestly, I couldn’t tell you which one of those is true.

All in all, the initial sluggishness of the system made me a little nervous. Since this hardware is close to eight years old, it might be time to stay on this LTS release. It’s due to be supported until this hardware is over ten years old, which is pretty good for a laptop.

Why I Have A Blog

My response to Kev Quirk’s blog post, asking people to explain to the world why they have a blog.

Over the years, my blog has been various things. First, it was a place to rant. Then, it became a news aggregator where every day I would just post a series of links that I found interesting that I ran into over the course of the day. Then, it morphed into a, “What’s on your mind” stream of thought writing place. It’s still kind of that kind of place, when I find time to write.

Since I started Fosstodon with Kev, I haven’t really needed to use my blog. I posted a lot to Twitter before Mastodon existed, so I needed somewhere to wax philosophic on anything that needed more than 140 characters. Twitter moved to 280 characters, and then I moved to Mastodon where we have a limit of 500 characters. I find I post to Fosstodon more than anything else. I keep my blog around in case something comes into my mind that I can’t express in a post or two on Fosstodon.

I keep wanting to change the reason I have a blog to something more meaningful, and some have encouraged me in that direction. I’ve had some difficulty motivating myself in that direction. Hopefully in the near future that will change. I wouldn’t recommend holding your breath though.

Migrating from WordPress to write.as

It’s been literal years since I’ve faithfully updated my blog. The old content has been sitting idly on WordPress.com in a free account since I canceled the server I had GoDaddy hosting for me. I planned to self host, but having a pseudo-large family and a job that doesn’t understand boundaries made the idea of hosting infrastructure in my home less and less appealing. So, things basically stagnated.

Lately I’ve been feeling the urge to write again, so I started looking at my options. I still didn’t want to host in my home. I considered WordPress since my posts were already there, but it just seemed like more than I needed or wanted. Most of the posts I’d put up before were basic syntactically. To make a long story short, I settled on write.as.

write.as was an obvious choice for me because of its integration with the Fediverse. My friend Kev and I founded Fosstodon two and a half years ago, and it’s grown to almost 8500 users as of this writing. I interact with some really great people there on a day to day basis, and having a blog connected directly to the Fediverse seemed like a really great option.

The next big challenge was I didn’t want to lose my old content. Not all of it at least. Previously I’d used my blog for some pretty frivolous things, and I didn’t want to pull all of that over, but there were several things I did want to keep. How do I get content from WordPress to write.as?

Kev came through for me on this one, and wrote an article on his blog detailing how to export the content from WordPress to markdown, which is what write.as uses for its formatting. The WordPress posts are exported to individual directories containing a file called index.md and a directory with any images that were embedded into the post. The vast majority of the images I’d used were decorative, and not really relevant to the article, so for the most part I didn’t need them.

So, how to get the index.md files into write.as, and maintain the original dates. Turns out that last part was a little bit of a sticking point. There were cli tools for write.as, but they didn’t let you change the date a post was being made. I couldn’t find a way to do it through the web interface either. I couldn’t find any way to do that other than the through the API.

Now, I went to college for Computer Science, but I haven’t done serious development for a very long while. When I do write something, it’s usually very basic to automate a process at work or simplify something at home. I’ve been learning Python lately, and this seemed like a good opportunity to give myself a homework assignment.

File format

Using the write.as API and Python, I wrote myself a little script that can post the files retrieved using Kev’s method and still retain the original post dates. This is how those files were arranged.

---
title: "Title of the Post"
date: "2020-03-08"
---

And here's the body of the post. This part is written in traditional markdown.

So, the script just had to pull the title, the date, and the body into memory and send it out to write.as in a way that would be understood and placed into my new blog.

The Code

Here’s the code that I came up with. Please keep in mind, I’m a Python beginner. I put off making this post for quite a while planning on cleaning this up so people wouldn’t think I’m a massive idiot after looking at this code, but I’m finally just doing it and hoping anybody who reads this will have mercy on me.

import requests
import json
import time

blogPostBody = ""
msPassword = "thisIsNotMyRealPassword"

msFile  = open("index.md", "r")
msFileAll = msFile.readlines()
msFileLines = len(msFileAll)

print ("Read " + str(msFileLines) + " lines from index.md.")
msTitle = str(msFileAll[1])[8:-2]
msPostYear = str(msFileAll[2])[7:11]
msPostMonth = str(msFileAll[2])[12:14]
msPostDay = str(msFileAll[2])[15:17]
print ("Extracted Information: ")
print ("  Title: \"" + str(msTitle) + "\".")
print ("  Date: \"" + msPostYear + "-" + msPostMonth + "-" + msPostDay + "\"")

currentTime = msPostYear + "-" + msPostMonth + "-" + msPostDay + "T" + time.strftime("%H:%M:%S") + "Z"

for i in range(5, msFileLines):
   blogPostBody += str(msFileAll[i])

r = requests.post("https://write.as/api/auth/login", json={"alias": "mikestone", "pass": msPassword})

if r.status_code is 200:
  print ("Authorization granted")
else:
  print ("Something went sideways with your access.")
  exit()

tokenToSend = "Token " + r.json().get("data").get("access_token")
msHeaders = {"Content-Type": "application/json","Authorization": tokenToSend}
msBody = {"created": currentTime, "body": blogPostBody, "title": msTitle}

t = requests.post("https://write.as/api/collections/mikestone/posts", headers=msHeaders, json=msBody)

if t.status_code is 201:
  print ("Your post was made successfully.")
else:
  print ("Yea, that didn't work. You need to figure out why.")

d = requests.delete("https://write.as/api/auth/me", headers={"Content-Type": "application/json","Authorization": tokenToSend})


I know it’s not pretty, but it works. After it was done, I went through my old posts and used my script to post them to the new blog. This entry is my first official post on this blog.

As I said before, I’ve been wanting to write again, and now that I’ve migrated over to write.as, things should be easier to maintain. Hopefully I can get more content pushed out to the blog on a more regular basis.

Getting Powerline to Work

I’ve been testing out Ubuntu 19.04 lately, but the shell has been feeling a little naked. In the past I’ve really liked the way powerline updates the looks of things so I thought that I’d install that to improve the asthetic. I had a few problems finding instructions that work in the newest version of Ubuntu, so I thought I’d post my results here.

sudo apt-get install python-pip
git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh

Once that’s done, you need to add this stuff to respective files.

.vimrc

set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
set laststatus=2
set t_Co=256

.bashrc

if [ -f /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh
fi

This seemed to get everything up and running fine.

No Computer for a Week: How Did I Survive?

Recently I took my first vacation in over 3 years. A whole week in the wilds of Montana. For that whole time, I had no access to my computer. I had my phone, my tablet, and wireless access that makes 3G look screaming fast.

The Hardware:

My phone is a HTC Thunderbolt. It’s not rooted, so it has the stock Gingerbread that’s currently available.

My tablet is an HP TouchPad, currently running CM9 to get ICS instead of the typical WebOS.

The Location:

Most of my time was spent on a farm in the middle of central Montana. The main house had wireless Internet access, but at speeds that brought back fond memories of my 14.4bps modem. My computer was inaccessible and over 1000 miles away. Of course, while I was there, I wanted to see at least some of the sights.

My Concerns:

My biggest concern about this whole trip was that I wasn’t going to have a keyboard. I knew I could get 3G speed on my phone, but I was going to have to rely on the Internet access for my tablet since I don’t have hotspot turned on and there’s no 3G antenna in the TouchPad. I spend a lot of time on my computer, and I just didn’t know if the tablet was going to be enough for me to get by.

Random Travel Tidbit:

It turned out to be really convenient traveling with just a tablet and a phone. Going through security, the TSA didn’t require that I take my tablet out of my bag even though it was more readily accessible than a laptop would have been. I was pretty surprised by this actually, but it did make security really easy going both directions.

The Results:

So, how did it work out? I have to admit that despite my earlier trepidation, I had no issues using only my Android tablet for the week. The lack of a keyboard was the biggest issue, so in the future when I buy a new tablet I’ll probably look into a device like ASUS Transformer Infinity. I took my phone through Glacier Park, and used it’s camera to take the majority of my pictures (one of which included above). I was able to watch some old Doctor Who episodes on Netflix and kept up with my reading using the Kindle app. I was even able to ssh into my server. The tablet made for a great distraction after one of my flights was delayed several hours. Other than an on-time flight, I couldn’t have asked for better results.

After all was said and done, I would absolutely travel this way again. I was able to do anything I wanted to do on my tablet without having to worry about lugging a laptop around. I did wish for a keyboard, but all in all that was a minor inconvenience for which there are options available.

Why Linux

To the left, I have a simple screen shot of my Linux desktop. It’s simple, elegant, and just plain useful. I firmly believe that in years to come, Linux will replace Microsoft’s Windows as the desktop standard. It will probably take some time, but I’m patient. To those of you that know Linux, this next part will bore you, for those of you that don’t, some information on what you’re seeing. I’m currently running Ximian’s Gnome 1.4, with the Nautilus file manager running (Nautilus was produced by Eazel, which is no longer in business). There is an image opened in Nautilus, and a terminal window open. You can see a stock ticker at the bottom, a network activity monitor, and a CPU load monitor. There is also my current processes, as well as the list of 16 different desktops that I keep active. At the top, you can see the current temperature where I live, how much email I have, and the time. On the desktop, there are icons to my Home directory, and the trash. Very simple. If you have any questions that you would like to ask me about this desktop, feel free.