02 April, 2019

Between sleep and wake - idea for Mapbox with custom icons

Code and result: costum icons
Between sleep and awake this idea came to me - how to get images via geojson on a  map made in Mapbox.

See this file on my Github repository.

The geojson was formatted like this:

let geojson = {
      "features": [{
          "type": "Feature",
          "properties": {
            "city": "Nordborg",
            "symbol": "tux.png"
          },
          "geometry": {
            "coordinates": [
              9.742207,
              55.054442
            ],
            "type": "Point"
          },
          "id": "47dfbd93a4ac0e3d94d492fc6fe5f0cb"
        },
        {
          "type": "Feature",
          "properties": {
            "city": "Augustenborg",
            "symbol": "tux2.png"
          },
          "geometry": {
            "coordinates": [
              9.877219,
              54.946994
            ],
            "type": "Point"
          },
          "id": "9bec41b72adf6c7e74b090764c46fcc2"
        }
      ],
      "type": "FeatureCollection"
    }

And here is the loop, that printed out the result on the map. An img element was created on the fly:

  for (i=0; i [blogger hides the loop!]

      // create html element in the DOM
      var el = document.createElement('img');
      el.src = 'images/' + geojson.features[i].properties.symbol;
      el.alt = geojson.features[i].properties.city;
      el.style = 'width: 75px;height:auto;';

      // add the markers to the map
      new mapboxgl.Marker(el)
        .setLngLat(geojson.features[i].geometry.coordinates)
        .addTo(map);

      // by thine own ingenium add a popup with relevant info
    }

For some reason Bogger hides the last part of the loop. Probably it's a useless security stunt, however you can see the code here.

12 March, 2019

Manjaro: how to print a several copies

Problem: When I try to print several copies of a file, only one is printed, then the printjob is terminated.

Solution: a bash file, like this:

for i in {1..18}
do
  lp foo.pdf
done

20 February, 2019

Quicktime

How to trim a video (clip): CMD + T. A yellow box will appear. Trim and save. The video below saved my day.


06 January, 2019

Manjaro: NPM conflicting versions cannot update






Problem solved npm up and running again.
Problem: Could not update Manjaro after an update in NPM. The message was: "conflicting versions".


Solution: Removed all NPM packages, and then update was possible.

I guess the next step will be to reinstall NPM. It is of course unfortunate, since there is a lot of nodejs related stuff on my system. So I'll hope for the best ...

And here I was right. I cannot install NPM again! However there is a list of conflicting files, that exist in the system, even though NPM was removed. I guess that I have to remove these 11 files manually:

npm: /usr/lib/node_modules/npm/.licensee.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/ci-info/vendors.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/graceful-fs/clone.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/LICENSE findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/README.md findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/chownr.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/chownr/package.json findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/LICENSE findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/README.md findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/index.js findes allerede i filsystemet
npm: /usr/lib/node_modules/npm/node_modules/tar/node_modules/minipass/package.json findes allerede i filsystemet

Hypothesis: With my experience with NPM I guess that this may cause problems, if these files relate to something else. But ... without further ado I'll remove the problemmakers.

Experiment: remove 11 or so troublemakers.

In order to do so I created a bash script:

The "npm:" was replaced with "rm" in the Mousepad editor, and end of the lines " findes allerede i filsystemet" (danish for = "the file already exists in the file system") was removed in the same way. So the error message was transformed to a simple bash file.

Note the missing shebang (I admit, I'm lazy here but the thing worked for me). You'll have to run this as sudo, since one of the files is protected.

The next step is to reinstall npm.

Result: Success - NPM is now up and running version in 6.5.0. And pacman & co. are able to update the system.

29 November, 2018

Mac: fan running like mad

Now the CPU load seems normal

Problem: Fan running like mad. In top the CPU load was 80-90%. Only a few programs were opened, like Chrome, Atom and MAMP.

Solution: 

  1. Click  > sleep
  2. Wake the system up
  3. Click  > restart
Then the system acted normal.  A simple and effective cure for a weird behavior in the OS.

Compiz: Widow decoration invisible



Problem: Now and then after a reboot or restart of the system the window decorations disappear.

Solution: Open the Compiz Settings Manager and set a mark at "Enable Window Decorator" (translated from Danish - I'm not sure that these are the correct English wording, but see the illustration).

09 November, 2018

Outlook encrypt mail in a browser

Just click on the encrypt icon
In Europe I guess we have to encrypt our mails, at least when they contain sensitive personal information. I'm not sure whether this form of encryption is very secure, but at least I guess that the data is encrypted during transit.


  1. Write your mail
  2. Click encrypt
  3. Click the send icon

Problem: Send encrypted mail via Outlook to Gmail

You're told that a code will be sent to the email, however the code never arrived to gmail. If it's a standard issue, this encrypt system is useless. You cannot expect that all will use Outlook.

07 July, 2018

Epson ET-2750

Epson ET-2750 on my LAN.


Epson has released printer drivers for Linux, but the drivers are not made for Arch Linux. I downloaded the drivers, and found the relevant .pdo files, but the USB install did not work as expected in CUPS.

On the tiny printer screen I saw a wifi option, entered the LAN password. Then I could visit the printer on a local tcp/ip address. From the web interface installing the printer was easy.

So don't mess with drivers, just use the wifi options.

05 July, 2018

Running Koala on Max

Koala is a nice tool for SASS, Less and JavaScript kompilation / testing. However if you try to run the program on a Mac you have to allow the program.

After installation find the program in your Programs folder. Then press 'control' and right-click on the program launcher icon. Now you are able to run the program.

After this the program will launch normally from the launchpad.