Blog

// Replacement ear-pads for Bluetooth Creative Sound Blaster JAM headset

Creative Sound Blaster JAM is a very price-friendly Bluetooth headset for home use. I use it for occasional TV watching on PC without interfering the others, and sometimes with my cellphone (the headset has a NFC tag for quick pairing) for music listening e.g. during cooking.

Most of the time it hangs on the back of the display pivot. I turn the display around a lot so it eventually damaged the ear-pads pretty fast which literally teared apart.

The manufacturer says there are no spare parts, but provides very detailed information about headset speaker dimensions. So the most difficult part is to list the offers at AliExpress, filter out bad product descriptions, and wait a month for the result. If you want to skip the search part, I can recommend this item. Ear-pads are bit loose than the original but still hold tight enough. The material is quite thinner and there is a “seam” present, but 5 pairs for less than USD is a good price.

// Reading output of remote command with Dropbear ssh client

Today I faced strange behavior of Dropbear SSH client (dbclient) on my home OpenWRT home router. Before anything else, I would like to note that I do not have the recent version, but the version included in my OpenWRT installation. Exactly, it's Dropbear v0.53.1. But most distributions do not have recent versions so I hope this will remain usefull to others.

I have a shell script which uses ssh client to read some information from my other server. Imagine following shell code snippet:

result=`ssh -i key_file user@server remote_command` && {
  echo "Obtained information is $result"
}

This code will connect to remote machine and run remote_command which produces some output. This output will be assigned to variable $result. If remote command succeeds (returns exit code 0) the message with obtained value will be printed.

For particular reason, this snippet did not work if the whole script was run by cron. I googled a lot. I found some issues in Dropbear mailing list including quite dirty but working solution.

The reason is that script run by cron has no standard input available. Due to this, dbclient does not read any output from remote command either, so the $result variable is set empty and no error code is returned.

This behavior can be simulated from running shell as

ssh -i key_file user@server echo "foo" </dev/null

Nothing will be returned. Note that this modification does not affect OpenSSH client behavior (SSH implementation on most “big” Linux machines).

The quickest solution is to “create some stdin to ssh client”, redirect from /dev/zero is enough. Following code works:

result=`ssh -i key_file user@server remote_command </dev/zero` && {
  echo "Obtained information is $result"
}

Now the whole script works either standalone or as a cronjob.

// One Year with Amazon Kindle

About a year ago I finaly purchased my first Kindle 3 Wifi (later renamed to Kindle Keyboard Wifi). In these days new VAT limit for purchases out of EU was starting to be applied. But I ordered it in time before the final price raised by 20%. UPS delivered the package from US quicker than Czech Post Office is even able to deliver letter from one part of Prague to another (yes, they let you pay for it a lot). In parallel, leather cover was going from China. It took about 2 weeks to the delivery (but the shipping was free of charge).

It had not (and still has not) any sense to purchase Kindle from Czech retailer since the prize is much better and acording to many people on internet, Amazon return services are much better than services of arbitrary Czech e-shop.

Kindle in leather cover from DX.com

Primarily I've bought Kindle for school purposes (lecture notes and papers). I refused big Kindle DX because of its price and size, and purchased the small one. I became familiar with it very quickly, even for fictional books reading. After few years, the market with Czech written books finally arises but sometimes books include painful non-Amazon incompatible DRM stuff. Czech (and world's) classics is available for free from e.g. Municipal Library of Prague. In recent days I fell in love with shopping from Amazon, for both fictional and technical literature. Beside the fact that the price is much better, some books are not even available in Czech Republic.

Pros:

  • Size and weight. Now I need not to take big bag with books to a vacation.
  • e-Ink display. The most excellent LCD in the world cannot compete with it.
  • Amazon Whispernet. In combination with e.g. Send to Kindle Chrome extension, it's unbeatable for offline articles reading.
  • Dictionary integration. For us who do not handle English vocabulary so well.

Cons:

  • Inability to open non-Amazon DRMed books. Our local market with DRM protected books lays on Wooky or Adobe DRM technologies.
  • Low speed. When using dictionary, switching from book to dictionary and back is a bit slow. Also handling PDF documents is slow.
  • Kindle is unable to automatically check for new documents at Whispernet when in sleep mode. So I must remind to wake it before going to work if I manage to read newspaper.
About me
SW developer, amateur tennis player, rock'n'roll & heavy metal fan.