Repairing buttons on an Elektron MonoMachine

Well, I always thought my MonoMachine was indestructible, but apparently not entirely. ….when one regularly gets carried away hammering the keys as hard as possible over the course of about 6 years anyway. Time to break out that iFixit Kit then!

First, lets pull all the knobs off and undo the 6 screws holding the top plate on. It should come right off. Note the cool old-school circuit boards inside! Here is where the key that came flying off SHOULD have been:

Continue reading “Repairing buttons on an Elektron MonoMachine”

Setting permissions for your Gitlab CI Runner & W3 Total Cache

So in the last post on this, I looked at setting up auto deploy for a WordPress site using GitLab’s CI runner.  I also wanted the W3TC cache to be cleared, and thanks to WP-CLI, that was possible by adding:

- sudo -u www-data wp w3-total-cache flush

to the end of the script node in .gitlab-ci.yml.

Now. “sudo?!?!?!?!” I hear you say? There’s a security risk if ever I saw one. Luckily this doesn’t have to be the case if things are set up right. Make a separate user for GitLab Runner and limit it to sudo-ing as only www-data and only running that command while doing so.

It’s a good idea to setup a separate user in general too, for security.

There wasn’t an awful lot of info on that when I Googled though, so (from inital user creation):

adduser gitlabrunner
usermod -a -G www-data gitlabrunner
passwd gitlabrunner # set a password for your new user
# ...then ssh into the box with that user & pass and:
ssh-keygen -t rsa
# Set a new deploy key in Gitlab admin setting using your new so your new user can "git pull"
vi /home/gitlabrunner/.ssh/authorized_keys
# copy the public key from your GitLab box in. For instance from /root/.ssh/
chown -R gitlabrunner:gitlabrunner /home/gitlabrunner/.ssh
chmod -R go-rwx /home/gitlabrunner/.ssh
# Edit your sudoers file
# add:
gitlabrunner ALL=(www-data:www-data) NOPASSWD: /usr/local/bin/wp 

Done! Your CI script will now be able to run WP-CLI commands as www-data. No root access, no entering passwords.

Review: Logitech MX Master

Wow, this a really nice mouse!

I’ve been through a fair few different mice over the years and, suffering from pretty bad RSI on & off, I always try to get a nice one! I was an Intellimouse Explorer guy for ages – it won a Red Dot design award too, from what I remember. It was pretty comfy and used by a lot of pro gamers back in the day I think.

After that I went over to the Apple Magic Mouse for a while, but to be honest the whole touch-scroll thing it did was pretty annoying in a lot of contexts. Plenty of apps didn’t like it – sent Google Maps completely mental zooming in and out constantly for a start. Even more importantly though, it was so low profile that it didn’t support my hand enough and made my RSI quite a bit worse… Back to the Intellimouse.

Then recently my third one of them finally died and I thought I’d try something new. I thought about the Razer Mamba, which got great reviews, but it was about £150 which is absurd for a mouse. ….so I went for the Logitech MX Master and I’m pretty pleased! Wireless, great hand support, nice click weight, recharges via USB and lots of other nice things but I’m bored of writing this already and why am I even putting hardware reviews on this blog jesus christ this is a boring article right I’m off to do something useful with my life…