How to implement $Date$ keyword in Git

This is fairly well documented in Git Attributes help but I didn’t like that given example requires a dedicated Ruby script.

Create two filters:

  • on smudge (to replace $Date$ into $Date: <timestamp>$ )
  • on clean (to revert  $Date: <timestamp>$  into  $Date$):
Now mark which files should be treated with the filters:
Finally, git add and commit.

My  $Date$ keyword has been replaced:

One annoying thing though is that the file is explicitly marked as changed. I have a feeling that SVN does it better 😃

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.

 

Prevent Mac hidden files being written to a shared storage

MacOS tends to trash mounted disks with number of useless hidden files (e.g.  ._* or .DS_Store ). There were number of recipes in the Internet, some of them were working at some of time but are not anymore.

Below notes from my fights (at a moment of writing, on MacOS High Sierra 10.13.4 (17E199).

Removing the files when they are created

I used to apply a find . -name ... -print0 | xargs rm -0  combo but found that there is an built-in command to deal with these files:

From the man:

Preventing creating the files

On the MacOS side

NOTE: None of these solutions worked for me!

As I wrote, this didn’t work at all to me.

On the SMB server side

It actually turned the only working solution for me. Just add to the share configuration section a veto file parameter, e.g.:

And restart:

Note, after applying this change you will not be able anymore to use dot_clean  command from your Mac as any requests towards these files (including deletion) will be silently ignored by your SMB server hence files will remain untouched!

Oracle 12c 32-bit client and direct GOT relocation R_386_GOT32 against `lxecerr’

When trying to install Oracle 12c 32-bit Client (12.1 or 12.2) on Oracle Linux 7.3 or 7.5, it throws error during linking static libraries:

 

Not very specific, I found only one reference in Oracle KM Doc ID 2246237.1.

Rootcause and resolution in there was:

REASON

SLES 12 SP2 ships with binutils 2.26 which breaks compatibility for certain shared library links.

SOLUTION
01) Update binutils package to version binutils-2.26.1-9.15.1 or later.

But in fact, I do have in my server  binutils-2.27-27.base.el7.x86_64 .

Workaround is to downgrade the binutils:

After this, the libs can be compiled and linked:

I do believe that after finishing the installation, binutils can be upgraded again to the latest version (but not forget about this problem in case of installing the RSU).

PS: I’ve raised SR 3-17356002141 : Error when installing Oracle 32-bit client (direct GOT relocation R_386_GOT32 against `ipp_zcalloc’)

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