By devin, 17 January, 2022

Note: I have a couple of Amazon links in here, but these aren't going to track you - I just have them to document the components I used.

I'm trying to get rid of my Amazon FireTV Cube. The last remaining feature I use is saying "Computer, turn off the TV" before I go to bed. I'd like to switch this over to "Hey Mycroft, turn off the TV". This documents my journey.

By devin, 17 June, 2021

My team is currently migrating one of our Java codebases from junit 4 to 5, and with it we lost two of our favourite features: mocking static methods with PowerMock, and Theories. I'll leave Theories alone in this post so I can focus on PowerMock.

PowerMock has served us well but has some drawbacks, mainly around its slow performance and arcane errors due to the way PowerMock changes your classloading.

By devin, 1 March, 2018

I maintain a couple of wordpress sites, and I rarely want to spend time keeping them up to date. I use this 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:

By devin, 27 July, 2016

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.

By devin, 10 January, 2016

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.

By devin, 23 December, 2015

(Prepared to be shared at my work: 😎)

Through long trial and error, and with a healthy dose of help from the Linux from Scratch website, I've accumulated some good knowledge of Bash in my time with Linux and OS/X. Here are the highlights:

By devin, 16 December, 2015

Sometimes you make a git commit, but there's a typo or syntax error in there by accident. I normally use git rebase -i HEAD~2 and then through the magic of vim I'm fairly productive at squashing the two commits together.

But wouldn't it be nice if there was a way to run one command to squash your most recent commit (which probably has a useless message like "typo" anyway) into the next most recent? Lucky for you, there is now!

By devin, 24 November, 2015

The other day my computer begain repeatedly giving me this MySQL error:

Your password has expired. To log in you must change it using a client that supports expired passwords.

It happened to my root account and my Devin account. I searched online quickly and found out (after more looking than I'd hoped for) how to change my password.... but the problem came back a few days later.

By devin, 5 November, 2015

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:

By devin, 27 October, 2015

I have a website with a two-level dropdown menu (it's not this one!). I want it to be slick, so I used CSS to only show the submenus when the user was hovering on the relevant parent menu item. This was great, until I realized people liked to access my website from their phones. The only way to reveal the submenus using a touch screen is to click the top menu item, but that will activate the link and change the page before you can find the link you want.