How to Migrate Follows and Blocks from Twitter to Bluesky

If you’re like me, and you’ve had just about enough of being on Twitter and would like to move to Bluesky, there’s a way to take your followings and blocks with you!

To get started, go here and download the extension “Sky Follower Bridge”, which is a plugin for the Chrome web browser.

Next, go to https://bsky.app/settings/app-passwords and click “Add App Password”. You’ll be prompted to enter a name:

…and then a password will be shown. Copy that into your clipboard and click “Done”:

Continue reading “How to Migrate Follows and Blocks from Twitter to Bluesky”

How’s PECO? My New Website Will Tell You

Is PECO Okay?

I’ve been pretty quiet on this blog, but I’ve been busy behind the scenes. One of the projects I’ve worked on is https://www.ispecookay.com/, my first major project built in Serverless!

Thanks to COVID, I was made a remote employee, which now means most days I’m in my apartment building about 23 hours a day.  This means that if power is lost in the middle of the day, I’ll notice it.  If PECO has to do maintenance in the middle of the day, I’ll notice it. If a storm takes out power for several hours, I’ll definitely notice it.

While sitting around in the dark and refreshing PECO’s status page, I found that I really only cared about two values:

  • How many customers are without power?
  • Is that number moving up or down?

If the number is moving up, that means things are getting worse and I shouldn’t expect power back for awhile. If the number is moving down, it means that restorations are happening, and I should expect power back sooner. And that is largely why I built https://www.ispecookay.com/.

I also want to state that I am throwing absolutely NO shade on PECO, I found that their existing outage page did not meet my needs, because it is very content and Javascript heavy, and when there is a power outage going on, I would like to conserve my phone’s battery.  CNN does a great job at this with CNN Lite and it was one of my inspirations for “Is PECO Okay?”.

Continue reading “How’s PECO? My New Website Will Tell You”

Behold! A QR Code Generator That Doesn’t Suck!

Awhile ago, I got into QR Codes. I’ve found them increasingly handy because I could make QR codes based on documents that I had stored in Google Docs, and then I could invite people to scan those QR Codes in person if I wanted to share what was in the doc. The QR Codes themselves could be printed out on paper, be saved to my phone and scanned from them, or even put on my Apple Watch.

But I ran into a challenge: creating QR Codes. When I did searches for QR Code generators, most of the ones I found online either generated small QR Codes, had ads, required money, or all three! It was very much Not Fun, and I felt it was a minor injustice that being able to create something as useful as QR Codes was off limits for so many people.

So I decided to create my own.

After reading some tutorials on how to do it, I found one that talked about how to make QR Codes in Python. I then remembered, that I had an app with a bunch of API endpoints available, and it was written in Python! So, I figured, why not add a QR Code generator, expose it as another endpoint, and create a form which submits to that API?

And that’s exactly what I did, you can find the QR Code generator here:

https://httpbin.dmuth.org/qrcode/

This is 100% free with no ads, no tracking, and no spam. Just QR Codes when you want them.

Enjoy!

Mirror on Medium.

Introducing Docker in Vagrant

[EDIT: Since this post was written, OrbStack has appeared. It’s really good for running Docker containers and VMs on a Mac. You should check it out instead.]

If you’re a Mac user, you have a few options for running Docker. Aside from Docker’s official client, there also exists Rancher Desktop and Podman. I’ve used them all, and they’re all decent implementations of Docker. However, I ran into some limitations in each platform that are beyond the scope of this post that nonetheless prompted me to try building out my own Docker offering.

Having used VirtualBox and Vagrant before, I found myself wondering if I could use Vagrant to stand up an instance of Docker, proxy connections to Docker over SSH, and mount directories on the host machine’s filesystem.

It turns out I could.

Continue reading “Introducing Docker in Vagrant”

Displaying Your Wireless Network in the Touch Bar on a Macbook

If you have a Macbook laptop, you’re probably familiar with the touch bar. It’s a neat little LED display above the top row of your keyboard that Mac OS/X uses to display context-sensitive widgets. However, you don’t just have to accept the widgets that Apple provides–you can in fact customize the touchbar however you like.

“But why would I want to do this?”, I hear you ask. Well, maybe you need to have a custom status of some kind displayed on your menu bar. For me, it was… wireless networks.

MTMR is my new favorite utility.

That sounds confusing, but hear me out. Sometimes when I am traveling, I get kicked off of whatever wireless network I’m on. I wanted a way to easily determine what network I was on, without having to keep clicking on the wireless icon in my menu bar. I found that the touch bar was a convenient way to do that, and in this post, I will show you how I did it.

First, download an app called MTMR. MTMR stands for “My Touchbar. My rules.” Installation instructions are on that page, but most users will want the dmg file.

Once that’s installed, you can edit the file $HOME/Library/Application Support/MTMR/items.json to change what appears in the menu bar. The contents of the file are JSON, and you can edit this in whichever editor you like. Furthermore, once you save changes, they take effect immediately–no restarts of the MTMR app are necessary!

Continue reading “Displaying Your Wireless Network in the Touch Bar on a Macbook”

I Created an AI Chatbot of Gritty, and it is Horrifying

Living 20 minutes from downtown Philadelphia, I’m a big fan of our hockey mascot, Gritty. Recently I’ve been playing around with a website called character.ai, and one of the neat things that site lets you do is create bots based on characters, real or imaginary. For example, there is one character based on Albert Einstein, and another is based on Darth Vader. So I decided I would create a character based on Gritty.

I immediately regretted that.

The AI powering that site is… frightfully good, to say the least. After seeding the character with just a handful of tweets from Gritty’s Twitter feed, the bot quickly took on a life of its own and said things that I would absolutely expect the real Gritty to say.

For example, let’s start with the no-fly list:

Well then.

Next I asked Gritty about his diet, and the answers the bot gave were concerning, to say the least:

Continue reading “I Created an AI Chatbot of Gritty, and it is Horrifying”

Introducing FastAPI Httpbin

I write a lot of back end code and sometimes have to make use of HTTP endpoints. Sometimes I want to test those endpoints. I used to use httpbin.org for my endpoint testing, but over time noticed that some of the endpoints were returning HTTP 5xx errors. Some investigation reveals that the project seems to be abandoned, with open issues going all the way back to 2017. That’s not so good.

So I decided to build my own.

In this post I’d like to talk about FastAPI Httpbin. But before I can, I need to talk about FastAPI itself. FastAPI is a framework for building high-performance frameworks in Python based on Python type hints. The really neat thing about FastAPI is that your function definition for each endpoint is the source of truth–FastAPI handles argument validation for any calls to that endpoint, and generates the appropriate Swagger documentation for that endpoint.

Continue reading “Introducing FastAPI Httpbin”

Using the Makeresults in Command in Splunk

If you’re been reading this blog for awhile, you’ll know that I’m a big fan of Splunk, and I even went so far as to Dockerize it for use in a lab/testing environment.

CSI: Logfiles

Well today I want to talk about a command in Splunk which I believe is seriously underrated: makeresults.

Makeresults (documented here) lets you generate fake events for testing purposes. No indexes are queried, no disks are touched, which means that makes results is very very fast. And when a query runs quickly, that means you can run it more times which means new queries and content will be developed faster.

In this post, I’m going to walk you through a way to use makeresults to learn the difference between the streamstats and eventstats commands.

Continue reading “Using the Makeresults in Command in Splunk”

Back Up Your Google Drive Files with Rclone

Trust, but always make backups.

Google Drive is one of my favorite apps for storing and editing documents and spreadsheets. If don’t currently use Google Drive in place of Microsoft Office, I would recommend checking it out!

That said, while it’s a useful tool, your files are being stored on somebody else’s computer, which means that if your Google account should get hacked or suspended, you will lose access to your files. Not good.

In this post, I will show you how to back up the contents of your Google Drive onto your filesystem. You will need a medium level of knowledge and some experience with the command line for this.

Installing and Configuring Rclone

First, start by downloading Rclone. Rclone is a command line app for managing, copying, and syncing files across over 40 different cloud providers. In addition to Google Drive, it has support for Dropbox, AWS S3, Microsoft OneDrive, and a whole list of cloud providers that I’ve never even heard of!

Once you have Rclone downloaded, start up its configuration wizard by typing:

rclone config
Continue reading “Back Up Your Google Drive Files with Rclone”

Learning Prometheus, Grafana, and Loki with Docker

If you’ve read this blog for any length of time, you’ll know that I’m a big fan of Splunk, and using Splunk to solve everyday problems. But while Splunk excels at being able to eat nearly any kind of event or data, sometimes you need a more specific tool when working with a specific type of data.

That’s where Prometheus, Loki, and Grafana all come in. Prometheus is a time series database built for storing metrics. Loki is a log collection system which scales horizontally and is useful for collecting application logs, and Grafana is the dashboard app which is used to view metrics from either platform!

I wanted to learn more about each of these apps, and I figured the best way to do so was to build out something in Docker that let me ingest data immediately, and then to build some sample dashboards on top of that. I then open sourced it, and the entire project can be found at https://github.com/dmuth/grafana-playground

Getting Started

First, clone the repo and start up all of the Docker containers:

git clone https://github.com/dmuth/grafana-playground.git
cd grafana-playground
docker-compose up -d

This will start up several containers, some of which will ingest data, some of which will store data.

Continue reading “Learning Prometheus, Grafana, and Loki with Docker”