tomfordweb.com:~$ 

Using recursion in Typescript types

The following technique allows the developer to define recursive types with typescript. While I would not suggest important data conforming to this type, I feel like using a data structure we are all familiar with such as JSON makes it easy to explain the idea. Given the folowing example. You can see that the key value interface allows us to define a generic type for the objects values. The object can be any size of keys. The interface lets us define simple flat objects with one (or multiple if…

Manage your infrastructure with Ansible in github actions

Managing your assets with Ansible is a great way to easily configure and manage services upgrades. Things will break with any app eventually, and the true benefit is not having to remember how to configure a server weeks or years after you have finished the project. This tutorial will walk you through setting up an Ansible project in github actions, and provide a base repository to manage your server. Prerequisites Basic Linux Knowledge ansible installed locally. This is not a requirement, but…

Use docker to generate SQL insert statements from a CSV file

Importing large amounts of data directly from a CSV into your database via SQL workbench or any other visual editor can be a tedious, and very time consuming task - especially if you are connecting via ssh. I have written a small docker image that will load the contents of your .csv and create an SQL dump. I have imported dumps from this into a postgresql database, but it should work on any SQL database. You can view the repository and the container registry on my gitlab account. Pull requests…

Automatically push to your container registry with Gitlab CI on tag push

In this post I will describe how to host your docker builds in your own gitlab docker registry. In addition, whenever a tag is built for the repository, a new image will be generated and pushed to the repository. Project Setup If integrating this into an existing proejct, you can skip this part. We will push the docker hello world image to a registry in gitlab. First, create the a new blank project on gitlab Your registry must be public. Then, run these commands. Pushing to your container…

Run Scrapy inside of a docker container.

Scrapy is a python library that allows you to scrape and interact with content on the web. However, until you get to the advanced usage it is meant to be run client side. Running scrapy inside of a docker container will allow you to run your spiders in the same environment across all instances and make it easy to import your scraped data into any project. Project setup To begin, we will create the directory, the git repository and the base Dockerfile . Docker image creation scrapy needs the…

© 2025 - tomfordweb.com