2013-08-04

HOWTO: get a high-quality image from an eBay listing

Well, sometimes you can find an interesting item on eBay, and then you want to take a nice look at the photos. Unfortunately, the pictures are often displayed in a low resolution (and without a "zoom in" option). Luckily, often you still have a chance to get good quality images (with resolutions up to 1600 * 1200; it depends on the original quality of the picture the seller has uploaded).

Notes. The sites are in process of migration to HTTPS, so you'll often see image URLs beginning with "https://" instead of plain "http://". And it should work for all regional eBay sites (i. e., ebay.com, ebay.co.uk, ebay.de etc.), and also for "eBay Kleinanzeigen" (German eBay classified ads site).
  1. An old image URL style.
    1. First of all, copy an URL of the needed image; you'll get something like this:
      http://i.ebayimg.com/t/Some-nice-item-For-sale-/00/s/S0mE-W1LD/$GaRb4gE~~60_12.JPG
    2. Then you'll need to modify the URL a little; just replace the last number found in the URL (it's preceded by a '_' and followed by a '.'; in this sample, it's "12") with "10":
      http://i.ebayimg.com/t/Some-nice-item-For-sale-/00/s/S0mE-W1LD/$GaRb4gE~~60_10.JPG
      or with "57" (I don't know what's actually better):
      http://i.ebayimg.com/t/Some-nice-item-For-sale-/00/s/S0mE-W1LD/$GaRb4gE~~60_57.JPG
    3. Just paste the modified image URL into your browser's address bar and enjoy!
  2. A new image URL style. The method remains similar.
    1. Get an image URL:
      http://i.ebayimg.com/images/g/GaRbaG3/s-l64.jpg
    2. Change the appropriate URL fragment to "1600":
      http://i.ebayimg.com/images/g/GaRbaG3/s-l1600.jpg
    3. ...
    4. Done!

References:
  1. getProductDetails : thumbnail How can I get high resolution picture of catalogued item. - eBay Developer Support / Customer Help
  2. getProductDetails - API Reference - Product API - eBay Developers Program
---
Last updated: 2017-03-14

2013-07-18

TestDisk & PhotoRec: nice tools to recover lost partitions & files

TestDisk + PhotoRec is a nice toolset to recover lost disk partitions (or at least rescue some files from corrupted filesystems) in case of storage media failures, re-partitioning errors etc.
Works for disk images too.
More to say, it's a free & open source (GPL v2+) cross-platform (Linux, *BSD, Apple Mac OS X, Oracle / Sun Solaris, MS-DOS, MS Windows) software.

Presently, in Debian-based Linux distros, TestDisk & PhotoRec have been packaged into a single testdisk package, so you can install both tools at once:
# apt-get install testdisk

2013-05-09

HOWTO: get hardware sensors info (temperature, fan speed, voltage etc.) in Linux

(Tested in Debian Wheezy).
  1. Install the lm-sensors software package:
    # apt-get install lm-sensors
  2. Run the interactive hardware monitoring chip detection script:
    # sensors-detect
    Usually, it asks a lot of questions, and you can automatically answer 'yes' on them (but be careful: on some systems a full scan can cause some problems, e. g., a false chip detection or even a system hang):
    # yes | sensors-detect
  3. After choosing to add the needed module names automatically to the /etc/modules config file, it's good to check it for duplicate entries (and possibly other garbage).
  4. Reboot (or try to load the newly added kernel modules manually).
  5. Finally, just execute the following command to print the sensors information:
    $ sensors

2013-04-14

HOWTO: radical lossless JPEG image optimization (in Linux)

(The sample commands are tested under Debian Wheezy).

First of all, don't forget to install the JPEG manipulating programs package:
# apt-get install libjpeg-progs
And it's the optimization itself:
$ jpegtran -copy none -progressive input.jpg > output.jpg
Notes:
  1. yes, it produces a progressive JPEG output image; if you don't like it (or it's unsupported in the target environment), use -optimize switch instead of -progressive (but the output image size will be bigger);
  2. there's also a non-recommended option (an -arithmetic switch) to enable arithmetic coding; it allows a more efficient compression than traditional Huffman coding does, but (unfortunately) it's not widely supported in JPEG decoders due to some historical patent restrictions;
  3. -copy none option removes all extra markers (comments, tags, thumbnails and other metadata) from the output; if you need to save them, use -copy comments (or even -copy all) option instead;
  4. you can add a -grayscale option, and it will omit color data from the output image without re-encoding (very useful for grayscale / black & white / monochrome images);
  5. more reading:

2013-04-11

HOWTO: convert audio CD image (FLAC + CUE) to MP3 tracks in Linux

Imagine you've archived your favourite audio CD into FLAC/CUE pair format (or maybe you've purchased some album in that digital downloadable lossless audio format, who knows), and now you want to convert it to the standard MP3 files for playing that album in your good old digital music player.

Let the files be processed in Debian GNU/Linux environment (sample commands tested in Debian 7.0 "Wheezy", and should also work for all Debian-based distros, e. g. Ubuntu, Mint etc.; Bash shell is assumed to be installed & used by default).

First of all, you should install all the necessary tools: FLAC (for decoding FLAC to WAV), LAME (to convert WAV to MP3), cuetools (to parse the CUE sheet) and shntool (to cut the big WAV file into smaller tracks according to the CUE sheet breakpoints).
# apt-get install flac lame cuetools shntool
Then the conversion process itself begins.
$ flac -d MyMusic.flac
$ cuebreakpoints MyMusic.cue | shnsplit MyMusic.wav
$ rm MyMusic.wav
$ for file in split-track*.wav; do lame -V0 $file; done
$ rm split-track*.wav
The output files are by default MP3 VBR V0, 44.1 KHz, Joint Stereo; it should be decent for most situations.
After conversion, you can process split-track*.mp3 files with your favourite media tagger application.
Enjoy.