Author: jackadmin

  • AWS IoT, Google Voice Kits, and RPi 3 Builds

    Well, I jumped forward in tech today. I had two projects that I had bought in December that I hadn’t gotten around to yet. After a really tough week at work I was in the mood for still doing work but un-willing to do more work for my job after all the hours I logged today. So instead I deftly harnessed that motivation and assigned myself to my various tasks in my todo lists. AND I even started working on a todo app in react that I had started a long-ass time ago. But that was on Friday. This blog post is mainly about what I did today, Sunday, in regards to a Google Voice kit and an AWS IoT button.

    Both things I did are entirely trivial. I must come out and say that first. But the initial steps these projects have unlocks lots of varying and interesting potential. I bought these two things on December 21st. And am just now getting to them. That means I was busy during christmas break with something else. I think it was mastodon. That means I got distracted but completed in one spurt an entirely different endeavor that came out of nowhere. Like it makes me really think I can complete these other projects within a short amount of time, close the ones out I can’t do right now, and move on to new ones with what I’ve learned. Connecting the dots after the fact.

    This fridge apparatus is the first product I could actually sell and support with minimal effort and with me not feeling bad about it. Basically the 11″ screen was $132 and the Google Voice kit was $27. Now that’s not including the RPi 3. That RPi 3 cost me $38. So all in all, that whole thing minus cables cost me $197. Quite a pretty penny. And NOT as much as I had though initially. At first I had done it in my head as a $150 project I would be willing to hook up for people. Now I realize there’s a buttload of hidden costs in the accessories. Maybe $40 or more/less. In any case, the point is that I would sell that package for almost face value. Ya’kno maybe I could get a volume discount or something. But I would set it up, exactly as I had it at home, and then I could offer them only so many updates as I make to my own device. And as long as they dont modify it, and allow me to flash their device with new installs remotely. Then I would be cool with that arrangement.

    This fridge could be tied into mealinator so I could do things like “Alexa, ask Mealinator what I should make for dinner”. Or “OK Google, what’s for dinner?” And then both services can connect to me and carlie’s life services products and supply them with ideas and automated life management. People won’t have to try as hard or remember as much, and can be more efficient and less wasteful with their food if they follow the vision I have for a project like this. Basically, you would always have your food inventory at your finger tips. Everything would be barcoded in your fridge and freezer, or deeplearning would have figured it out for you. Just by scanning the products in with that DeepLens camera or a barcode scanner you’d have an accurate list of ingredients to use in recipes.

    And then the recipes made would automatically subtract the recipe’s allotments from your inventory. Thus creating easy-to-see fullness gauges that can be set up to automatically alert you when you are running low on a favorite ingredient. Deep-learning would be ultimate. Barcode can get us there. Recipes can help with the inventory management aspect. Weight-sensitive shelving or an apparatus would be even more precise. DeepLens could be a weird middle ground here too. And maybe you could have a weightscale that you use when you take an item out or just when you put it back to measure how much you used. Hmmm….you know….hmmm…….

    All that time playing First Person Inventory Manager (S.T.A.L.K.E.R. Call of Pripyat) is finally paying off!

    Next steps are to hook up the google voice recognition program to a few subroutines that I define that can read out the metadata I’ll leave around for each of the meals that I plan on cooking. That way Mike or I can come into the room and just blithely ask “hmmmm….I wOnDeR what’s for DInNEr??” and google assistant could just read off my meal card for the current day. We will see how that goes… until next time…

  • When to use Feature Flags

    I had an idea for an informative blog post, but I’ve forgotten it now. Perhaps it has to do with feature flags:

    • do use feature flags to show new features to special groups of people
    • don’t let feature flags live around for too long
    • don’t use feature flags if it’s not needed
    • don’t spend too much time talking about adding/removing them because it’s so very trivial to add/remove them
  • Custom Login Form in React with Okta Auth JS

    So my task at work is to Roll My Own Okta Sign In Component. That component will be written using React and its state will be managed with Redux.

    That I have so far. What’s next? There’s the OktaSignInConfig that goes in tandem with the normal Okta Signin Widget. This config file has code in it to create a proper query string for our redirects coming in from other websites that aren’t our “SSO” login site.

    There’s also some i18n strings set up in here, primarily the title for the sign in page. And there’s more json alongside these translations that handle the logo, again the redirect URI, the okta ClientId, some nonce, and other authParams that are needed for the signin.

    I guess from here my next steps are to explore the okta signin widget repo on github. There I will find the javascript code they use to do the whole shebang. And I can find out what those OktaSignInConfig values map out to and possibly make my own calls with special handlers written for each specific signin use case. The okta signin widget can be found here:

    https://github.com/okta/okta-signin-widget

    These are the features and use cases the sign-in widget supports. This was taken directly from the Okta high-level overview page.

    Features

    The Sign-in Widget supports the following use cases:

    • Authentication: In addition to standard credential validation, the Okta Sign-In Widget also handles validation of password complexity requirements and will display common error messages for things like invalid passwords or blank fields.
    • Multi-Factor Authentication: The Widget also handles enrollment and verification of multiple authentication factors. It comes with built-in support for SMS authentication, security questions, and Google Authenticator, among others.
    • Self-Service Password Reset: Support for sending reset notifications as well as prompting users to verify themselves by prompting them to answer a security question.
    • Password Expiration: The Widget can notify users when their password has expired and prompt them to update their password before allowing them to sign in.
    • Validation and Error Handling: Extensive support for validating user input as well as handling every imaginable error condition which might occur in a user login flow.

    I’ve been meaning to get the sign-in widget working with one of my original side project ideas, http://memelockerz.com.

    Oh, and it looks like I did have the sign-in widget loaded in. It just wasn’t working correctly. If I remember correctly it had something to do with the callback URI that you have to set it up with. It also could possibly not work due to memelockerz.com not having an SSL certificate. Oh well, I’m getting a bit into the weeds here. I will end up using Let’s Encrypt for this SSL business as well.

    Well I will have to come up with something tomorrow!


    I had unpublished this post because I found the exact thing I was looking for in the Okta documentation. Here:

    https://okta.github.io/code/react/okta_react#create-a-custom-login-form

    But now I am going to do my best to publish and mesh this blog post with the instructions that were laid out there.

    It might honestly just be a very minor tweak. There’s only one line in this okta tutorial that I’m really missing. The rest is just logically hooking up the Redux store in the background…for what seems like shits and gigs at this point, but whatever.

    Well I think it works on local. There was a bit more config to set up. And I worry that I’m copy and pasting too much code into this. But I can’t push and test it out on QA yet. So I will have to wait and see.

  • Butchering This Mastodon Install

    So this is Day 2 (3?) of mastering this mastodon install. And by mastering I really mean just installing it for the first time. This thing is a mess of ruby and npm dependencies. And I’ve run into probably 15 solid roadblocking errors that I’ve had to fight my way through with their obtuse error messages and the rare issue post on GitHub. I’m trying my best to document the fixes I have to do in the issues that I can find on GitHub. But so far I’m only at two answers to some issues I had when following this guide:

    https://wogan.blog/2017/04/09/getting-started-with-mastodon/

    I really liked this guide, despite the issues I’ve been having with some of the steps. Part of the reason I’m running into the issues and getting blocked is because I’m not used to rake error messages, and some of the other ruby-related powertools that come into play. I’ll try my damndest to get this bitch working. But there’s a lot of disheartening error messages that flood the way. Here’s to hoping I can get it working sometime this year… (next 6 days)…

    I should also be trying out the official production guide:

    https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md

    Two of the biggest issues I ran into were errors with:

    After reading the production guide for a few minutes I think I may have been in the wrong for using an 8 month old tutorial on the mastodon install (Last updated April 2017)…


    I finally got it. I had run into like 3 more issues after this post update, and that took about 6 more hours to debug. Looking through logs like the nginx logs, the different system service logs (like for mastodon-streaming.service), and my own logs that I ended up making for the cron job. If I could list out the problems roughly right now it’d look like:

    • Server gone away, getting lots of Server closed connection or not found responses (SSL issue, incomplete nginx config)
    • npm not found, a double node.js install >:O
    • Email issues, used wrong mailgun login info
  • Bat For Lashes

    Bat For Lashes – What’s a Girl (To Do)

    I was wondering what the name of this song was again because I can only remember it by what’s happening in the video. And then I remember bits and pieces of the song. But it was actually hard to find a good quality version of this song. It’s not on YouTube, but it was on Vimeo and DailyMotion, both from it’s original posting in 2008. So that means it was in 360p, or barely in 360p. I thought I was screwed, and I came here to log this as a time where I had wished I downloaded that amazing video ((the whole music video is done in one shot)). Fortunately, I decided to give it one last google search, and I found this higher-res version posted in 2017. So here you go.

  • React Native App + Expo

    I was sick earlier and needed to take a nap. What could have been just a mild 2 hour nap turned into a 6 hour one. And then I woke up at 9pm feeling fully rested and looking for something to do.

    I have been thinking a lot lately about using React Native. I wanted to use it as a stepping stone to get myself acclimated to iOS and Android development. There’s a couple projects where I could use it. Memelockerz is one. And Mealinator is another. –Of course, thrillhouserad.io could have the admin capabilities built into a special account on the native apps. And definitely maybe the pizza boys delivery site…Or at least a notification app for the delivery boys.

    It seems to be as easy as people have described it. After perusing the front page of the React Native site I found this “Getting Started” document and was not surprised to see a “create-react-native-app” npm package, similar to “create-react-app”. Here you can “eject” and such from the main project to help you add more custom react native libraries and features. Then I saw how they do their development server, and it seems pretty rad. It seems you just install this expo app on your phone that takes pictures of a QR code your command line spits out. Then it routes you to your app running on a dev server. I’m not sure how free that can be, but god damn does that make a good use of a QR code.


    And writing an update what appears to be almost 3 full weeks after…I see I got stopped along the way somewhere.

    And after doing it again, I remember that I got stopped on the gaht-damn initial create-react-native-app command…something about the network taking forrreeeevvveeeerrrr to download the necessary packages. WELL. Now I’ve done it. And the command works this time.

    Well that’s fuckin awesome. You load up Expo app on your phone, grab a shot of that QR code your terminal’s spittin’ out, and away you go. Apparently you can add code on your computer and this bitch is gonna auto-reload. Let’s see how fuckin’ fast that task is really…

    WElp….on my first save of APp.js…nothing fucking happened….

    So I had to shake my phone, get at the developer menu, and manually clicked reload. Then it reloaded with my “BLAZINGLY FAST” text addition to the code.

    Ah well, that’s okay. I’m sure that’s not the behaviour that was intended by the developers, but I can work with this.

    Oh, okay, after playing around a bit and coming back… Now when I’m adding text elements and decorations I can see it reloading and displaying on my phone…Cool!


    my-project has been the result of all this. But I did have some more testing weirdness that showed a fair bit of lag before I could be seeing my results or an error on screen. My app currently shows a picture of 4 different kind of banana shaped fruits…And then a bunch of silly text modifications from the getting started pages. I’m gonna try adding a camera button in a moment..

    Aaand nope…Looks like I need to include some native libraries, and have some sort of ejected app that I’m working on, which would require the use of Android studio. So I’m not gonna mess with that at the moment:

    https://facebook.github.io/react-native/docs/linking-libraries-ios.html

    I also had trouble importing a new file with my own custom React components. The two files I tried failed to do anything besides generate errors when I tried to use their components inside my main App.js file. Something about invariant violations… ;P

    But so far these pages have been a great help:

    https://facebook.github.io/react-native/docs/getting-started.html
    https://facebook.github.io/react-native/docs/components-and-apis.html
    https://facebook.github.io/react-native/docs/props.html#content
    https://facebook.github.io/react-native/docs/linking-libraries-ios.html
  • Map Custom Circuits to Google Maps

    So I’ve been talking about this idea as part of a project for a while now.

    But if there’s anything I’ve learned the past few months it’s that it’s worthwhile to get started on those ideas that are only parts of a project early. That way you can see some progress, run into some issues, and make better decisions down the line.

    Anyways, for this idea I want to be able to draw routes for custom “race” circuits over a commonly used map interface, like Google Maps or OpenStreetMaps.

    The end goal was originally for this to be a part of my grand racing sim that was going to be a pound-for-pound replica of greater Chicagoland. Initially I’d start off with these circuits that I’ve drawn on the maps. Some of them inspired by real drives that I’ve been on for those roads. And eventually I’d like to see a frickin’ race go down in the loop or on Lake Shore Drive. I feel like the city is designed perfectly for that, and we could stand to learn from a few tournaments of fucked up traffic that would stem from it. Like there’s no way Chicago could handle an Olympics, but Chicago could start planning for if they allowed something like an Indy race.

    I’ve got a pretty good scope for an initial product for this.

    1. Allow a user to click and paint routes over the roads they want to drive the circuit on
    2. Enable saving by taking a snapshot of the circuit and storing it in a database with a unique key
    3. Allow a user to reload a previously saved circuit from their account
    4. Allow a user to load a snapshotted circuit via the unique key
    5. Allow users to load each other’s circuits if they have a URL with that unique key attached

    I have no idea what to name this thing, but I’m sure I’ll come up with something atrocious later on.

    Expect to see more about it, as well as some other brand new things, on the new “whatjacksupto” website I’ve been working on.

  • Using gmusicapi for the automatic playlist downloader

    I got the gumption to install python on my mac…and homebrew, regrettably…I thought I could go a lot longer without having to install that package manager…Anyway, I installed python, pip, and then gmusicapi using pip. And since then it’s been relatively trivial to extract information from my Google Music account. This should make keeping an up-to-the-minute updated radio station all the more closer to becoming a reality.

    I can use the features of gmusicapi in a script that will download the latest information from all my playlists and save them in a txt file. Then I can have another script run that searches each song name on youtube using another python-based program, youtube-dl. Then youtube-dl will save each of the songs into a folder as MP3 files, skipping the ones it already sees in the folder by way of a command line switch I’m presuming exists.

    Afterwards, I’ll really need to make sure that I manually go through and MP3 tag any of the erroneous tagged files or missing ones. I can script out mp3tag to automatically run through the ones I’ve already discovered, like splits on “-” or ” – ” or ” “, you know, like delimiters in the “song artist – song name” tagging system used by uploaders on youtube. Scripting it out will miss some by default, and some may be flipped around because there are those people who deviate from that tagging system. But I can fix those as I see them, and maybe have some people help me mp3tag everything properly.

  • Radio Server Back Up – Along with bot improvements

    Well my Radio server took another crap while I was getting things back up today. I experienced the same issues my sister was having with the machine when I was troubleshooting things with her over messenger while I was on vacation. The machine would turn itself off when jostled or whenever the windows updates got hung up. I think the problem is two-fold. I suspected the power cord was faulty so I brought it back upstairs to sit next to my main PC again while I make it stable again.

    I have some planned upgrades for the machine:

    1. 5.1 Channel Sound Card
    2. Record Player Hooking Up
    3. 2 4TB 3.5″ HDDs
    4. 250W Dell SFF PSU (I think the PSU might be bad as well)

    These things are ordered because I plan to do the upgrades as I find money for them, and then test to see if I need the 250W replacement PSU. I can also do some power tests with a KillAWatt to see how much power the thing draws when it’s just up and running after plugging in headless with all the upgrades. Maybe it will shut off still and not draw that much power. That should tell me what to do with the possible upgraded power supply.

    I also want to hook up the record player and write a script that periodically checks the new soundcard’s input for any incoming sound every 15 seconds. If it notices that I’ve started playing a record I think I could script it so that I pause the current song in foobar and switch over to using b.u.t.t. or some over foobar2000 plugin that will stream my mic’s input into Icecast. And then when it senses there’s no sound coming out of the record player, switch back to foobar and un-pause the previously playing music.

    The sound card is coming today. And I’m going to install that and try the ol’ 3.5mm audio cable connecting and see how it sounds in discord. I don’t think it’ll be much better but whatever. It will also free up a 3.5mm audio mic input that I can attach the “2nd Room” Outputs of the receiver to. Just ended a sentence with a preposition. Good golly me.