Woody is dead. Long live woody!

05 April 2020 by Lincoln Ramsay

The server originally started out running on a Northwood Pentium 4, hence the name. Since then, it’s been a VirtualBox guest on my gaming PC, and for quite a few years now, it’s been running on a HP 8530w laptop I got while working at Nokia.

Ever since my son bought his own gaming PC (back in January), the MacBook Air he had been using has been unused and I had been eyeing it off as a new host for woody. more…

How to disable notification (and location) requests in Firefox for Android

24 July 2019 by Lincoln Ramsay

The internet is awash in articles explaining how to disable notification requests in Firefox. But none of them bother to point out that the settings they mention don’t exist on Firefox for Android.

I eventually tracked down a config item that gives you the same effect.

Go to the URL bar and type about:config.

In the search box, type dom.webnotifications.enabled.

Click on the item and toggle it (to false).

Congratulations! You will no longer be prompted to enable notifications on Firefox for Android.

Location requests

Go to the URL bar and type about:config.

In the search box, type geo.enabled.

Click on the item and toggle it (to false).

Congratulations! You will no longer be prompted to share you location with websites on Firefox for Android.

The time my phone almost died

26 November 2018 by Lincoln Ramsay

I love my phone. It’s a Sony Z3 Compact. I can’t stand the way phones keep getting bigger, so my next phone will most likely also be a Sony Compact phone.

Apparently, the Z3C has a well-known design flaw. The frame flexes more than it should, and combined with the heat the system can generate, it loosens the adhesives and allows the front screen to lift up. This happened to me, but it was a small lift (top corner) that didn’t really impact on my use of the phone, so I put off doing anything about it.

About a year ago, I asked about it on XDA and someone gave me some pointers. Apparently it’s not very hard to replace a screen. Still, I’d never done this kind of thing before so I waited. I had noticed an occasional visual glitch that I took to be related to the lifting screen but it wasn’t a bit deal.

About 3 weeks ago, I managed to drop the phone onto the floor and the adhesive decided that it had had enough. The front screen practically came off the phone. It was time to do some fixing. more…

Remove the Jira notification badge

10 August 2018 by Lincoln Ramsay

I use Jira at work and there’s this really annoying thing…

That unassuming bell icon. As it appears here, it’s inoffensive and something I can happily ignore. But every time Jira sends me an email, it also puts a badge on this icon. Worse, making it go away mean clicking it, waiting for the page to load, then clicking on a tiny “mark as read” link.

I’m not the only one it has annoyed. There’s a Jira issue here: JRACLOUD-69724

Not being content to just ignore it, I went ahead and created my own workaround. It’s a userscript that removes the element from the page.

Get it here: remove_jira_notifications.user.js

I have only tested it on the specific, hosted Jira I use at work (not the same site being matched by the script – you’ll need to set that appropriately for your Jira), and only with Firefox 61 on Linux using Tampermonkey as the userscript manager.

Update Feb 2021

I probably haven’t noticed all the changes I’ve made over time (since Jira/Confluence are a moving target) but with any luck, that shouldn’t matter because Tampermonkey will auto-update the script when I push a new revision.

Update 20 Aug 2018

I found some pages that load elements after the page has finished loading so the script handles that now. And it removes the same element on Confluence pages (the link is slightly different).

Update 10 Oct 2018

JIRA changed from a link to a button element. The script now handles that (as well as the old link, just in case).

Update 17 Dec 2018

Confluence changed to a similar system to JIRA (but with a div instead of a button).

Update 10 Mar 2020

Confluence moved the navigation to the top and changed to a span, and it gets added twice now.

Update 13 Mar 2020

JIRA moved the navigation to the top and changed to a span, and it gets added twice now.

Update 21 Jul 2020

Confluence changes the location without reloading the page. The script now checks whenever this happens (mostly noticeable as editing a page causing the icon to appear).

Update 4 Aug 2020

When publishing a page, the icon appears 3 times! Handle this. The script was also changed to just pick up every site (removing the need to edit the script).

The time my computer almost died

04 August 2018 by Lincoln Ramsay

I have a 2011 MacBook Pro. It’s old, but it’s also good. Until very recently, no newer models could take more RAM (I have 16GB, mostly because the incremental cost over getting 8GB was so low). Newer models do have higher res screens, but I really don’t care. One place where newer models completely fail is in the storage department. The new 15″ MacBook Pros may finally be interesting to me but I currently have a 13″ system and those ones did not get the same upgrades.

My computer came with a 128GB SSD and a CD drive. Within days of getting the machine though, the optical drive was removed and an Optibay put in (with the optical drive relegated to an external enclosure). I put in an extra 500GB of storage for a tiny fraction of what SSDs cost at the time.

Over time, the amount of things I could fit on the 128GB boot volume seems to have gone down. There has been a gradual movement of things to the hard drive (besides the obvious long-term non-speed-dependent things that started there). The computer is still mostly snappy, but some things are slower just because they rely on files on the hard disk.

Anyway, everything has been great with my setup for a very long time. That all changed a month ago. more…

Random MAC address on an fake ASIX USB ethernet device

22 June 2017 by Lincoln Ramsay

I have 2 USB ethernet adapters at work. They are cheap chinese things. I’m pretty sure they are the same thing this guy examined in detail.

They had been working just fine for quite some time but today, one of them broke. I don’t know what happened, but I suspect there must be some NAND used to store configuration that has gone bad. The primary symptoms I can see are that some of the USB things are different (eg. serial number is now 1 instead of 2) and most annoyingly, the MAC address cannot be read.

The main problem this causes that on every insert, the device is given a random MAC address so I can’t associate permanent network settings with it anymore. But since it does show up slightly differently to the working adapter, I can fix it with a udev rule.

Before it broke, it came up with MAC address 00:90:9A:9A:A9:39 and (through a udev rule) was assigned the name eth4. That udev rule no longer works so I had to make this rule to set both things in one go.

# This fake ASIX USB ethernet device is broken and forgets its MAC address
ATTRS{idProduct}==”772a”, ATTRS{idVendor}==”0b95″, ATTRS{serial}==”000001″, NAME=”eth4″, RUN+=”/usr/bin/macchanger -m 00:90:9A:9A:A9:39 %k”

Let’s Encrypt, acme.sh and cpanel deployment

09 June 2017 by Lincoln Ramsay

This site was using a startssl certificate but… the certificate expired (I got an email mere hours before this happened) and when I went to update the certificate, startssl had somehow forgot all about me. It seems there was an ownership change and I found some things that made me decide a new certificate provider might be a good idea.

So I decided to get a Let’s Encrypt certificate instead. But I can’t run their suggested client (certbot) because I’m on a shared webhost without root access.

But I found acme.sh, which does the same thing certbot does without root or the heavy python dependencies. Apparently it will even handle auto-renewing my certificates for me.

New: This is the TL;DR version that just works.

ssh yasmar.net
curl https://get.acme.sh | sh
exit # probably could have just re-sourced .bashrc...
ssh yasmar.net
acme.sh --issue -d yasmar.net -w ~/public_html
acme.sh --deploy -d yasmar.net --deploy-hook cpanel_uapi

Back to the original story…

However, there was no cpanel_uapi deploy hook originally. So acme.sh could not deploy my new certificates to cpanel. Bummer. Luckily, I found a cpanel API reference to do just that and whipped up a bit of perl code (only slightly changed from the reference) that deploys certificates to cpanel. My change is here.

For the record, here’s how I got everything going.

ssh yasmar.net
curl https://get.acme.sh | sh
exit # probably could have just re-sourced .bashrc...
ssh yasmar.net
acme.sh --issue -d yasmar.net -w ~/public_html
acme.sh --deploy -d yasmar.net --deploy-hook cpanel

Though, the deploy step will do nothing without my modified cpanel.sh script. It has 3 important variables:

export DEPLOY_CPANEL_USER=myusername
export DEPLOY_CPANEL_HOSTNAME=localhost:2083

In my case, I had to use a real hostname instead of localhost to access cpanel.

My script is quick and dirty and doesn’t do any error checking. But it prints out the response so hopefully if there’s a problem it’ll be clear why.

It looks like the deploy hook is saved so when my certificate auto-renews, it should auto-deploy. I’ll know for sure in 60 days time.

Update: It did automatically renew and deploy 🙂

Update (June, 2018)

So my hosting company decided to seriously break perl. LWP was removed and there’s no compiler so I can’t install any equivalent CPAN modules. However, PHP is present and works just fine, so I have updated the deployment script. The new code is here.

With PHP, I can use the expected localhost:2083 to access cpanel, which is nice.

Update (again)

However, while looking at pushing this to the upstream project, I noticed that someone else has implemented support for the cpanel uapi command (which my hosting provider has). This has the advantage that you don’t need to put your credentials into a file and since it’s a cpanel thing, it probably won’t break in the future.

   acme.sh --deploy -d yasmar.net --deploy-hook cpanel_uapi

Rogue for Android

21 February 2017 by Lincoln Ramsay

This is the story of how I came to find myself porting rogue to Android.

I’ve played various roguelikes on a number of occasions over the years. One in particular stands out for me though. It was called PocketRogue and it was a straight port of rogue for PalmOS. I played it on a Treo, where the keyboard came in handy. I even got the source code but it was a CodeWarrior project that I never managed to port to the prc-tools environment.

When I got an Android phone I looked for roguelikes but was sorely disappointed in what I found. There were lots of apps available but most of them just didn’t work on my phone. I get the feeling most of them were designed to run on larger tablets with a physical keyboard attached or something. Luckily though, I found the excellent Pixel Dungeon (and later, its many forks) to satisfy my roguelike cravings. However, despite being an excellent roguelike that actually plays well on a phone, I find myself sometimes missing the simple charms of the classic ASCII interface and the simpler gameplay that rogue has.

So I did some experimenting… more…

Pina Colada

09 November 2016 by Lincoln Ramsay

Here is the Pina Colada recipe I’ve been working on. I’ve been wanting to put this together for ages and finally got around to it.

Pina Colada

1 measure of coconut cream
2 measures of pineapple juice
1 measure of rum
5 large ice cubes
half a measure of simple syrup (or 2 teaspoons icing sugar)

Put all the ingredients into a Thermomix (blender)
Mix on speed 6 until smooth
Pour into a glass
Put on Escape (The Pina Colada Song) and contemplate the lyrics while you enjoy the drink

I use a 1/3 cup measure which happens to make exactly the right amount to fill up my cup.
Simple syrup (1:1 sugar to water) doesn’t have to dissolve. Icing sugar is better at dissolving than regular sugar if you don’t have syrup.
If you start with colder ingredients (eg. store in the fridge or freezer), you’ll get a nice slushy texture. But really, as long as the drink ends up cold, it’ll be fine.
The official standards say to use white rum but I have made this with Bundaberg rum and it’s just as good, if not better (but then I do like the taste of rum).

← Older posts

Newer posts →