Tyrel's Blog

Code, Flying, Tech, Automation

Jun 07, 2023

pfSense

This week I finally got a machine that is solely to run pfSense. I didn't want to spend _too_ much money so I bought a $200.00 Qotom Firewall Q330G4. This was great and easy to set up.

First I bought a Netgear WAC104 and installed OpenWRT on it. Simple enough. Then I put that into bridge mode, so it's just an Access Point and not a "smart" router too.

Then I put my Linksys EA9300 into bridge mode and behind the pfSense machine (into a switch) and couldn't access any of my server's sites.

After futzing with that for a couple days, I finally figured out the problem. I thought I was behind a double NAT, but I wasn't. When I moved my EA9300 from my sole WiFi router, to behind the pfSense machine, I neglected to change some settings on my AT&T modem.

You see — dear reader— when I set up this network on my AT&T Modem, I had to enable Passthrough mode. This, was set to a MAC Address, not an IP Address. So when I was making sure to keep my IP network on the same 192.168.1.1/24, I thought that was all I needed.

Alas, there's a dropdown to pick the MAC address of the machine that everything passes through. I can now access my bookmarks, notes, ebooks, and plex server!

Thanks to my friend Daniel (@sanitybit) - who was a great rubber duck and gave me some pointers when I was debugging, and also helped me find the hardware for the pfSense box!

 · · ·  networking

May 26, 2023

Emulation

I haven't had much time lately for blog posts, I've been dealing with bed time routines with my newborn, and once those are done, I get a few hours of alone time for computer things.

Lately I've been toying around with Amiga OS, FreeDOS, Windows 95, and Apple IIe things.

I got a raspberry pi and installed Pimiga, got a fun set up and that was neat. I then installed Amiberry on my macbook, with some remote hard drive images on my samba share, and I have a consistent setup for Amiga on any machine in the house or on tailscale.

I then decided to install FreeDOS to a barely used Dell Vostro 1720 and install to that. It works great, I have WordStar, TurboC, and more installed and it's fun to get back to my roots in that way.

After that I decided to install Windows 95 with 86Box, did the same with remote hard disk images, and got that running. Been toying around in Visual Basic 6, Oh the memories!! I installed that so I could play Lego City, but having voodoo graphics errors I need to figure out before I can play.

I also ordered an Apple IIe emulator machine that runs on an Esp8266 from CT6502 and it works great. So cool just tossing a disk image on the MicroSD card and loading it up. The downside to this is I can't figure out how to swap disks in realtime, so I can't play Ultima, or any multi disk games. I can however load .hdv files so if something comes with a hard disk image.

Not really much for a tech post, and nothing to share codewise, but thought I'd break some radio silence. I also imported my flying blog here, so I added the Flying category/tags.

 · · ·  emulation

May 26, 2023

Neovim, Nix, Telescope, Tree-sitter, Mason

I made a mistake with not reading CHANGELOGs for all my packages in Neovim this week. This sent me down a small rabbit hole trying to fix all the things.

What happened is I ran :PackerUpdate which, pulls the latest version of Packer packages, good, updates! But... Telescope has a new requirement on main branch that requires Neovim 0.9.0. The problem is that the latest NixPkgs for Neovim right now is 0.8.1. I ran to google, tried to set an overlay to use neovim-nightly, but that didn't work. If you recall in Dotfiles - My 2022 Way I'm not actually using NixOS so (please correct me if I'm wrong) overlays don't work. I tried specifing a version in my programs.nix, I tried a bunch of other things at 1AM that I don't remember anymore.

Almost ripped it all out just to use Nvim 0.9.0 on this machine until NixPkgs has updated the repo. I decided that was the wrong idea, and went to sleep.

Tonight, I was able to figure out that in Packer, you can pin a commit!

It's clear in the docs, but I was trying to fix it at the Nix level, so I didn't immediately think of this, even though at my last job, Tidelift, I was doing package pinning analysis! Derp.

So, I added commit="c1a2af0" to my use statment in plugins.lua and Telescope started working again without a warning, or issue. Commit.

That wasn't the only problem though. In my infinite wisdom, I followed some reddit posts that I won't link to, that suggested deleting ~/.local/share/nvim and rerunning PackerInstall, the problem there -- my tree-sitter configs are in my nix files.

This is an issue I need to look at later, but in my programs.nix file, I some reason have two entries of plugins =. I had to uncomment the first one where I inject tree-sitter, and comment out the second setting. Then rebuild my nix flakes.

After that,I had to comment the first, uncomment the second, and rebuild with withAllGrammars config.

This worked, I had my rust tree-sitter configs working, but was missing rust-analyzer.

That's in Mason! So I ran :Mason, found rust-analyzer slapped that i button, and I finally had my system back after 2 days of issues.

This was mostly a blogpost so I can reference back to it in the future, but hopefully at least _someone_ learns to pin your dang nvim Packages!

 · · ·  nix  nvim  rust

May 26, 2023

Set Environment Variables with LastPass

I have to use LastPass at work, and I store some API keys in there. Rather than copy/paste and have the actual api key on my terminal, I like to use read -rs ENV_VAR_NAME to set environment variables, so they are hidden from scrollback.

Recently my coworker set something up that we need an environment variable set up for running some Terraform commands. I don't feel like pasting it in every time from LastPass, so I figured out how to set this up and automate it. I'm sure I've already talked a lot about how I love direnv and I maintain a lot of different .envrc files for work things. For my last team I had one per repo! Well direnv comes to the rescue again.

  • The first step is installing the lastpass-cli.
  • Then you need to set it up so you log in, how you do that is up to you. I have lpass checking status, and if it exits nonzero, then running lpass login again in my direnv.
  • After that you can use lpass show and capture that in a variable to export your API key as an environment variable.
lpass status
if [ $? -ne 0 ]; then
    lpass login email@address.com
fi
export API_KEY=$(lpass show "Secret-Name-Here" --password)

Example .envrc file.

I love automating things, and when a coworker says "oh no we have to do this"... I run to automate it!

 · · ·  bash  automation  work
← Previous Next → Page 3 of 16