Ben's Corner Blog

Career Engineering By Tracking Work Faster With Command Line Jira 2021-02-11 | 727 words

Thank you Matt Doar and Josiah Bradley for reviewing this post. TL;DR: go-jira is super nice. Creating Jira tickets is necessary, slow, and annoying Tracking my work is super important. At Linkedin, w…

SQL Schemas from the Terminal with SchemaSpy 2021-01-17 | 306 words

I'm building an app backed by MySQL and I need to easily see what its columns are and how they relate to each other so I can write good SQL queries against it. Fortunately, the database geniuses inven…

Creating an Azure Key Vault Certificate with Go 2020-11-29 | 1004 words

So... I need to make a TLS certificate in an Azure Key Vault with Go. I thought this would be easy - just authenticate, then make the certificate. However, the Go SDK seems mostly auto-generated and i…

My Workstation 2020-11-15 | 584 words

Desk - I bought an Uplift Desk from https://www.upliftdesk.com/: Desktop Style: Rustic Reclaimed Fir (+$500.00) - in hindsight bamboo would have been cheaper, probably lighter, smoother (the reclai…

Sad Work-from-home Meals 2020-11-01 | 109 words

When the office closed during the pandemic, my work stopped feeding me daily and I, like so many Bay Area tech workers, was forced to cook for myself. We bedraggled individuals banded together on our …

JSON JQ Snippets 2020-05-02 | 114 words

Here are some snippets for use with jq and some other random JSON tips. See "path" to element Open it in VS Code, put your cursor on the part you want to know about and check out the breadcr…

Long Shell Oneliners Without the Pain 2020-04-16 | 463 words

I love working in my terminal. It has a ton of useful programs that you can stitch together to do useful things. However, sometimes these commands can get long. For example, here's a command I use to …

Useful Checklists 2020-12-17 | 453 words

These are fairly small lists that I want to read every once in a while. Releasing Software for Humans Design from the user perspective Don't advertise until close to finishing Timing is important. Do…

Software Engineering Ideas That Influence Me 2020-09-10 | 1132 words

I watch a lot of conference talks on YouTube and I read a lot of software engineering articles. Some of that media has really helped me become a better engineer. As a relative newcomer to engineering,…

Bible Verses About Charity 2020-12-10 | 2984 words

These are some of my favorite verses about love. Click the header to go to read the entire book chapter and the text to expand the verse selection inline. All verses are in the King James Version (KJV…

My Favorite things in Arkansas 2020-02-09 | 165 words

Some of my favorite things in Arkansas: TODO: add pics Food Maddie's Place - great steak Lindsey's Hospitality House - BBQ! Corky's Ribs & BBQ - Dry ribs, extra dry rub Eat My Catfish - great for…

Getting Started with Podcasts 2019-07-21 | 429 words

Do you like history or news or science fiction? Do you drive a lot or like to listen to things while you work? If so, you should really try out podcasts! Podcasts are audio shows that you can find on…

Learn Python 2020-09-04 | 792 words

Python has exploded in popularity recently. There are great reasons for this. It's famously one of the easiest programming languages to learn and it has a bunch of great libraries for things like data…

Jupyter Notebooks with Plotly 2019-04-18 | 273 words

Plotly is my current favorite Python graphing library. Here's how to use it with Jupyter Notebooks Install Anaconda Python Install from the website. If it gives you the option to add Python to the PAT…

Favorite Recipes 2019-08-08 | 2299 words

These are some of my favorite recipes that aren't from the internets. Ones from my Grandma Howe are prefixed with "Grandma Howe's ". Some of them have other sources in the recipe that I'm pl…

A Simple Go JSON API Server with Tests 2018-12-10 | 441 words

I'm trying to make a small bookmarks server. I'm using code similar to this to create a server, and test 2 GET APIs. I'm incorporating the following ideas from Advanced Testing in Go: Subtests/Table…

Listening to Videos on Android with the Screen Off 2018-12-10 | 126 words

Android apps can make it surprisingly difficult to listen to videos. Often times, I want to turn on a video, then just turn the screen off and listen to it. Luckily, FireFox with some plugins will let…

Jupyter Lab on Docker 2018-10-24 | 282 words

Assuming you have Docker installed, setting up a basic Jupyter Lab environment is pretty easy! I'm going to be installing the jupyter scipy-notebook. The following command mounts a directory with the …

Setting Up Static IPs and DNS 2018-10-09 | 297 words

I want machines on my network to be able to talk to each other via hostnames (fqdns). Here's how I set that up. Router On my local router (a TP-Link Archer C3150), I set up static IPs for each device.…

Short BASH Snippets 2021-01-20 | 666 words

BASH script starter I put this at the top of all my scripts because most of the time I want scripts to fail on errors, and half the time I want the script to run in the directory it's in. #!/bin/bash…

Logging in Python 2019-11-05 | 748 words

The logging module is rather confusing, so I use it with code similar to the following. Logging is fun to add when netmiko isn't doing it's ***ing job and I hate everything about computers and I serio…

Go Notes 2019-08-25 | 186 words

These are things I want to remember in Go Format Strings %+v is introduced by Dave Cheney's errors package. A common use case: if err != nil { // Add a stack err = errors.WithStack(err) …

My Favorite Text Diagram Tools 2019-04-08 | 284 words

I love that diagrams can make difficult concepts intuitive. I hate that generally they're stored in opaque binary formats, which make them difficult to version control, and that generally they're crea…

Pork Loin with Apple 2019-03-10 | 79 words

NOTE (Sun Mar 10 - 2019-03-10 23:18:54 PDT) : I've moved this recipe to the Favorite Recipes post. I'll be removing this page after some time has passed. One day sometime last year (2017), I woke up a…

Grandma Howe's Cheese Ball Recipe 2019-03-10 | 212 words

NOTE (Sun Mar 10 - 2019-03-10 23:18:54 PDT) : I've moved this recipe to the Favorite Recipes post. I'll be removing this page after some time has passed. This is a cheese ball recipe Grandma Howe gave…

Grandma Howe's Povitica Recipe 2018-07-11 | 725 words

This isn't my usual computery blog post, but it might be the most technical. This is a seriously complicated bread to make. When I was younger, my whole family would look forward to the holiday goodie…

Learn Git 2019-01-26 | 435 words

Git is a famously powerful and famously confusing version control system used by software engineers everywhere. Increasingly, as other types of work begin to look more like software engineering (in my…

Short Python Snippets 2021-01-29 | 982 words

This is just a collection of Python snippits that are too small for their own posts. All code is for Python 3. Inline Multiline Strings This is a quick post on inline multiline strings. I like to use …

Ansible User Notes 2018-02-01 | 659 words

Ansible has two types of users: become_user and remote_user (and the deprecated ssh_user and sudo_user that I won't cover). Here's how to use them: remote_user is the account that logs into the machin…

Printing Objects in Flask 2018-01-22 | 520 words

Recently I needed to painlessly enumerate a (simple) Python object's properties in HTML to make a web page. I was creating different types of objects and I just wanted an easy way to print them. This …

Polymorphism in Handmade Hero 2018-01-12 | 693 words

A while back, while watching Handmade Hero, I watched Casey demonstrate one way to produce polymorphism without inheritance (and the vtable pointer dereferencing penalty it carries). He did this by us…

Fixing HTTPS CA Cert Issues 2018-01-26 | 903 words

Disclaimer: I'm very new to understanding SSL, and I haven't yet put in the effort to be authoritative about this subject. This post describes how to work with a modified chain of trust from a VM with…

Auto-printing Python Classes 2017-12-26 | 963 words

This article examines different ways to generate __repr__ functions. But, just to be clear, here are my recommendations in order: Immutable data: typing.NamedTuple (Python >= 3.5) collections.nam…

An Isolated and Reproducible Ansible and Vagrant Setup on Mac 2021-02-08 | 1318 words

Ansible is a great tool for automating system maintenance. This is how I install it. My notes differ from the official ones in the following ways: I install as much of this software as I can isolated…

Learn SQL 2019-03-26 | 477 words

SQL is one of the best benefit/cost skills to learn. It's fairly easy to learn, and it immediately becomes useful for many jobs- including software engineering, accounting, law, or any other job that …

Simple Blog Post Stats 2017-10-08 | 479 words

I got curious about the word count in my blog. When I generate the static site, I simply count whitespace separated strings as words, but this will automatically include code sections. To find out how…

Anaconda Python Bash Functions 2017-12-21 | 256 words

Conda Env Management I use conda for all of my Python projects. Because I'm so often making a project directory, then making a conda environment with the same name, I've created the following code to …

REST Server and Client in Python 2017-09-22 | 373 words

I recently demonstrated a very quick REST backend server and client in Python for an intern, and I thought I'd paste the code here. The Server The Server's job is to grab/calculate information from so…

Ansible Plus Flask 2017-08-25 | 354 words

I was lurking on the networktocode Slack channel, when someone asked how to get variables from an external system into an Ansible playbook. Intrigued, I mocked up a quick Flask server to serve a REST …

Changing words quickly with Vim 2017-10-15 | 507 words

I try to use Vim shortcuts to automate repetitive text-editing tasks. Here are two examples. Differentiating Code and Files While walking a user through an internal README, she mentioned that she want…

Dropbox as a systemd service 2018-01-02 | 403 words

If you've ever worked with Dropbox on Linux, you know that you basically download a script, untar it, and execute it. I use the following Ansible task to install it: - name: Install dropbox she…

Tiling Crosses (Linear Algebra in disguise) 2017-10-08 | 688 words

I was doodling with crosses on graph paper and was surpised to see that I could cover the graph paper with only cross shapes. They also look pretty neat when colored oddly, so I wrote code producing i…

RSync From Android 2021-01-17 | 485 words

Every once in a while, I like to transfer a folder from my Android phone to my Mac. This folder has new content added every once in a while, and the files get large, so I don't want to re-transfer the…

Reproducible Python Environments with Conda 2017-10-20 | 1070 words

By default, Python doesn't handle binary dependencies very well. There have been several occasions when I've tried to pip install library and it just choked on me because it was trying to compile som…

Windows Volume Control with AHK 2017-07-31 | 135 words

This is some code I use at work to control my laptop's volume and mute it when the I locked the device. It was born from the frustration I felt when frantically tying to silence my music while my cowo…

Path Name Conventions 2017-05-03 | 145 words

I recently did some BASH scripting that dealt a lot with paths. I want to record here for posterity the conventions I used to keep things straight, copied straight from the code. # Naming Conventions…

Creating a shared folder in Linux 2018-01-09 | 245 words

Sometimes it's useful to change a folder's setting so multiple users can access it. Here's how I do that. After this, all members of the group apache will be able to create files and directories under…

Troubleshooting Connections 2017-05-19 | 877 words

I recently had to set up a server with some legacy code that needed two database connections that just wouldn't connect. This is how I troubleshooted it Troubleshooting the first broken database conne…

Clearing Large Files 2017-12-26 | 259 words

I have a couple methods to clear large files. First of all, if the files are repetitive, logrotate looks to be the best way to roll. If not using logrotate though, here's a few methods I've found. Fir…

Easiest way to turn a Jinja2 template into an HTML file 2017-07-31 | 63 words

The docs talk about using the environment or whatever, but for my use case, I usually prefer the FileSystemLoader: import jinja2 as j2 # need a templates folder to look into (or change it to '.&…

Vim Color Schemes 2017-02-13 | 959 words

One of the joys of [Neo]Vim is the amount of color schemes available. The editor ships with several colorschemes by default, but adding more is what Vim was made to do! Before we begin, know that Vim,…

On Errors in Repeated Functions 2021-02-08 | 671 words

Recently I found myself parsing several similar XML files in Python. The XML had a deeply nested structure I wanted to get stuff out of, which means using Python's xml.etree.ElementTree's find and fin…

Saving YouTube Playlists to Android 2017-08-13 | 118 words

I use the following method to update the songs on my Android phone: Change to the correct directory cd ~/Music/YouTube Use youtube-dl to download my songs playlist. This answer on askubuntu was v…

Removing Passwords from a Git Repo 2016-12-26 | 180 words

When googling how to remove passwords from a git repository, I found this very helpful link. It was so helpful, I turned it into the following Python script: import shutil import subprocess as sp imp…

BASH Logging Function 2016-12-25 | 105 words

This is a small BASH logging function to record the output of a command: function logit { today=$(date +%Y-%m-%d.%H.%M) "$@" > >(tee "$1".stdout."$today".l…

Saving For Retirement 2016-12-25 | 539 words

I got an email a couple of months ago from a coworker about saving for retirement that included the following graph: Being very interested in retiring someday, I wrote a quick python script to calcul…

Setting Up PowerShell Updated 2016-12-25 | 213 words

I've streamlined and improved my method of installing PowerShell: First, run the cmd script as Administrator to install chocolatey and PowerShell version 4, and allow powershell scripts to be run. The…

Save Git Passwords 2017-08-04 | 39 words

I save my github usernames on my local machine with the following command: git config --global credential.https://github.com.username <my_username> If I mess up the command, I fix it by editin…

SQLite3 Snippets 2020-05-02 | 145 words

~/.sqliterc customizations The default sqlite3 shell can read from a dotfile! Here are some nice customizations for it This file can reloaded into the shell with the command .read <filename>. Th…

Vagrant and Chef 2020-03-20 | 319 words

Using Vagrant to play with Chef I'm using chef to provision some machines from Windows, and here's the process I did it with: On Windows Install choco and a modern Powershell. Install vagrant, virtual…

Quick Python Diff 2016-12-25 | 104 words

If you need a quick, cross-platform diff between files that makes a nice HTML document for your perusal, Python has your back: import difflib first_name = 'firstname.txt' second_name = '…

MySQL To File 2016-12-25 | 167 words

How To Use a MySQL command on the BASH command line If you want to print the output from the SQL commands in one file to another, use: mysql -u <username> --password='<password>' …

How I Blog 2016-12-25 | 673 words

Here are some notes about making blog posts (especially easily adding images). posts are in the \_posts/ folder. a post must be named according to the date and then the title of the post: \_posts/201…

Visual Studio with SourceTree 2016-12-25 | 425 words

When working on long or complicated projects, source control can save a lot of heartache. Git is becoming the standard source control tool, and I use a program by Atlassian called SourceTree to easily…

Wallpapers From Reddit 2016-12-25 | 370 words

A while back, I found a nice script to download wallpapers from Reddit. It originally only downloaded wallpapers from one subreddit at a time, so I made a fork to handle multiple subreddits and use a …

My First Real Post!! 2020-06-17 | 63 words

I hope to do many exciting things here! Here's a LaTeX equation: $$x^2 = 1$$

Setting Up PowerShell 2016-12-25 | 894 words

This is a post about how to use Powershell, the text-based interface to Windows. Now, why would we want to use Powershell? The biggest reason is automation. A person who knows Powershell can automate …