Skip to main content

Powered up surface cleaner.

· 3 min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer
Chat GPT
Chat GPT
AI

If you're tired of dealing with water spots on your dishes and surfaces, it's time to explore the power of a simple rinse aid. By creating your own DIY cleaning solution, you can achieve spot-free and shiny surfaces without the hassle of harsh chemicals or expensive commercial products.

tip

Get yourself a Gardena Pump Sprayer to keep in the kitchen full of this recipe, you will not regret it.

(ELI5) Why Vinegar (Acid) rinse aid is important.

Imagine your kitchen table is a bit messy with some sticky and greasy spots on it. You want to clean it up, so you grab a surface cleaner. Now, this cleaner needs to be really good at removing those sticky and greasy spots. That's where vinegar, which is an acid, comes in handy!

Vinegar contains a special acid called acetic acid. This acid is great at breaking down and dissolving things like grease and grime. When you spray vinegar-based cleaner on the table, the acetic acid goes to work by attacking and loosening up those sticky and greasy spots.

But why does the acid in vinegar do this? Well, the acid molecules in vinegar are like little superheroes. They have a special power that helps them grab onto the molecules of grease and grime and pull them apart. It's like they have tiny hands that can break down the sticky stuff into smaller pieces, making it easier to wipe away.

So, when you wipe the surface with the vinegar-based cleaner, it picks up all the broken-down grease and grime, leaving your table nice and clean. The acid in vinegar helps to make the cleaner more effective in removing those tough spots that water alone might not be able to get rid of

(ELI5) Why rinse aid is important.

Imagine you have a magic wand that can make things disappear, but sometimes when you wave the wand, a little bit of dust or dirt gets left behind. That's where a rinse aid comes in!

When you use a surface cleaner, it helps to remove dirt and grime from the surface. But sometimes, even after you clean, tiny bits of the cleaner can be left behind. These bits can make the surface look dull or streaky, and they can be hard to remove.

A rinse aid is like a special helper that you add to the cleaning process. It works by making the water slide off the surface more easily, without leaving any residue behind. It's like giving the surface a nice, clean shower after the cleaning is done!

The rinse aid helps the water to spread evenly and form a thin, transparent layer that dries quickly. This layer helps to prevent spots and streaks from forming on the surface, leaving it shiny and clean.

So, using a rinse aid in a surface cleaner is important because it ensures that the surface is thoroughly cleaned and doesn't have any leftover cleaner or residue. It helps to make things sparkly and streak-free!

warning

Rinse aid in rare cases can cause mild allergic reaction or dry out skin avoid direct skin contact.

Recipe

note

Rine aid used in this recipe is a 15% concentration, if you use a rinse aid surfactant with a lower ratio you may need to increase the ratio.

  • 500ml (500 Parts) Water
  • 15ml (15 Parts) White Vinegar
  • 15ml (15 Parts) Dish Soap
  • 7.5ml (7.5 Parts) Dishwasher Rinse Aid

Isopropyl Glass Cleaner.

· 2 min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer
Chat GPT
Chat GPT
AI

If you're looking for a simple and effective way to clean your glass surfaces, such as windows, mirrors, and glass table tops, you might want to consider making your own glass cleaner using isopropyl alcohol. This DIY glass cleaner is not only easy to make, but it's also much cheaper and more eco-friendly than buying commercial glass cleaners that are often filled with harsh chemicals.

Recipe

note

Isopropyl alcohol is a good solvent that can dissolve and remove dirt, oils, and other residues from glass surfaces, while the vinegar helps to cut through any grime or residue on the glass. The essential oil is optional, but it can provide a pleasant scent to the glass cleaner.

  • 240 ml (16 Parts) of water
  • 60 ml (4 Parts) of isopropyl alcohol (at least 70% concentration)
  • 15 ml (1 Part) of white vinegar
  • A few drops of essential oil (optional)
warning

It's important to note that this glass cleaner should not be used on electronic screens, as the alcohol can damage the sensitive coatings.

Instructions

  1. Combine the water and isopropyl alcohol in a spray bottle.
  2. Add the white vinegar and essential oil, if using.
  3. Screw the cap on the spray bottle and shake well to mix all of the ingredients.
  4. To use the glass cleaner, spray it directly onto the glass surface and wipe with a clean, lint-free cloth or paper towel.
  5. For best results, use a microfiber cloth or a squeegee to avoid streaks.
  6. Store the glass cleaner in a cool, dark place, away from direct sunlight.

Overall, making your own glass cleaner using isopropyl alcohol is a simple and effective way to keep your glass surfaces clean and shiny without spending a lot of money or exposing yourself to harsh chemicals. Give it a try and see the difference for yourself!

DRAFT POC Time limited Terraform resource implementation

· One min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

Input design

Timestamps

Terraform has reliable support for RFC3339 2020-02-12T06:36:13Z in order to decrease complexity this will be the only supported timestamp format.

Input variable

In order to allow the user to easily specify the start, end and a resource id a simple Terraform object variable can be made to fit most use cases.

variable "time_resource" {
description = "A map containing time limited resources."
type = map(
object({
start = string
end = string
})
)
default = {}
}

Logic

Utilizing the time_rotating resource is key to making this work, unlike the timestamp() it can be determined during the terraform plan stage.

Validating for Terraform docs in Merge Requests

· 4 min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

Terraform Docs is a fantastic helper when documenting Terraform code, but enforcing its use is not straight forward as it seems. In this post, I attempt to integrate it into a typical Gitlab CiCd pipeline as a validation step.

Problem

Developers must ensure the documentation for their Terraform changes is updated, so developers maintain quality docs.

Doing this separately to change requests results in sub-par documentation as the documents are no longer the responsibility of the user creating the change.

Enforcing this is harder than doing so with the terraform fmt and terraform validate commands. Enforcing docs are updated is difficult because terraforming docs are not part of Terraform but a separate tool that must be installed and is missing the ability to work with git diff natively.

Solutions

Terraform Docs Docker image

Terraform docs helpfully provides a maintained Docker image compatible as a part of any CI/CD Pipeline.

A validation step could be as simple as adding a pipeline step like the one below.

validate.docs:
image: quay.io/terraform-docs/terraform-docs:0.16.0
script:
- terraform-docs markdown --output-check --recursive .

There are some limitations with a simple application like the above example, especially if your Terraform code is that awkward Terrarmod phase of development where multiple terraform modules live in one repository. The recursive flag will not cut it.

You could use a simple looping function like the one below to ensure all docs are updated.

doc_paths=$(find . -type f -name '.terraform-docs.yml' -exec dirname {} + | sort -u)
for doc_path in ${doc_paths}; do
terraform-docs markdown --output-check --recursive -c "${doc_path}/.terraform-docs.yml" "${doc_path}"
done

The above works, but you now need to deal with the problem that the pipeline will fail if any doc is not updated, even if it is unrelated to the current terraform changes.

Git hooks

Git provides some handy functionality when it comes to Git Hooks. There are both server-side and client-side hooks we will be focusing on client-side.

note

A helpful stack overflow post helped me figure out how to add my hooks to a repository.

How can I commit Git hooks?

There are multiple hooks, such as pre-commit, prepare-commit-msg, commit-msg and pre-push; this is not all of them. You can learn about them here, but we will focus on the pre-push and post-commit hooks.

To create a git hook, create a script in the .git/hooks/<hook name> folder of your project and make it executable chmod +x .git/hooks/<hoook name>.

info

commit-msg works as it executes any time a user attempts to run git commit, but this could result in friction among users, so it is advisable only to use warnings and not to block behaviour.

info

pre-push is the perfect place to put blocking behaviour, such as ensuring changes never push to the main branch.

Due to the friction, if we interrupt a user every time they attempt to create a commit, we will only be using pre-push hooks.

Before we work on the code, it is essential to ensure the user is only interrupted by out-of-date docs that are part of the changes the user creates. Therefore, we will use git diff with the --name-only flag to get a list of directories that need to be checked.

default_branch="master"
git_root_path=$(git rev-parse --show-toplevel)
diff_dir_paths=()

getDiffPaths() {
diff_paths="$(git diff --name-only ${default_branch})"
for path in $diff_paths ; do
is_duplicate=false
dir_path=$(dirname "${path}")
diff_dir_path_string="${git_root_path}/${dir_path}"

for diff_dir_path in "${diff_dir_paths[@]}" ; do
if [ "${diff_dir_path_string}" = "${diff_dir_path}" ]; then
is_duplicate=true
fi
done

if [ ${is_duplicate} != true ]; then
diff_dir_paths+=("${diff_dir_path_string}")
fi
done
}

Using the code in the above example, we can use the array diff_dir_paths to identify what directories contain active changes.

terraformDocsCheck() {
if which terraform-docs 1>/dev/null ; then
for path in "${diff_dir_paths[@]}" ; do
config_path="${path}/.terraform-docs.yml"
if [ -f "${config_path}" ]; then
terraform-docs markdown --output-check -c "${config_path}" "${path}" 1>/dev/null
fi
done
else
echo "Terraform Docs not installed please install using brew install terraform-docs"
fi
}

Vault Helm DeploymentAudit logging

· One min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

The chart in question is the Hashicorp Vault Chart

Audit Log Persistent Volume (PV)

note

The Audit PV will not be used unless you configure vault to write to it.

vault audit enable file file_path=<server.auditStorage.mountPath>/vault_audit.log
Log Rotation

A possible way to implement reliable log rotation would be to add a side car log rotator like honestbee/logrotate

Enabling Audit logging to PV Can't be easier, simpy setting server.auditStorage.enabled to true will generate a PV and mount it on all vault pods.

Helm Values

server:
auditStorage:
enabled: false
# Size of the PVC created
size: 10Gi
# Location where the PVC will be mounted.
mountPath: "/vault/audit"
# Name of the storage class to use. If null it will use the
# configured default Storage Class.
storageClass: null
# Access Mode of the storage device being used for the PVC
accessMode: ReadWriteOnce
# Annotations to apply to the PVC
annotations: { }

Problems

  • Vault does not handle log rotation
  • Has to be configured after vault init
  • Potential issues from HA configuration

Best cleaning tips

· 3 min read
Cheryl
Cheryl
Professional Home Owner

Words of wisdom

Put on good upbeat music or a good TV show while you do it.

Don't think you have to "do it all at once". If you only have 5 minutes, do one thing. And that's fine. It's one less thing to do.

Don't overthink it. You mostly don't need anything special. Honesty, warm water and dish soap can clean 80% of your house.

Room Routines

tip

I usually keep a pack of biodegradable wipes in each bathroom and one in the kitchen. Easy to do a quick sink clean after (or while) I am brushing my teeth.

Kitchens

Wipe Down Cycle
  1. Put warm water in the sink. Don't overfill, but enough to dunk a rag.
  2. Put a teaspoon of good dish soap in it and swish around.
  3. Get a clean cloth. Wet it with soapy water, squeeze out excess water and wipe down the counters.
  4. Dunk, squeeze, wipe down the stove, rinse, and wipe the extractor fan.
  5. Dunk, squeeze, and wipe cupboard fronts, handles, and fridge door.
  6. Dunk, squeeze, wipe backsplash. Then, use the same cloth to wipe the sink handle and wash the sink
  7. Then drain the soapy water, rinse the cloth with clean water, and rinse the sink.
  8. Hang the cloth somewhere to dry well (balcony etc.).
  9. Finish by wiping the sink dry.

Bathrooms

warning

Don't use the cloth you cleaned the toilet with to clean your sink 🤢. This cloth you put straight into the wash, don't re-use!

Using the bathroom sink, you can follow the same formula as in the kitchen. But always do sink first, then shower/bath and toilet last.

Bathroom limescale

If you have limescale in the bathroom, you get "Kalk Reiniger", which works well.

Lounges, Bedrooms, Dining

A dry dust rag or duster on surfaces, then a good vacuum of floor and fabrics. And you should be good to go.

Reduce the need to mop

If you sweep (or vacuum) every day or 2nd day, then mopping once a week is fine. It would obviously be more if you have a pet or if it is wet and you are trekking muddy shoes through the place. But I'd say once a week is sufficient.

Wood or Laminate Floors

If you have wood or laminate floor, don't over-wet it. Instead, just use a damp cloth. Otherwise, the floor could be permanently damaged.

Git push New Branch

· 2 min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

Often I need to push a new branch to remote here is a helpful flag to know.

Git will not let you push changes if they exist on a local-only branch.

If you do, you will get an error.

fatal: The current branch <Branch Name> has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin <Branch Name>

To avoid copy-pasting the command from the error each time to push your changes, create you can create a function.

note

To get the current branch you can use the command git rev-parse --abbrev-ref HEAD

function gitpush() {
cur_branch="$(git rev-parse --abbrev-ref HEAD)"
remote=$(git remote)
git push --set-upstream "${remote}" "${cur_branch}"
}

Command

git-push - Update remote refs along with associated objects

SYNOPSIS

git push [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
[--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
[-u | --set-upstream] [-o <string> | --push-option=<string>]
[--[no-]signed|--signed=(true|false|if-asked)]
[--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
[--no-verify] [<repository> [<refspec>...]]

-u, --set-upstream

For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch.<name>.merge in git-config(1).

C4 notes

· 2 min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

It's time I learn a new diagramming method. So this post will be a disjointed list of notes.

I am using the video "Visualising software architecture with the C4 model - Simon Brown, Agile on the Beach 2019" as my guide.

C4 Components

C4 consists of 4 levels of abstraction.

System Context

1907178944fe0baa468006af297d93ab

Container diagram

bd46069b107d3a5abc95bdf5885ca2fe

Rebasing is boring

· 2 min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

The problem

When working in a team, you must ensure you sync code reviews with your default branch. Making sure you are up to date is definitely a chore and will take some time out of your day, but it will be worth it.

For me, the primary time sink is having to run the same commands and wait for the outputs each time.

  1. git checkout <default branch>
  2. git pull
  3. git pull again because I have not logged in today.
  4. git checkout <branch I was working on>
  5. git rebase <default branch> and hope there are no new merge conflicts.
  6. git push -f
  7. Check that my pipelines still work.

As you can imagine, this is a tedious process and can easily result in you messing up.

Solution

An easy fix is adding a new function to your cli. In my case, I use zsh, so I will add it to my ~/.zshrc file.

Code

tip

If you want to understand what is going on I recommend you use Explain Shell

update-branch() {
current_branch="$(git rev-parse --abbrev-ref HEAD)"
remote=$(git remote)
REPLY="Y"
if default_branch="$(git remote show "${remote}" | sed -n '/HEAD branch/s/.*: //p')"; then
vared -p "Rebase branch(${current_branch}) onto branch(${default_branch}) (Y/N)?: " -c REPLY
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
REPLY=""
git checkout "${default_branch}"
if git pull; then
git checkout "${current_branch}"
if git rebase "${default_branch}"; then
echo
else
vared -p "Unable to rebase without errors, abort (Y/N)?: " -c REPLY
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
git rebase --abort
fi
fi
fi
fi
else
echo "Unable to pull latest changes check your auth probably."
fi
}
note

Thanks to making this script I learnt that vared exists for editing variables and prompting users.

Bonus code

Here is a quick script to allow quick switching and creation of branches.

checkout-branch() {
branch="$1"
source_branch="${2:-main}"
REPLY="Y"
if git rev-parse --verify "${branch}" > /dev/null 2>&1; then
git checkout "${branch}"
else
vared -p "Can't find Branch(${branch}) new branch (Y/N)?: " -c REPLY
if [[ $REPLY =~ ^[Yy]$ ]]; then
vared -p "What source branch (Y/N)?: " -c source_branch
git checkout "${source_branch}" && git checkout -b "${branch}"
fi
fi
}