Canon Selphy and Ubiquiti Unifi

I recently got a Canon Selphy photo printer. It’s a book-sized printer that outputs 6×4″ photo prints using a dye sublimation process. As I don’t print much this is ideal as there’s no ink to dry out, it uses little space, and the prints are comparable to ones I can get from general online photo printing places.

This all seems great but I had great difficulty getting it to work over Wifi on my Ubiquiti network, particularly using AirPrint.

After a lot of head scratching I came across some old forum posts that mentioned UAPSD (unscheduled automatic power save delivery). I don’t really know what that means, but sure enough there is a setting in the Wireless Networks section of Unifi and enabling this fixed all printer problems.

Beat Saber

This is my current go-to VR game, and is a lot of fun to play. It’s a lightsabre music mashup thing.

It can be particularly satisfying at times, and feels like you’re getting a good bit of exercise too. Meanwhile in the real world you’re just flailing your arms around like you’re being attacked by a bee.

The need for whitespace

I’m a big fan of vertical whitespace, and find it strange that more fuss is made of tabs vs spaces (which doesn’t really affect readability) than vertical spacing (which does).

Here’s a simple code example, randomly picked:

$max_width  = intval( get_option( 'thumbnail_size_w' ) );
$max_height = intval( get_option( 'thumbnail_size_h' ) );
// last chance thumbnail size defaults
if ( ! $max_width && ! $max_height ) {
  $max_width  = 128;
  $max_height = 96;
}

Compared to:

$max_width  = intval( get_option( 'thumbnail_size_w' ) );
$max_height = intval( get_option( 'thumbnail_size_h' ) );

// last chance thumbnail size defaults
if ( ! $max_width && ! $max_height ) {
  $max_width  = 128;
  $max_height = 96;
}

That single extra line makes such a difference when scanning code. Imagine trying to read a book with no paragraphs.

Adverbial adjunct

I know, right?

The internet takes you on wonderful journeys, and today I found out about adverbial adjuncts. My path there began by wondering about the overused and redundant ‘to be honest’ that is added to statements.

To be honest I always lie.

Unsure person

Similarly there is the popular (and probably American) ‘go ahead’, as in ‘I’m going to go ahead’. This is something that seems unnecessary, and almost a meta statement of intent.

I’m going to go ahead and do this thing

Indirect person

One of my least favourite, and not an adverbial adjunct itself, is ‘is there a reason’.

Is there a reason you did this thing?

Passive-aggressive person

The answer is almost always yes, there is a reason. There are probably many reasons. They may not be good reasons, but asking in this way seems like an indirect accusation:

Why did you do this dumb thing?

Aggressive person

I’ve probably used this many times myself and I’m certainly going to try using alternatives.

SimpleSync

What better way to welcome in the New Year than over-engineering a solution to an edge case that almost no one will need. Hurrah!

The thing is, sometimes I need to edit files on a remote server. This isn’t anything new or different, but sometimes I also want to use my editor of choice (VSCode), with all the shiny bits still shining.

There are ways of doing this, of course, including mounting the remote server over SSH (slow, doesn’t work well with code analysis), using remote editing extensions (I’ve never been able to get one to work reliably), or even just editing over FTP.

My own solution is a tool I’m prosaically calling simplesync. It monitors a directory for changes, and uploads them to the remote server. That’s it.

While I’m making no claims of it being a great solution, it does allow you to edit files locally, making full use of any editor features, and saves you having to manually upload stuff.

You run it as:

simplesync --local=dir —-remote=user@remote

You can store these settings in a local config file so you don’t need to remember anything.

A little extra bonus is:

simplesync down

This will sync changes from the remote server to your local machine. Handy for getting things set up in the first place, or for when files are changed on the server (only modified files will be downloaded).

As with any syncing it’s always worth testing the connection first, and you can do that by adding --test to the command. This will output the local and remote file paths instead of doing the sync, allowing you to check that you’ve set things up properly.

How does it work?

It uses rcp and rsync under the hood, combined with something to monitor for file changes.

What doesn’t it do?

Probably a lot of things. It doesn’t monitor changes on the remote server, and (currently) doesn’t handle new directories and deleted files well.

Why should I use it?

 
No reason. It works for my needs, should be platform independent (provided you have node setup), and it’s free.

https://github.com/johngodley/simplesync