Categories
Servers

Updating Node on a Forge VPS

Forge publish a cookbook recipe for that here. The problem I had was my site uses website isolation, and that user didn’t have sudo access.

I was able to upgrade node (to v20 at the time of writing) by logging into the server as the root user. Ran the commands that Forge suggests, but without sudo since we were already root.

apt-get update --allow-releaseinfo-change &&  apt-get install -y ca-certificates curl gnupg

mkdir -p /etc/apt/keyrings

curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key |  gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20

echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" |  tee /etc/apt/sources.list.d/nodesource.list

apt-get update --allow-releaseinfo-change &&  apt-get install nodejs -y

That version of node seems to have flowed through to my isolated website user.

Categories
Uncategorized

Updating Business Time VS Code theme

Go to project at /Code/themes/business-time

Update the version in package.json

run vsce publish

After a few minutes see it on the VS Code light theme marketplace

To update the Azure hosted git repo you’ll probably need a new Personal Access Token (PAT). Generate that in the UI, then you can use it as the password when using to that remote.

git push https://mike--healy@dev.azure.com/mike--healy/Themes/_git/Themes

But maybe the vsce publish command above is enough, and you don’t need to update the repo?

Categories
Workflow

PHP Monitor and Getting Stuck on an Old Version

I swapped to old PHP 7.4 to update a WordPress project. I then could not switch back to 8.2+. I had the Laravel installer in the global composer dependency, which prevented running composer global update

Go to /Users/mike/.composer/ and temporarily remove the Laravel installer to be able to swap, then can probably put it back afterwards.

Categories
Uncategorized

Stripe Invoices

Settings (cog in top right) > Documents > Tax invoices are in there.

Categories
Workflow

Local Meilisearch

brew services start meilisearch

Or, if you don’t want/need a background service you can just run:

/opt/homebrew/opt/meilisearch/bin/meilisearch –db-path /opt/homebrew/var/meilisearch/data.ms

Categories
DevOps Workflow

Homebrew PHP Monitor Broken

I think this happened when something interrupted the switch.

brew install php got me on the way.

Categories
Uncategorized

MySQL for Developers Notes

From PlanetScale’s MySQL for Developers.

Strings

Charset defines what characters can go into a column.

SELECT * FROM information_schema.CHARACTER_SETS ORDER BY CHARACTER_SET_NAME;

A collation determines which characters are equal or greater in values in terms of sorting. e.g. is a == A or not? If not which is greater.

  • ai = accent insensitive
  • ci = case insensitive
Categories
Laravel

Database Laravel Tests failing from Sail App

Ok, this was a silly error on my part, because I got out of practice using the sail commands.

I have a Laravel app running on Sail/Docker under WSL. The app worked through the browser, but there was no DB access from the CLI or running tests.

I was running php artisan test which was using the PHP local to the WSL system, and not the virtual PHP server which should run the app. The WSL PHP happened not to have the PDO driver installed, so DB access failed.

Just needed to run the command properly as sail art test to use the correct PHP (I have aliased art to artisan).

Problem solved.

Categories
Workflow

SSH Authentication in WSL

Seems like the ssh-agent can go to sleep.

Within WSL I ran:

eval `ssh-agent`
ssh-add -l  //to see keys in use
ssh-add ~/.ssh/my_private_key  // to add it
Categories
DevOps

Zip / Tar GZ Ubuntu

Create Archive

tar -zcf mynewarchive.tar.gz mytargetdir

Extract Archive

tar -xzf myarchive.tar.gz 
  • c – Compress
  • x – Extract
  • z – Zip file (aka .gz)
  • f – File to operate on