Wednesday, July 31, 2019

EXIF metadata with a Promise

I had occasion to use exiftool recently, but instead of a callback, I'd rather use promises.

This is what I came up with:

const exif = require('exiftool');
const util = require('util');

const exif_metadata = function (data) {
    return new Promise((resolve, reject) => {
        exif.metadata(data, (err, metadata) => {
            if (err) {
                reject(new Error(err));
            } else {

Worked great!

const fs_readFile = util.promisify(fs.readFile);

  .then(() => {
    return fs_readFile(path);
  .then(data => {
    return exif_metadata(data);
  .then(metadata => {
    console.log('metadata: %O', metadata);
  .catch(error => {

Saturday, July 27, 2019

Add Port to UFW

I'm running UFW (uncomplicated firewall) to restrict traffic into my Linux system.

And while being super restrictive is generally a good thing, there are times when you have to poke a new hole and connect from another system inside the house.

Usually it's a new app running on a new port and since I never remember the command to allow this, here it is:

$ sudo ufw allow from to any port 3100

You're welcome, future self!

Saturday, July 20, 2019

The DX-M04 Shelving System

My dad bought a DX-M04 shelfy thing and I was tasked with its assembly.

I don't think a nicer set of shelves can be had at any price. And do you see the little screwdriver pictured in the instructions? YES, the DX-M04 really does come with a screwdriver!! And the bottom panel (part #3) has feet. Yes, they really did think of everything.

If I could make one suggestion:

At step three, you might want to leave the bottom a little loose, so when, in step four, you insert the back, you can wiggle it into the groove in the bottom. Then after you've installed the top in step five, you can go back and tighten the bottom.

If you need some shelves, you can't go wrong with the DX-M04. No, no idea where you'd buy them, but for the right price, I can put my hands on a really well assembled set.

Friday, July 19, 2019


Did you install a new MySQL and things just aren't working the way you're used to?


In this case, I'm inserting just a few columns, and there are non-specified columns without default values.

In my other database it just works - I know, not correct behavior, but it's what I'm used to.

In my new database I get this error:

ERROR 1364 (HY000): Field 'xxx' doesn't have a default value

So what's the difference?


Thanks, documentation!!

Before, strict mode. Giving me an error...

mysql> select @@GLOBAL.sql_mode;

| @@GLOBAL.sql_mode                                                                                                                         |
1 row in set (0.00 sec)

After, non-strict mode. Working like my other database!

mysql> SET GLOBAL sql_mode = '';
Query OK, 0 rows affected, 1 warning (0.00 sec)