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:

sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Algorithm constraints check failed on disabled signature algorithm: MD5withRSA
 at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:352)
 at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:249)
...

and

com.sun.deploy.security.BlockedException: User has denied the privileges to the code
 at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(Unknown Source)
 at sun.plugin2.applet.Applet2ClassLoader.getPermissions(Unknown Source)
 at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:206)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
...

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).

Jareks-MacBook-Pro:~ jhartman$ locate java.security
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/java.security
/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/java.security
/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/lib/security/java.security
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/security/java.security

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

Jareks-MacBook-Pro:~ jhartman$ edit "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/java.security"

jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 256, \
 DSA keySize < 1024, EC keySize < 224
jdk.tls.disabledAlgorithms=SSLv3, RC4, DH keySize < 768, \
 EC keySize < 224

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.

How to check if all Calibre books are already in the Amazon cloud?

Preface

My primary software for managing Kindle books is Calibre. I’m using Amazon cloud for books synchronisation and sometimes I’d like to ensure that all my books stored in Calibre have been already sent to the cloud. Mainly, to avoid re-sending books and avoid duplicates.

Getting a list of Amazon books

Refer to Kindle Library List article.

After executing this step you should have one or more text listing your books:

Jareks-MacBook-Pro:Downloads jhartman$ java -jar KindleLibrary.jar 1.htm
Amazon book list extractor
Elements found:400
Saving 1.html
Saving 1.txt
Saving 1.xml
Done!
Jareks-MacBook-Pro:Downloads jhartman$ java -jar KindleLibrary.jar 2.htm
Amazon book list extractor
Elements found:400
Saving 2.html
Saving 2.txt
Saving 2.xml
Done!
Jareks-MacBook-Pro:Downloads jhartman$ java -jar KindleLibrary.jar 3.htm
Amazon book list extractor
Elements found:373
Saving 3.html
Saving 3.txt
Saving 3.xml
Done!

Getting a list of Calibre books

Now open your Calibre, press a small triangle icon next to the Convert Books icon. Follow the instructions below:

After pressing OK you should get your Calibre books:

Jareks-MacBook-Pro:Downloads jhartman$ head CalibreBooks.csv
title,authors
"Świat pani Malinowskiej ; Trzecia płeć","Tadeusz Dołęga-Mostowicz"
"Drugie życie doktora Murka","Tadeusz Dołęga-Mostowicz"
"Świat pani Malinowskiej","Tadeusz Dołęga-Mostowicz"
"Wysokie Progi","Tadeusz Dołęga-Mostowicz"
"Złota maska","Tadeusz Dołęga-Mostowicz"
"Morderstwo pod cenzura","Marcin Wroński"
"Wąż Marlo t1","Marcin Wroński"

Compare the lists

In the very last step, use tide up the output files.

#!/usr/bin/env bash

awk -F $'\t' '{print $1,$2}' 1.txt > Amazon.tmp
awk -F $'\t' '{print $1,$2}' 2.txt >> Amazon.tmp
awk -F $'\t' '{print $1,$2}' 3.txt >> Amazon.tmp
sort Amazon.tmp > Amazon.txt

awk -F ',' '{print $1,$2}' CalibreBooks.csv | sed 's/"//g' | sort | grep -v "title authors" > Calibre.txt

And finally – use a side-to-side text compare tool (JEdit, WinMerge, any other) and view the differences between Amazon.txt and Calibre.txt:

Review the differences and take proper actions:

  • Send the file to the cloud
  • Remove duplicates in the cloud (yes, this will be also visible in the output)

I hope it will help.

(more…)

Alfred 3 workflow – Time Zone

Do you like Alfred? I like too… I’ve recently found bunch of very nice Workflows. For me, the most used one is for sure Time Zone.

The workflow has been created by Mr Carlos from New Zealand and published on the Alfred Forum. I’ve enhanced the workflow by adding a few new functionalities:

 

 

 

  • Migration to Alfred 3
  • Converting any time to all pre-defined time zones
  • Enabling 24-hrs time format
  • Displaying phone country code

After all it looks like below:

Conversion of a time in your local time to your pre-defined time-zones – “tz <time>” in formats HH, HHMM or HH:MM:

CarlosNZ, thanks for this great tool!

Updated version can be downloaded from Time Zones v1.8.

(more…)

NoSQL: Exiting inner Replica loop with exception com.sleepycat.je.rep.RollbackProhibitedException

If a NoSQL Storage Node is not running for a while, after startup it may complaining:

2016-11-17 13:22:34.934 UTC WARNING [admin1] JE: Exiting inner Replica loop with exception com.sleepycat.je.rep.RollbackProhibitedException: (JE 6.4.15) 1(1):/opt/ece/data/nosql/storage2/kvroot/ECEStore/sn1/admin1/env Node 1(1):/opt/ece/data/nosql/storage2/kvroot/ECEStore/sn1/admin1/env must rollback 41 commits to the earliest point indicated by transaction id=-392 time=2016-11-17 14:18:53.969 vlsn=884 lsn=0x0/0x6e4be1 in order to rejoin the replication group, but the transaction rollback limit of 10 prohibits this. Either increase the property je.rep.txnRollbackLimit to a value larger than 10 to permit automatic rollback, or manually remove the problematic transactions. To do a manual removal, truncate the log to file 00000000.jdb, offset 0x6e4944, vlsn 881 using the directions in com.sleepycat.je.util.DbTruncateLog.  ROLLBACK_PROHIBITED: Node would like to roll back past committed transactions, but would exceed the limit specified by je.rep.txnRollbackLimit. Manual intervention required. Environment is invalid and must be closed.

(more…)

From Drupal 6 to Drupal 8 and… finally at WordPress

Website update & engine refreshment (announced in Changes, changes post) took me really a lot of time (it might be 12-18 months or so). For whole this time I was scratching my head how to migrate old Drupal 6 with plenty of dirty configs to the latest & greatest version.


I’ve had plenty of attempts for migration, including Drush, Drupal migration plugin, even manual (!!) – in each of them, the result was not really satisfying:

 

  • Content and formatting was not migrating correctly
  • Multi-language pages made the migration tools totally confused

Time was flying and I couldn’t run away from buggy and insecure D6.

(more…)

Warehouse demolition nearby Hrubieszowska Street in Warsaw

As prices for the ground nearby my office are skyrocketing (mainly because of Underground station built in the neighborhood), the landlord decided to demolish and old warehouse. Most likely another offices sky-scrapper will be placed there.

(more…)