bash

Wordpress automatic updates

I maintain a couple of wordpress sites, and I rarely want to spend time keeping them up to date. I use this permissions script https://www.devinhoward.ca/technology/2014/mar/wordpress-permissions-script though, which disallows Wordpress's normal auto-update mechanism. This vastly increases the security, which is worth it, but I need another way to auto-update.

So I use this script, along with the excellent command line tool wp-cli: https://wp-cli.org

Tmux is great

Tmux is a great application with a few super-cool uses. You can get really deep into configuring it, but I tend to use the default options so that I can install it and start using it on any machine and get a similar experience. Here are a few of my favourite uses:

Persistent ssh sessions

This is far and away the best use of tmux. I typically use mosh to make sure my ssh sessions don't crash.

gitlab-mr.sh

This is a script to allow quick gitlab merge requests on the cli.

If you create a new branch, commit it, and then run gitlab-mr my new merge request, then a merge request will be created on the appropriate project from the current branch into the develop branch, with title "my new merge request".

There are additional command line options to specify a markdown description, using cat and Ctrl+D to enter the input.

Working more efficiently with rails migrations

I've been working on a major schema refactor on a rails application recently, and time and again I've had to reset my database because of some syntax error or another in my migrations. I'm changing schemas and moving data between columns, which makes the migrations really fragile.

It's also been fun learning about the rake tools that allow you to manage database migrations. In particular, three rails commands have come in handy:

Subscribe to RSS - bash