Articles

How I organize my Neovim configuration

The entry point for my Neovim Configuration is the init.lua file. Init.lua My entrypoint file simply requires three other files: The user.plugins file is where I'm using Packer to require plugins for my configuration. I will be writing other posts around some of the plugins I use soon. The user.options file is where I set...

Tags Programming Dotfiles Neovim Vim Web Development

Started working on a side project I’m calling “Pitch”. It’s an end to end encrypted website starter inspired by SiteJS by the Small Technology Foundation.

Got a basic vue app set up with the vue-cli but now can’t work out why my private key generator sometimes returns what I expect — a Uint8Array — and more often a mess of random characters.

Am I misunderstanding something I wonder?

Tags Programming Web Development Encryption Pitch

Bulk converting large PS4 screenshot png images into 1080p jpgs

I tend to have my screenshots set to the highest resolution when saving on my PlayStation 4.

However, when I upload to the screenshots area of this website, I don’t want the images to be that big — either in dimensions or file size.

This snippet is how I bulk convert those images ready for uploading. I use an Ubuntu 20.04 operating system when running this.

# Make sure ImageMagick is installed
sudo apt install imagemagick

# Run the command
mogrify -resize 1920x1080 -format jpg folder/*.png

You can change the width<strong>x</strong>height dimensions after the -resize flag for your own required size. As well as changing the required image format after the -format flag.

Tags Programming Linux Web Development Command Line

Updating PHP versions in Ubuntu 20.04

For an older PHP project, I needed to install an older version of PHP. This is what I did to set that up.

Installing a different PHP version

sudo add-apt-repository ppa:ondrej/php<br></br>sudo apt-get update<br></br>sudo apt-get install -y php7.1

Rebinding php to required version

Some of these binds are probably not need. I think the main ones, at least for my use case, were php and phar.

sudo update-alternatives --set php /usr/bin/php7.1<br></br>sudo update-alternatives --set phar /usr/bin/phar7.1<br></br>sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1<br></br>sudo update-alternatives --set phpize /usr/bin/phpize7.1<br></br>sudo update-alternatives --set php-config /usr/bin/php-config7.1

For some reason the --set flag stopped working, so I had to use:

sudo update-alternatives --config php

sudo update-alternatives --config p


etc. And update each one with the terminal prompt options for each.

p.s. If using PHP-FPM, you could also set up different server conf files and point the FPM path to the version you need. My need was just because I was using the command line in the older project.

Tags Programming Terminal Linux PHP Web Development

Started to learn Rust

Today is the day when I finally started to learn a new programming language — one that I have never touched before. I had briefly touched on and considered Go. However, I have settled on Rust.

It is the first compiled language that I have started to learn and am looking forward to the challenges it will bring.

I will also be doing my best to blog about things I learn — much of it probably in more of a brain-dump format — to both help others as well as reinforcing my own learning.

Tags Programming Web Development Rust Lang

Docker braindump

These are currently random notes and are not much help to anybody yet. They will get tidied as I add to the page.

Docker Swarm

Docker swarm secrets

From inside a docker swarm manager node, there are two ways of creating a secret.

Using a string value:

printf <your_secret_value> | docker secret create your_secret_key -

Using a file path:

docker secret create your_secret_key ./your_secret_value.json

Docker swarm secrets are saved, encrypted, and are accessible to containers via a filepath:

/run/secrets/your_secret_key.

Posts to digest

https://www.bretfisher.com/docker-swarm-firewall-ports/

https://www.bretfisher.com/docker/

https://www.digitalocean.com/community/tutorials/how-to-set-up-laravel-nginx-and-mysql-with-docker-compose

Tags Programming Docker Web Development Docker Swarm