HOWTO: force filesystem check on reboot in MS Windows (NT family)

This trick is well-known, but still handy:
  1. > fsutil dirty set c:
  2. Reboot safely.
  3. Watch the CHKDSK operation progress.
  4. DONE!

Hints: D-Link ADSL router: time to change the power adapter

Sample device: D-Link DSL-2640* (quite old ADSL / Ethernet / Wi-Fi router); should probably work for some other Linux-based routers with Broadcom chips.

Some trouble signs include: red power lights, not booting into the normal working (or booting into the recovery mode) after power-on; slowing down of the operation, decrease of the performance & significant packet dropping rate; unexpected restarts etc.

Software symptoms: specific log strings, e. g.:
  • via Telnet / SSH:
    > sh
    # dmesg
     - Power glitch detected. Duration: 6 us
  • via the web-based interface:
    System Log
    Date/Time       Facility  Severity  Message
    Jan 1 00:01:23  user      warn      kernel: - Power glitch detected. Duration: 5 us 
What to do:
  1. check the power cabling;
  2. check the electrolytic capacitors (inside the power adapter and the router itself) and replace (resolder) the blown up ones with new ones;
  3. buy a new power adapter, if needed.
Safety notes:
  • BEWARE of electric shock.
  • Disconnect the AC power before opening the cases.
  • Some technical experience needed.


HOWTO: get rid of packed B-frames in AVI (MPEG-4 Visual) video with FFmpeg

You've probably seen some AVI (Audio Video Interleave) files with MPEG-4 video (more specifically, MPEG-4 Visual / ASP, usually encoded by DivX or Xvid codecs) inside; they are often used for DVD-rips. Such AVI video files often contain "packed B-frames", which is not an optimal frame storage way, but just a workaround for the VfW (Video for Windows) framework shortcomings.
To ensure you have a "bad-style" MPEG-4 AVI file, you can check it with a media analyzer utility like MediaInfo (in this case, it'll show you something like "Muxing mode : Packed bitstream").
Fortunately, that wrong thing is easy to "unpack" with an up-to date version of FFmpeg (v2.7+):
$ ffmpeg -i in_bad.avi -codec copy -bsf:v mpeg4_unpack_bframes out_good.avi
The conversion is lossless (neither video nor audio quality is harmed; the file should remain compatible with the hardware players), but in some cases can even reduce the resulting AVI container size.

You can download the source code and binary builds of the current FFmpeg (for MS Windows, Apple Mac OS X and Linux) freely from the official site.
Usually, you will find a compatible version in the repositories of your Linux distribution; however, in Debian, it's available only starting from the release 9 "Stretch":
# sudo apt-get install ffmpeg

  1. FFmpeg Bitstream Filters Documentation
  2. Download FFmpeg
  3. FFmpeg Changelog
  4. #2913 (Bitstream filter to fix "invalid and inefficient vfw-avi packed B frames") – FFmpeg
  5. MediaInfo
  6. Debian Package Tracker - ffmpeg
  7. Ripping - Wikipedia
  8. MPEG-4 Part 2 - Wikipedia
  9. DivX - Wikipedia
  10. Xvid - Wikipedia
  11. Audio Video Interleave - Wikipedia
  12. Video for Windows - Wikipedia
  13. Video compression picture types - Wikipedia
  14. Inter frame - Wikipedia


Overview: barcode reading software in Linux

Tested in Debian Jessie:
# apt-get install dmtx-utils zbar-tools


Tip: where to get the periodic table of the chemical elements

My favorite official source to obtain a copy of the periodic table of the chemical elements (also known in the post-USSR countries as the Mendeleev's table) is IUPAC (the International Union of Pure and Applied Chemistry):
(Currently, the table on the IUPAC site dates back to 2013-05-01).

HOWTO: the poor man's random number generator

Spoiler: the described binary random number generator (RNG) usually doesn't consume any electricity, but still definitely needs a minimal investment :-)


HOWTO: find out the PDF.js version built into Mozilla Firefox

To find out the version and build number of PDF.js (built into your installed version of Mozilla Firefox), you should visit a specific URL (if it doesn't work, just try to copy-and-paste it):
and look patiently at the beginning of that page.

E. g., for Mozilla Firefox 38.0.5 we can get the following:

PDFJS.version = '1.0.1149';
PDFJS.build = 'bc7a110';

(To view more of its internals, just visit resource://pdf.js/. Note: if you browse through that, the address will expand to a specific path pointing to some file inside some library-archive of Firefox, e. g., jar:file:///path/to/firefox/dir/omni.ja!/chrome/pdfjs/content/build/pdf.js).



The 3rd edition of The Art of Electronics is finally out!

The 3rd edition (2015; the previous ones were of 1989 and 1980 respectively) of The Art of Electronics masterpiece (by Paul Horowitz and Winfield Hill) has been finally released!
Haven't held it in my hands yet, but this great book looks impressive at least (consisting of more than 1000 pages, weighing more than 2 kg and costing more than 100 USD currently).

  1. The Art of Electronics on Wikipedia
  2. The official Art of Electronics website
  3. The Art of Electronics (3rd edition) on Amazon.com


HOWTO: get a highest-resolution version of an image on Last.fm

Sometimes you can find an interesting picture on Last.fm, but don't have an obvious option to zoom in. Fortunately, sometimes you can view it in a better quality too (it depends on the originally uploaded image resolution):
  1. First of all, copy the URL of a necessary image; you should get something like this:
  2. Then you'll need to modify the URL a little; just replace the entire substring consisting of alphanumeric characters between the two slashes after the "serve" word and before the image number with a single underscore:
  3. Just paste the modified image URL into your browser's address bar and enjoy the (big) picture!