ActiveMQ disable Diffie-Hellman ciphers to avoid “KeyUsage does not allow digital signatures” errors

Here’s how to do it:

transport.enabledCipherSuites=SSL_RSA_WITH_3DES_EDE_CBC_SHA

Add this parameter to URI in mqtt transportConnector (in your conf/activemq.xml config).

The need for this? I had a set of keys+certificates that were working perfectly fine on RabbitMQ, but on ActiveMQ I was getting “KeyUsage does not allow digital signatures” errors on client when it was validating server’s certificate.

I had no idea why this happened, googling revealed some fragmented info, in general I understood that my server’s certificate had “extension” “key usage” that indicated it didn’t allow (support?) digital signatures.

Screen Shot 2016-05-31 at 11.50.27 PM

Continue reading

Raspberry Pi Raspbian Jesse – free serial port ttyAMA0

I’ve posted the answer at stackexchange.

In short, disabling terminal on serial via raspi-config (advanced->Serial) should do the trick.

It it doesn’t for some reason – commenting out ttyAMA0 from /boot/cmdline.txt and disabling serial-getty via sudo systemctl mask serial-getty@ttyAMA0.service should definitely free the port.

But still one must manually set pins 15 and 16 into ALT0 state. Command-line “gpio” utility can be used for that:
gpio mode 15 ALT0
gpio mode 16 ALT0

UPD:
Don’t do the manual pin ALT0 mode setting – enable UART in /boot/config.txt instead (find enable_uart=0 and change to enable_uart=1).
This will ensure /dev/ttyAMA0 will exist. Otherwise it may not exist.

Move MP3s into folders by “Artist – Album – Year” in OS X

Quasi one-liner:

for filename in *.mp3; do; ART=$(mdls -name kMDItemAuthors -raw $filename | tr -d '\n"()' | awk '{$1=$1};1'); ALB=$(mdls -raw -name kMDItemAlbum $filename); YR=$(mdls -raw -name kMDItemRecordingYear $filename); echo $ART - $ALB - $YR - $filename; mkdir -p "$ART - $ALB - $YR"; mv $filename "./$ART - $ALB - $YR/"; done

Same, but on multiple lines:

for filename in *.mp3
do
  ART=$(mdls -name kMDItemAuthors -raw $filename | tr -d '\n"()' | awk '{$1=$1};1')
  ALB=$(mdls -raw -name kMDItemAlbum $filename)
  YR=$(mdls -raw -name kMDItemRecordingYear $filename)
  echo $ART - $ALB - $YR - $filename
  mkdir -p "$ART - $ALB - $YR"
  mv $filename "./$ART - $ALB - $YR/"
done