Gadgets & hobbies

Electronic gadgets, hobbies, developing

Chef resources failing with wrong constant name

When trying to add a custom resource, no matter what, I always got a  wrong constant name  error, for example:

It turned out to be an issue with my cookbook name: it’s not allowed to have a cookbook name starting with a number (as later, it’s converted into a class name).

So my cookbooks as below are causing the problems:

They should be renamed into something else, for example:

Note, inside the files, there are references to the names, so you may need to update them accordingly, for example using:

After this, no more strange errors after adding resources.

PS: When you work on MacOS, you may face another problem with your resources: MacOS trash files (._* or .DS_Store) are causing another (similarly looking) error. Take a look at this web page.

 

Deleting unwanted time zones from Apple Calendar

When you add some timezones to your Apple Calendar, it’s somehow difficult to remove them and you end up with a list which you perhaps don’t need anymore:

 

How to remove them? Rather easy, but we need a plist editor (easiest way to get it is to install XCode). Once we have it, just type in your terminal

Find attribute RecentlyUsedTimeZones, unfold it and delete unwanted items:

(more…)

Open Cisco Webex through Alfred workflow

A MacOS Alfred workflow to open a predefined Webex session.

Pre-requisites:

Introduction

It’s pretty basic, but helps me to speed up a very common activity (which I always tend to do on very last second when a my conference call is about to start)…

So when I urgently need to open Webex conference, instead of searching through my browser bookmarks, just press Option-Space and type webex:


Then press Enter to get the list of your web conferences, for example:

Hit cursor down or up to select bridge you want to open and just press enter.

Installation

After downloading the workflow, just doubleclick the file and it will get imported to your Alfred.

Configuration

Ok, how you could add your most frequently used Webex URLs to the list? Navigate to Alfred workflows, find Webex workflow and select Open in Finder:


Then open configuration.txt in your text editor:

In the file, set your URLs in format <Name>|<URL>, for example Jarek|https://webex.com/joint/jarek.hartman:

Save and done!

Kindle Vocabulary Builder into Memrise

Introduction

A script to pull Kindle Vocabulary Builder DB and convert into Memrise course.

The latest Kindle Paperwhite (second generation) offers the Vocabulary Builder feature. With Vocabulary Builder, you can look up words with the dictionary and memorize their definitions.

For my self-education I use http://memrise.com/ (both on my phone and desktop PC). I thought it would be great to pull words which I’ve checkded when reading English books on my Kindle and push them into my Memrise course.

How does it work?

  1. The script reads through the vocab.db to look for all Engligh words (in table WORDS).
  2. Each of the words (aka stems) is used for a definition lookup in the Cambridge Dictionary
  3. Retreve word definitions, usage example, pronounciation, audio mp3 and insert into a new SQLite database memrise.db (the mp3 is written to the disk only, folder audio)
  4. Each new word is written to a text file, in a format suitable for bulk words import into Memrise.

Pre-requisties

  • Kindle Paperwhite (or newer)
  • vocab.db file (retrieved from your Kindle, from /Volumes/Kindle/system/vocabulary/)
  • python 3
  • BeautifulSoup

References

I heavily sourced from two GitHub projects:

ToDOs

  • Parametrize hardcoded things – especially language pair English-Polish
  • Upload Audio files with prononciation

Usage

DB conversion using the script

At minimum, the tool does not require any parameters, it will search for vocab.db in the current folder and will write output files into the same, current folder.

Pay your special attention to memrise.txt which has been generated:

This is the file, which will be used for bulk word add into your Course.

Bulk word add

Go to your Course, press Edit and in the Advanced options, look for Bulk add words:

Bulk Add words

Open memrise.txt in an editor (e.g. Notepad), select all, copy it and paste into Memrise Bulk Add form then press Add:

Bulk Add words

That’s it!

Download

Download the script from GitHub: https://github.com/jaroslawhartman/kindle-to-memrise

Installation of pygraphviz in MacOS 10.12 (Sierra)

First attempt to the installation failed because of missing graphviz:

 

Ok, so next obvious step was to install missing library using brew:

 

Everything looked find, however pip’ing still shown same problem with not installed library. I think the reason was in the warning show above:

 

Ok, so where we have eventually the lib?

 

So we’re almost there. Let’s convince pip to use include and lib folder mentioned above (by enforcing it by --install-option):

 

We’re done!

Fix for “Withings to Garmin Connect” authorisation problems

It has been reported that the script does not work anymore:

I’ve managed to fix it. See latest commit in https://github.com/jaroslawhartman/withings-garmin-v2

Belkin KVM: Falied to validate certificate

After one of JVM updates, my Belkin KVM (Remote IP Manager) has started refusing to start with “Falied to validate certificate” error followed by “PKIX path validation failed”:

I’ve found following exceptions in Java console:

 

and

 

Google says that this is pretty common problem and returned plenty of receipts how to fix it.

Scanning the system for potential locations of the java.security file, there are four candidates. However, there is a catch: we should fix Java not in the system-wide location but the Java plugin for the web browser you’re using (Safari on MacOS in my case).

 

So we can skip the last three locations and just focus on the 1st one. Change the lines as described

 

Save and restart the browser (Safari). This time the KVM applet can start (after plenty of security warnings though).

Update

The application has to be also white-listed, otherwise it will generate error as below:

Open System Preferences, Java settings and add IP address of your KVM to the list:

Add following:

Again: save and restart your browser.

Update 2

Another security exception is required (after one of Java 8 updates):

 

Edit this config file:

Add this line within the grant { }; section: