A Seemingly Complete and Utter Waste of a Blog Post

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m finishing my discord bot! and today, I’m getting back into my Pi Spy Feline Edition and today I’m solving — exploring the pseudo science behind a chapter in a book I’m writing. It’s not quite on topic, but let’s get started anyway.

I was supposed to have 90 days of the audit log. They dissipated after 55 days. I took screenshots the day of, and the file will be 56 days as of this posting. I’m a tad annoyed, but at least I learned something along the way.

I would have been interested in getting back into dealing with Blinkie and the kitty caller, but the case is broken and it still needs to be repaired. I’m hoping I don’t have to reprint the whole thing. Maybe I will see about using a soldering iron… I might actually try that one.

OK, onto business. About two years ago, I was in a role play set in the world of My Little Pony: Friendship is Magic where I took the role of two characters: a little Unicorn foal by the name of Applesauce, and an elderly Crystal Pony by the name of Professor Stone W. Jay PHD. I eventually settled on calling him Dr. Stone. I later found out about the manga of the same name. There is no relation between them.

At the end of the first big section of the game, Dr. Stone is in a small town when a dimensional rift opens up and starts spewing enemy soldiers. Having had military experience in the past, Dr. Stone takes command and MacGyvers a temporary victory.

In my novelization, I decided I wanted to add a nod to Physics without kowtowing to it. Since this is a magical setting, I decided I wanted a time dilation field so that as you approach the rift without the proper spells on you, your personal clock slows down, but you don’t suffer the tidal effects one would normally expect from several solar masses crushed to a point mass and placed in the town square.

My original question was along these lines:

  • Dr. Stone is at 50 <= r <= 150 feet from the rift.
  • Dr. Stone experiences 15 <= t(observer) = t(o) <= 30 minutes.
  • The world outside the significant effects of the time dilation field experience 3 <= t(fast) = t(f) <= 6 hours.
  • The rift in the town square respects time dilation as if it were a singularity with enough mass to dialate Dr. Stone’s frame of reference by the factors given.
  • The rift’s opening is no bigger than a pickup truck, but no smaller than a human.
  • Does Dr. Stone see an Einstein’s Ring?

I’ve researched by posting in forums and over Discord. I’ve gotten a whole array of people responding from one or two overly blunt Discord users who wouldn’t buy into my fantasy to an Oxford professor who unfortunately didn’t know anything either.

I did manage to get the attention of a few helpful individuals; one suggested lighting effects while another got me thinking about temporal gradients internal to the body. One individual going by Needling Haystacks has been particularly helpful as someone who knows a bit more than me in the topic. Turns out, the air around the singularity would mess with any Einstein’s ring in the first place.

In the search for an equation to work, I found one for stationary satellites above a non-rotating sphere, then I spent whole evening learning about the universal gravitational constant “big G” and not finding it expressed in Imperial units, likely because 99.99 percent of all people with any business even trying to understand equations with big G are already familiar with the SI system.

At this point, I managed to plug in all the variables in and my graphing software gave me a shape I wasn’t expecting. I’ll need to run some more tests.

Final Question: Have you ever gotten overzealous over what’s supposed to be a small detail, but ended up with something much different?

Programming a Discord Bot Part 3 (of 4 for sure)

Good Morning from my Robotics Lab! This is Shadow 8472, and today, I am excited because I recently got a working prototype on my “preemptive” ban bot. Let’s get started!

First of all, I won’t claim to understand most of the stuff I’m working with, just that it isn’t as closely related to security as my last side project. If someone working all day every day could have done this project as easily as walking through a room, I would be crawling through a hole just barely my size. I’ve had a lot of help drilling that tunnel, and now widening it looks like it will be a whole lot faster.

A lot of what I did was trying to understand how Discord thinks, not quite fully getting it, getting help, and only understanding it until I needed another reminder. The long story is that I couldn’t repeat most of the details from memory. Guess what I’m basically doing right now.

I’ve been using PyCharm on my laptop as my IDE. On one of my previous trips to the workshop, Headcrash showed me how to use the debugger, but the neuances didn’t really stick. Before I went in this week, Damaged, the person who’s been helping me over Discord, helped me get through multiple hurdles, some of which should be obvious, others not so much. I was working up until right before sundown Friday, when I stopped for Sabbath.

The next night, I spent not two minutes before bed so I’d actually work on it in the morning, and got the early prototype working: I had someone on my a ban list who had never even been invited. Of course, I made a backup.

The next phase involved disarming the ban function’s “warhead” with a long comment and having it pull the target’s ID from the audit log. The function to loop over the audit log is even pretty user friendly at first glance. It was at this time I reached for a tool I wasn’t familiar with: the debugger.

A debugger is no doubt a valuable tool to know once you know how to use it. I came to a point where I had been introduced to it, but when I tried to use it, I tripped up on a small detail and took it in to the workshop. No sooner had I recreated my error and started explaining my problem than I poked around a little and figured out the answer on my own; the debugger has its own tab. I still learned a lot about how exactly this debugger works and how its interface is different than the ones I played with in the past.

At present, I have an untested/unproven candidate for my final bot before setting it loose on the real server. Right now, it can be told a bad mod’s ID and target logged unban events made by that account. When I’m done, I plan on having it tell me the names and numbers of all the people who were maliciously kicked.

Final Question: The filter for the audit log was not as user friendly as I had hopped., but not as bad as I feared (with the power of the debugger to view all active variable names and values at key points in the program). Have you ever come across a problem where the solution was on the path to that problem?

Programming a Discord Bot Part 2 (of 3? hopefully)

Good Morning from my Robotics Lab! This is Shadow_8472, and today I can taste victory on this mini-project, but as you can tell from the title, it shall be denied for this week. Let’s get started!

Last week, I talked about getting the PiCharm IDE running, and how it’s only as useful as the person maintaining it; as long as someone in the room knows what’s going on, things can get repaired when they break.

This week was another one where I went around building up my knowledge without feeling like I made any tangible headway. I keep telling people, “If I knew exactly what I was doing, I’d be done in two minutes,” and I still stand by that statement. Most of programming is figuring out how you want things to work overall, how your component parts were designed to work, and how the incomplete product actually works, then reconciling all three.

I spent most of my time studying how the async/await model of computing works. Before this week’s project chapter, I knew about multithreading and hyperthreading. All three are models for working on more than one thing at once in a CPU, and each has advantages and challenges. Imagine a computer thread as a guy at a workstation. Multithreading would be adding another guy at another workstation. Hyperthreading would be convincing two guys to share parts of the workstation they both aren’t using at the same time. “Coroutines” would be the first guy stepping aside from the workstation while he waits for more work to do and lets the next guy have a turn.

Other than that, I explored Redbot, some sort of bot to program for Discord. I ended up giving up on it for this project because it was a little expensive on the learning curve for me right now, and I’m not entirely sure it will suit my needs for now.

In the meantime, I’ve made the slightest of “outreach progress,” (yes, I just made that up to talk about when you aren’t ready for something, but try it anyway). I don’t know what’s going on, but hopefully I will know soon.

On the whole, a lot of my projects remind me of a few stories from doing trail work in Pathfinders, a youth club run by my church. One of our annual events involves working on trails at a local State park. While flattening the trail, everyone runs into rocks. Usually, they can just be relocated to somewhere nearby for drainage purposes, but every year, it seems, someone finds a rock in the way that just keeps going until it takes four or five teens to properly move it around once loose. Most of my projects feel like one of these boulders.

On the sad end of the spectrum, I was irresponsible with Blinky’s case. I ended up crushing it. Hopefully, I will get around to seeing to its repair.

Final Question: Windows recently updated. Among a bunch of stuff I didn’t bother reading, I spotted a Dark Mode feature I’m taking advantage of. Do you prefer to keep using the standard, bright theme, or will you be switching over to the dark theme?

Infrastructure Update

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am going over a few changes to my immediate setup. Let’s get Started!

I’m afraid I have some sad news to start with. I’ve been shuttling BlinkiePie around in my backpack, and it’s finally caught up with me. Some time, some how, I wasn’t careful enough, and the case broke. Some time in the near future, it will likely be getting a dose of super glue, but I’m afraid the base will need to be reprinted. If it does, I will be modifying the case so the screw holes actually line up. If I’m feeling especially adventurous, I may even make it accept multiple models of Pi’s.

I otherwise had a few adventures this week. Neighbors were having work done on their house, and I needed to go out and about. I took Blinkie with me, and tethered it to my phone, as well as my laptop. PuTTY wasn’t fully happy. I spent a long time chasing down the supposedly different server key fingerprint, but I didn’t actually find for 100% sure. Since this is a security issue, I’m not going to share my best guess I’m about 90% sure on.

On Friday, I was expecting to spend a couple hours working on my project while my mother was working at the church, but my laptop politely asked to update like I told it to. I didn’t pay close enough attention, and I found myself stuck there for four hours so I could press F1 about three times during the massive update. I’m thankful I stayed, otherwise I was within a minute of having to leave it over Sabbath, and there are always a lot of people in the church office on Saturday morning.

I won’t say I like the update, but I won’t say it isn’t all bad. On the plus side, Windows now has a system-wide dark mode, a feature I personally find appealing. On the minus side, my laptop’s fairly old, and each new line of code it must run to keep up is that many operations not servicing the programs I want to run.

Speaking of programs to run, I went into the workshop and set up for working on Blinkie over SSH and the command line, but I was advised to install an IDE (Integrated Development Environment). I was even there an hour, and Headcrash, the guy running the place, replicated my present progress while we were talking. He talked me into installing PyCharm.

I came up with the comparison that the difference between IDE’s and command line work is the difference between a graphing calculator and a pencil. The pencil is simple, easy to pick up, and important to understand how to operate before using an IDE. IDE’s on the other hand, take care of a lot of things for you. It blasts you with so much information you don’t know what to look at at first. And the scariest part is setting the thing up. There’s a lot of help out there for my “pencil,” but there’s a lot more to break with an IDE. It felt like I was slipping into a commercial airliner cockpit with only a driver’s license. I’m just glad I had someone there to figure out what was happening when something misaligned.

This week felt like a lot of learning curve walls.

Final Questions: Have you ever used a graphing calculator (outside school)? Do you have any other suggestions for comparison?

Programming a Pi With a Discord Bot Part 1 (of 1 hopefully)

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m inching back into actual programming with the skills I’ve built up with SSH over the past month paving the way with a bit smoother workflow. Let’s get started!

A few weeks back, I was made an admin on a Discord server after an unsavory character I shall only refer to as Z nuked it majorly. He took advantage of the owner’s weakened state after constant raids, unbanned pretty much everyone, and kicked about two thirds of the total population. Z’s rampage went on for around 10 minutes, but he caused massive damage.

As an admin, I’m helping rebuild the server. One of the tasks is rebanning everyone Z unbanned. Oops. Discord only gives you the option to ban someone if they have some sort of presence on the server by way of being a member or having a message.

When Discord bans someone, it offers to permanently delete a few days of messages from them. Troll tactics often involve getting a bunch of alt accounts on at a time for wide-spread harassment. When the server staff is doing a good job, alt accounts get banned quickly, and all traces of them are incidentally removed from the server. Bad news for me when trying to reban.

The good news is that Discord have a little more access to Discord’s full feature set, and one of those tools is banning accounts without needing a membership or a post. However, with a new goal in a slightly unfamiliar field, that implies new learning to be had.

The first step was defining what exactly I want it to do: Reban the unreachable. Next, I settled on hard coding each name that still needed banning. I’ve had issues with bot stability when running someone else’s dice bot myself, but I don’t need to worry since the finished bot need only run once and it’s done, ready to archive.

The hardest part would have been getting Python3 on. Lucky me, I have the earliest version of Python supported by Discord’s Python wrapper already installed on Blinkie from my naughty kitty project. I just had to install a few dependencies.

I met someone on Discord by the handle of Damaged who I got the majority of my assistance from. They actually pointed me in the direction of programming my own bot instead of just trusting someone else’s. “What I can say is that you need to be very careful of any bot you want to get to [ban people]. You’re effectively going to give them the keys to the castle.” Security is of concern. I once hacked a new bot (with permission from an admin) into pinging everyone when a normal account doesn’t let you do that. The last thing I want to do is let possible trolls have devastating tools I left laying around.

Banning doesn’t sound like anything too fancy to program, and the skills and tools I develop for this project should be useful later. I learned how Discord bots log into bot accounts with some kind of token. I learned how to tell the bot to print its account ID to the command line and use that to add its account to a server. As of the writing of this post, I have gotten a sample bot debugged and running and responding to a simple command.

The next step was a little revision in plans. I have about 50 names to reban or so in total, and bots can theoretically easily do the deed quickly and more thoroughly than I can. I figured it was likely somewhere around a wash, so I’m going to program a bot to look for all Z’s unbans and reban them.

Other possible bot features I might like are the ability to nuke someone’s entire history with the server. Another person who left now has a crude name I wouldn’t mind if it were gone.

Final Question: Not all bots need potentially dangerous permissions to run. What are some niche moderation bots you’ve seen/used?

Programming a Pi to Deter Cats: Part 9.4

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am glad to say I have finally learned how to beat SSH keys into submission. Let’s get Started!

Computer security is important to get right. The moment you connect to the Internet, you potentially have a near infinite number of burgles trying to break into your device. That is why we have virus scanners and firewalls. SSH is an important and powerful tool for working with headless computers, but if mishandled, it can open a hole in your network security. That is why I always make sure I know what I’m doing and that someone else knows what I’m doing. Because if I don’t get things right, I may be looking at a dozen or so weeks learning about removing malware. If you are trying to learn any skills that can likely compromise your computer security, please seek supervision from someone who already knows how to do it safely.

I spent a lot of time in the workshop this week because I wanted to be sure I was being safe. Like my pile of sand a week or two ago, I had to learn a lot before the final pieces clicked.

SSH (Secure Shell) is a secure way of logging into another computer over a connection that can be assumed to have anyone may be listening in. When set up with SSH keys, a client program first asks the server for its host key. If the host key looks familiar, it’s probably the server the client thinks it’s connecting to. If not, the second layer of protection, host keys, let the client and host negotiate a way to scramble their conversation without eavesdroppers understanding.

Setting SSH up correctly is a bit more tricky to understand. I’ve heard there are lots of tutorials to disable the host key check because it’s annoying. Seat belts are annoying, but if they protect you even just once, they save you a lot of hurt in the long run. I don’t understand the differences between each host key, but from what I can tell, each computer, or at least each server, has one for each type of encryption. Blinky, my Raspberry Pi, came with at least six host keys.

Final Question: one of the challenges I had setting things up was being sure I was connecting to the server I was connecting to. Granted, it would have been safe in that instant to just click through. When was the last time you spent a lot of time figuring out why something works instead of just accepting it works for now and moving on?

Programming a Pi to Deter Cats: Part 9.3

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m off on another tangent away from my main goal of Kitty-Cam security. Let’s get started!

Last week, I went over the basics of logging in securely without a password. This week, I tried practicing my skills and setting up a SSH key pair. Somewhere, I messed up royally, and I messed up the connection for the laptop as well.

It feels like my knowledge in computers is growing like a pile of sand, with the goal being to reach some arbitrary height. Each grain of sand higher means another shell of grains around the outside, and if one falls in just the wrong place, I have to learn how to fix it. For monolithic goals, this is bad news, but in a wider scope, it’s not so bad. If I set a new goal in a similar field, a lot of my grains of knowledge will still be applicable to this new task. I suppose that’s why they call it a learning curve, though right now, it feels like a learning slope.

I went into the workshop and spent a while banging into a learning wall. My progress from last week had seemingly broken, and I could not recognize how for the longest time, even until closing time. Apparently, in addition to SSH public and private keys, there’s this thing called a host key. From a little more research, it looks like a host key is a number you trade over a separate communication line to make sure you don’t have a man-in-the-middle attack where someone is passing all the traffic between you and the server and taking notes on your otherwise private conversation.

I still haven’t gotten my side project working, but now, I think I know the correct direction. I’d like to get this working, because an interesting robot platform I’ve been following for a number of years, Sweetie Bot Project, finally made their code open source. With any luck, I’ll have my skills refined to where I can build one when they release the hardware as well.

Final Question: What projects have you looked forward to working on?

Programming a Pi to Deter Cats: Part 9.2

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m exploring SSH a little farther. Let’s get started!

Just as there’s more than one way to tie a knot, there’s more than one way to secure communications between two computers. Last week, I talked about how to use SSH to log in remotely. This week, I learned how to use a pair of cryptographic keys to log in without a pesky password preventing punctual passage.

I’d like to take a break here and just say that when you have multiple implementations for the same task, it can be difficult to choose which one to go with if there isn’t already some sort of standard in place. For example, if you are just starting to look at getting a new computer and you know precious little about them, it would probably not be a good idea to go with a completely unknown operating system like PurpleDragon (Fictional example). There isn’t likely much support for it, you likely won’t find much software for it outside what comes with it, and you just might have issues trying to connect with other computers if it isn’t programmed with standardized network protocols. This isn’t to say you will never want to run something like PurpleDragon, especially if you are in charge of a secret super genius’s lair and you need to prevent outside hackers and can afford a whole IT staff to maintain it.

Whatever the case, I’m now working with PuTTY, a fancier SSH client that’s supposed to work a little better than the Windows extension I’ve been working with. The cryptographic keys I mentioned earlier are generated in pairs. Oversimplified, both parties each have a public key and a private key, and each party’s public key can unlock the matching private key. The two parties swap public keys, and then the two can lock their chatter up in a way that it just looks like noise to anyone trying to listen in.

Final Question: It feels a little awkward learning about modern cryptography with Quantum computing coming any day now (relatively speaking). Once Quantum computers are easily accessible to the public, cryptography will be obsolete, but they will give us unbreakable quantum cryptography. How long do you think it will take to affect this change?

Programming a Pi to Deter Cats: Part 9.1

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am starting a small side adventure with my Pac-Man ghost inspired Raspberry Pi project. Let’s get started!

This week, I took a break from programming. For weeks now, I’ve had to share an HDMI monitor between my desktop and my Pi, which I’ve named Blinkie. In past weeks, I’ve setup a VNC server so I can remote in and take control of Blinkie from my desktop with a VNC client, but I have a few edges to smooth out.

Firstly, the system seems to get its resolution from an attached HDMI display. If I boot it up headless (no monitor attached) then Raspian will boot the GUI into a low-resolution mode, presumably to save on CPU time. If I later connect a monitor later, it doesn’t auto-adjust, and I end up rebooting. I’ve taken to going behind my monitor and switch the HDMI inputs, and they can be difficult to get on the first try.

Secondly, when I’m no longer working on Blinky, I will have two jobs for it. Guard the kitchen, and stream the Church service on Saturday morning. This will imply both headless and headed operation. I can easily optimize for one or the other, but getting it just right will be tricky.

The bulk of my work this week went into turning Blinky from a more tiny Desktop into more of an actual security camera arrangement. I taught myself about SSH, the most fundamental skill I’ll need for operating it at a distance. SSH feels similar to VNC, but only for the command line in that it has a server and a client. Since I’m starting with optimizing for the security camera configuration, I found a way to boot to CLI, the command line only, and a way to enable a virtual desktop in memory from that command line. I ran into a little surprise.

The first problem I found was a quick fix. Instead of the traditional pointer I’m used to, it favored a black X. LINK to the forum thread I used. Another issue was the unexpected evolution of the aspect ratio. I ended up just moving the whole VNC window over to my other monitor, since it about fit and I don’t particularly relish the black boarder around the desktop. I can rework my workflow on Blinkie to accommodate the narrower work area.

I still have some bits to figure out. The mouse buttons are still double swapping. If I’m going to be going between headless and desktop modes, I want to have a consistent, swapped button experience. The worst case scenario right now is where I run a bash or other kind of script and program it to change the setting based on if there’s a monitor connected on startup.

I also need to find an easier SSH client for Windows or else find a way to zoom in on the text. Also against the default Windows SSH client is the fact I cannot just paste a long, super secure password into Command Prompt for logging in. In addition, I may be interested in looking into an Android SSH client for both now and future projects.

I need to find an easier SSH client for Windows or else find a way to zoom in on the text. Also against the default Windows SSH client is the fact I cannot just paste a long, super secure password into Command Prompt for logging in. In addition, I may be interested in looking into an Android SSH client for both now and future projects.

Final Question: Have you ever used SSH on an Android device before? Do you recommend any in particular?

Programming a Pi to Deter Cats: Part 9

Good Morning from my Robotics Lab! This is Shadow 8472, and today, I feel like I’m progressing in a non-linear fashion. Let’s get started!

Last week, I cleaned up my code by moving the bits I still wanted over from one .py file to another. My goal for this week was to distinguish between objects moving in the foreground and a stationary, but adaptive background.

My progress this week doesn’t feel quite so linear. I got about half way to my stated goal on my own while working with a premade background subtraction function, and ended up getting stuck on trying to find a way to monitor my own progress. I’d like to first see my foreground, preferably in color, then I’d like to see my present background so I can hopefully understand the algorithm better.

I went into the workshop for a little help, and things really went in a lot of odd directions after that. We spent a while chasing oddball, but not quite false, leads a couple big bugs. We downloaded and installed an IDE called Spyder3.

As an aside, I would just like to say, that IDE’s are both a curse and a blessing. They are a pain to get working correctly, especially if you’re working with anything outside the core language. But they make development easier, and they are a lot easier to use than a command line for new programmers, once again provided someone who knows what they are doing is setting it up or the programmer has ample amounts of both luck and determination.

Spyder took a lot of hassle to generate a few nuggets of debug gold, and it still is misbehaving. I plan on just using it as a nicer environment for coding, but I intend to use the command line for testing unless I need a closer look at my program’s state when it fails.

One of my big breakthroughs this week was finally realizing a mismatch between a list of list of lists and a list of lists (a 3D array and a 2D array). It looks like one of those bugs I had was about an improper use of a blur function. My current understanding is that it outputs a “color” frame even if it gets a grayscale input.

I eventually arrived at a grayscale, background-subtracted image with poorly defined edges. It seems to have a hard time with my purple shirt against another background.

My goal for next week is to stabilize the background subtraction with a smooth edges algorithm, and hopefully be able to draw boxes around objects.

Final Question: did you or would you rather learn programming with an IDE or with a command line?