Adding Digital Ocean to Flask-Dance

Posted on Fri 13 November 2020 in conveyor • Tagged with flask, python flask-dance

In the last article we learned how to set up and use a Digital Ocean Oauth app. Now that we understand how that works, let's make all of that hard work more accessible to the rest of the Flask community. Flask-Dance is an extension that is used to complete the …


Continue reading

OAuth with Digital Ocean and Flask

Posted on Tue 03 November 2020 in conveyor • Tagged with python, conveyor, flask

The OAuth flow can be confusing the first time you do it. This article and example project should help you feel more comfortable specifically for people who would like to use OAuth with Digital Ocean.

The code for this application can be found at https://github.com/mikeabrahamsen/flask-digitalocean-oauth-example

Conveyor …


Continue reading

How to create a KVM template on Arch Linux

Posted on Fri 30 October 2020 in arch • Tagged with arch, kvm, qemu

If you are deploying many virtual machines, templates can be leveraged to save time and even storage if using thin provisioning.

The process of creating a template is two steps:

  1. Create and configure the base operating system image
  2. Use sysprep to remove system-specific settings

Once completed we can create virtual …


Continue reading

I am a bad developer

Posted on Fri 23 October 2020 in python • Tagged with python, development

I write terrible code.

Often, the work I do is in isolation. I'm not working with a team, adhering to any coding standard. I would best describe the code I write as thinking out loud. A series of non-cohesive statements testing out reactions. It is undoubtedly "bad" code.

There is …

Continue reading

How to structure Flask applications part 2 - Growing up

Posted on Fri 16 October 2020 in python • Tagged with python, flask, webdev

My first introduction to Flask was Miguel Grinberg's original Flask Megatutorial. After using Django as my framework of choice for several years. Miguel's simple use of Flask allowed me to see just far enough under the hood that I started understanding much more of the web stack, hidden in some …


Continue reading

How to structure Flask applications part 1 - Small Apps

Posted on Fri 02 October 2020 in python • Tagged with python, flask, webdev

One of the benefits of using Flask is it is straightforward to get an application up and running. When you are first starting, you can create your application with a single file. The structure of the application is left entirely up to the developer.

Starting with a single file application …


Continue reading

Arch Linux installed on ZFS

Posted on Fri 25 September 2020 in arch • Tagged with arch, zfs

ZFS is both a filesystem and a volume manager. If you have extra RAM in your system it will increase the read speed of your system dramatically by caching the system's most-used files in RAM.

How to use ZFS:

  1. The easiest way to use ZFS with Arch Linux is to …

Continue reading

Building Dynamic Web Applications with Python primer

Posted on Fri 18 September 2020 in python • Tagged with python

If you are a full-stack developer, whether you like it or not, you are going to use Javascript. It's an incredible language that allows developers to create dynamic applications. The amount of Javascript you use is up to you. Javascript can be used to power an entire application or it …


Continue reading

Using Brave Browser flags in linux

Posted on Sun 23 August 2020 in dev-journal • Tagged with developer journal

The easiest solution to add flags to your Brave Browser startup is to use the brave AUR package. It has a brave-launcher script that will check for a .config/brave-flags.conf file. All you need to do is create and populate the .config/brave-flags.conf

Alternative if using the brave-bin …


Continue reading

Grub Boot repair

Posted on Wed 19 August 2020 in dev-journal • Tagged with developer journal, linux, grub

One of my servers had a failure over the weekend and caused some corruption of the boot loader. This is the first time I have experienced this with a setup built on LVM and LUKS, which provided a little extra complexity to solve the problem.

This time, the Ubuntu Boot …


Continue reading

Incremental UI improvements

Posted on Tue 04 August 2020 in dev-journal • Tagged with developer journal, conveyor

Small UI updates today

Added a card to show additional information:

info card

Just for convenience a link was added to get from the register screen to the login page.

Add link back to log in


Vim regex grouping

Posted on Tue 28 July 2020 in dev-journal • Tagged with developer journal, vim

Wrote a regex in vim today that used a grouping in the find and replace. Needed to update 936 instances..

From a statement that calls a custom module function {% if entry.getEnableVal('conveyorDevToggle') == 1 to be a simple statement.. {% if entry.conveyorDevToggle %}

This is the regex used: :%s/\ventry.getEnableVal …


Continue reading

Overhauling the registration page

Posted on Fri 24 July 2020 in conveyor • Tagged with developer journal, conveyor

In this iteration a few small changes are going to be made. Here is the current state of the Conveyor registration page:

2020-07-23-210006_1455x812.png

Here it is after the following changes:

  • The width of the form imports are too long
  • Add a referral code input
  • Make the submit button smaller
  • Right align …

Continue reading

Recaptcha Uncaught (in promise) null error with Flask

Posted on Fri 24 July 2020 in dev-journal • Tagged with developer journal, recaptcha, flask-wtf

When trying to implement Recaptcha2 Invisible with Flask-WTF I ran into the following error:

Uncaught (in promise) null

This seemed to be a pretty obscure problem as I could not get any additional information from the application about what was going wrong. What finally got me to the solution was …


Continue reading

The newgrp command

Posted on Mon 20 July 2020 in dev-journal • Tagged with newgrp, linux

newgrp is a convienient command I ran across today. You can run this command after you add your user to a group. This allows you to continue without having to logout and log back in for the group changes to take effect.

Here is the man page:

 Manual page newgrp …

Continue reading

Developer Journal: 19 July 2020

Posted on Sun 19 July 2020 in dev-journal • Tagged with developer journal

Finished documentation for a client website. Remove database backups that are more than 30 days old

Otherwise a server maintenance day:

  • Cleaned internals of home server
  • Ran RAM test as I have had some crashes a couple times
  • Loosened the CPU heatsync screws a half turn each. There are reports …

Continue reading

Adding Matomo to Pelican Flex theme

Posted on Wed 15 July 2020 in dev-journal • Tagged with developer journal

After setting up an account with Matomo you can add the following to your peliconconf.py file.

# pelicanconf.py
MATOMO_SITE_ID = 2
MATOMO_URL = "ma.matomo.cloud"

Remove spaces from filenames

Posted on Wed 15 July 2020 in dev-journal • Tagged with developer journal

Here is a great little bash command to remove all of the spaces of a filename and replace them with an underscore for all files in the current directory.

for f in *\ *; do mv "$f" "${f// /_}"; done

Changing struts on a 2005 Toyota Corolla

Posted on Sun 12 July 2020 in dev-journal • Tagged with corolla, toyota, vehicle

This also applies to 2003, 2005, 2006, 2007, and 2008 models.

With 152k miles it was finally starting to feel time to replace the suspension in The Rolla. Replacing the struts in a 2005 Corolla is a fairly easy task.
I was planning 4 hours just to replace the back …


Continue reading

Developer Journal: 09 July 2020

Posted on Thu 09 July 2020 in dev-journal • Tagged with developer journal

Spent some time today working with Github actions for the first time. I set up a workflow that allowed me to lint the repo and run the tests on push.

Of course, this meant running my tests for the first time in a different environment and there was 37 tests …


Continue reading

If you were granted a wish, what would it be?

Posted on Wed 08 July 2020 in dev-journal • Tagged with developer journal

Today I was filling out a survey for a product I signed up for Python Morsels to help continue my Python education and one of the questions was:

If you could wave a magic wand (written in Python) and I could grant a wish, what would suddenly be different for …


Continue reading

Paving the way for Python 3.8

Posted on Wed 08 July 2020 in conveyor • Tagged with flask, conveyor, migrations

Currently Conveyor will install Python 3.6 when you create a server as 3.6 is the version that is used with Ubuntu 18. However, it would be great to have the ability to install more recent versions of Python and be able to use different versions depending on the …


Continue reading

Adding a test for the new site button

Posted on Tue 07 July 2020 in conveyor • Tagged with flask, conveyor, testing

When refactoring the new flow for creating a site the + New Site button was removed so there was only one option to add a site. If you already have a site with Conveyor we need to make sure the add site button is available.

To start I have written two …


Continue reading

Open markdown links in a new tab

Posted on Tue 07 July 2020 in dev-journal • Tagged with developer journal, markdown

While this is not supported with all Markdown interpreters, the following will work with Pelican and many others. You can add {:target="_blank"} following the Markdown link.

[Conveyor](www.conveyor.dev){:target="_blank"}

Here is an example, this link will open in a new tab: Conveyor


Return all items from a Github resource from the API

Posted on Tue 07 July 2020 in dev-journal • Tagged with developer journal, github

If you want to get the list of repos (or any other resource) from Github, the items are paginated once there are more than 30. Here is an example of how you can use a recursive function to follow the pagination and return all items of a particular resource.

Given …


Continue reading

Reset UUID of virtualbox disk file

Posted on Wed 01 July 2020 in dev-journal • Tagged with virtualbox

Use this command to reset the UUID

VBoxManage internalcommands sethduuid ubuntu-vm/xubuntu-vm.vdi

Port forwarding in Virtualbox

Posted on Tue 30 June 2020 in dev-journal • Tagged with virtualbox

The virtualbox port forwarding dialog will be filled in to look like the following:

Add ssh port forward

The part that is always difficult to remember is that the guest ip address is 10.0.2.15.

To connect to that vm now

ssh -p 2001 [email protected]

Developer Journal: 29 June 2020

Posted on Mon 29 June 2020 in dev-journal • Tagged with developer journal

I so rarely need to run raw SQL queries that I have to look up how to use joins every time I need to use one.

sudo mkfs.ext4 /mnt
sudo gpasswd -a michael-abrahamsen storage

short LVM reference sheet

Posted on Sun 28 June 2020 in dev-journal • Tagged with developer journal

Creating a logical volume

sudo lvcreate -L 250G vg0 -n vms

Add livestream video stats to Google analytics

Posted on Wed 24 June 2020 in dev-journal • Tagged with developer journal

How can you get more granular stats for a livestream video? One option is to use Google analytics and google tag tracking.

https://www.analyticsmania.com/google-tag-manager-recipes/youtube-built-in/ has a great resource on how to set up a events with google analytics. I used this page as a resource when …


Continue reading