2012-12-29

HOWTO: fix gksu not accepting your password

Sometimes you can get into a situation when gksu (or any application dependent on this GTK+ su frontend) doesn't accept your password (while gksudo may work OK).

It can be caused by incorrect gksu settings; to correct the situation:
  1. execute gksu-properties (without any arguments), so the "Privilege granting preferences" dialog window should pop up;
  2. select the correct authentication mode from the drop-down list:
    • su, if the system has an active root user with password;
    • sudo, if there's no active root user, and the superuser privileges are granted to a normal user through the use of sudo;
  3. close the settings window;
  4. finally, try to execute some gksu-dependent stuff to test it.

2012-12-27

HOWTO: fix HDD partition order with fdisk in Linux

Sometimes (usually after some repartitioning operations) disk partitions can get into the wrong order (e. g., "sdb1 sdb7 sdb2 sdb5 sdb4 sdb3", as you can see it in lsblk / fdisk / Parted / GParted etc.).

Usually it's harmless, but anyway can be easily fixed in Linux with a fdisk utility (from the util-linux package): just start fdisk with a HDD device as an argument (e. g.: fdisk /dev/sdb), then sequentially press 'x', 'f' and 'w' keys, and finally reboot your system (for the changes to take effect).

Be careful:
  1. you can do this from a some sort of Live CD / Live USB environment;
    please don't try this on a running production system;
  2. partition numbers get changed, and some OS's (and especially OS bootloaders) sometimes don't like this;
  3. the partition table can get corrupted — make backups prior to any experiments.

Here is a sample output log:
# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): x

Expert command (m for help): m
Command action
   b   move beginning of data in a partition
   c   change number of cylinders
   d   print the raw data in the partition table
   e   list extended partitions
   f   fix partition order
   g   create an IRIX (SGI) partition table
   h   change number of heads
   i   change the disk identifier
   m   print this menu
   p   print the partition table
   q   quit without saving changes
   r   return to main menu
   s   change number of sectors/track
   v   verify the partition table
   w   write table to disk and exit

Expert command (m for help): f
Done.

Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
---
Last updated: 2014-06-17

2012-12-21

HOWTO: boot from a USB drive without BIOS support (using Plop Boot Manager & GRUB 2)

Plop Boot Manager is a freeware featureful x86 boot manager which can be executed from different media (e. g., HDD, CD / DVD, FDD, network, PCI option ROM). It can be loaded by BIOS or by another bootloader (LILO, GRUB, Syslinux etc.). It also has a (unique?) USB drive boot feature with no BIOS support requirement (note: PlopBoot's USB driver currenly provides exclusively a read-only DOS USB drive access).

In case you've installed some GNU / Linux distribution with GRUB 2 bootloader, here is a quick example of how to boot from USB drive using Plop Boot Manager started from GRUB 2:
  1. download the current version of Plop Boot Manager, extract the plpbt.bin file from the archive and put it into the /var/tmp/ folder (you can remove that file later when it's not needed anymore; no admin / root / superuser permissions needed to access this temp folder);
  2. reboot and wait for the GRUB menu interface to appear;
  3. press the 'c' key to enter the command-line interface (CLI) of GRUB:
    grub> _
  4. in case /var/tmp/ is not located on the boot / root partition, but, for example, on the 2nd partition of the 1st HDD, you should start with this GRUB CLI command:
    set root=(hd0,2)
  5. load the PlopBoot itself:
    linux16 /var/tmp/plpbt.bin
    boot
  6. after the Plop Boot Manager has been executed, you can select 'USB' from its menu to boot from your USB drive.
You can also permanently put Plop Boot Manager into the GRUB 2 boot menu (please read the appropriate section of the Plop Boot Manager documentation).
---
Last updated: 2014-06-10

2012-12-13

Debian Multimedia vs dmo

Be careful:
  • http://www.deb-multimedia.org [AKA "dmo",
    formerly debian-multimedia.org (CAUTION: as of June 2013, the old domain has expired and been taken over by some cybersquatters; thanks to the official Debian Project blog for news)]
    is not an official Debian repository —
    it's a private archive administered by a DD [Debian Developer] named Christian Marillat (with some assistance from another DD, Thibaut Varene):
    please read the explanation in the Debian Multimedia FAQ and a discussion between Christian Marillat & Stefano Zacchiroli (the DPL [Debian Project Leader] at that time) regarding the dmo domain name etc.;
  • well, dmo contains some useful software which still hasn't made its way into Debian archives or simply can't be pushed there due to non-free licenses, software patents etc.;
    some packages duplicate the official Debian ones, but differ in some configurations etc.;
  • installing multimedia software from dmo also pulls dmo versions of related libraries (e. g., libavcodec*);
    all installed packages which have corresponding dmo ones will get "upgraded" to dmo versions too (if you don't lock them explicitly);
    it can not only break some "unrelated" software functionality:
    if you decide to stop using dmo repository, you'll also need to restore the affected packages to Debian official versions manually
    due to version conflicts (e. g., to get a higher priority, dmo packages often use a greater "epoch" version number compared to packages in official Debian archives);
  • the best way to use that resource is not to add it to the APT reposiories lists;
    instead of that, it's better to download & install individual packages from there;
    in many cases, dmo's binary DEB packages wouldn't install correctly on a clean Debian system, so you need to download the source packages, correct them (in most cases, all you need is just to correct / modify / clean the dependencies) and build the binary packages with an automated tool like pbuilder;
    after that, manually install the built packages:
    # dpkg -i somepackage.deb
    
    and attempt to resolve the dependencies:
    # apt-get -f install
  • if you still want to use dmo as an APT repository, consider using mirrors to save some bandwidth for the main dmo website :)

2012-11-21

Some notes about the serial ports & USB-to-serial bridge controllers / converters / cables

Sometimes you may need to get a serial / console cable to connect your embedded device (a router / mobile phone / etc.) to your desktop / laptop computer to do some debugging / administration / maintenance operations (e. g. firmware upgrade).

Basically, there are 2 common versions of serial ports which have incompatible voltage logic levels: ones using TTL/CMOS [lower, 5V / 3.3V] levels and others with RS-232 [higher, up to 25V!] ones.
  • RS-232-level serial ports are commonly found on relatively older PCs; these ports are often marked as "COM" and usually have DB9M connectors; in some cases, serial ports have DB25F connectors and should not be confused with parallel ports ("LPT") which were commonly used for connection of printers.
  • The majority of modern embedded devices (such as routers, phones, GPS navigators, multimedia players and TVs) have an internal TTL/CMOS-level serial port.
Caution: please don't connect a TTL/CMOS-level device directly to the RS-232-level port, because you can burn your device!
There are some signal level shifters / converters though, such as the Maxim MAX232 chip.

USB-to-Serial/UART bridge chips operate mostly with TTL/CMOS-level signals; the most widely used series are:
  • Silicon Labs: CP21xx (CP2101, CP2102, CP2103, CP2104, CP2105, CP2108, CP2109, CP2110 etc.);
  • FTDI: FT232 (B, H, R etc.);
  • Prolific Technology: PL-2303 (EA, HX (HXA, HXD), RA, SA, T (TA, TB), X (XA) etc.).
In case you're just looking for device drivers:
  • MS Windows & Apple Mac OS X drivers can be usually found on manufacturer's website (see above);
  • in modern Linux distributions, the necessary drivers are built-in.
FTDI FT232 chips seem to be the best (and most expensive) ones;
meanwhile, Prolific PL-2303 are probably the most popular series of the USB-to-serial converter chips found in old cheap mobile phone USB data cables; therefore, you can easily modify such cable to get a cheap USB-to-serial (UART) adapter instead of buying a separate one.



Warning: poor quality PL-2303 Chinese chip clones can often be found in cheap "data cables".
  • Fake chips are marked like "AS8303", "MS3303" etc., or even fully imitate original markings.
  • Production date printed on the chip is often invalid (e. g., it's far in the future).
  • Their USB device IDs (VID & PID) can be identical to the original chips or different.
  • The chip drivers provided for MS Windows installations are represented by the original or slightly (new copyrights & device IDs only) modified original (often outdated to bypass the original vendor driver protection) PL-2303 drivers.
  • Data communication powered by such a fake chip cable is unstable, can often be interrupted and result in data loss and other problems.
Therefore, cables powered by such fake / clone chips are not very suitable for their "primary usage" in data cables; more to say, they are useless and even dangerous for critical operations like firmware upgrade (incomplete flashing can "brick" the connected device). It's better to discard / recycle / dispose of such garbage adapters.

Here are sample USB device IDs of 2 counterfeit chips (data provided by lsusb utility from the usbutils package in Debian GNU / Linux OS):
  1. marked as "MS3303HG", USB IDs don't resemble the original ones:
    ID 0e55:110b Speed Dragon Multimedia, Ltd MS3303H USB-to-Serial Bridge
  2. marked as "A1 AS8303DS", USB IDs are identical to the original ones:
    ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
---
Last updated: 2014-06-10

2012-07-30

Acer Aspire 3810T (AS3810T): laptop LCD panel (screen) replacement compatibility list

Some of the Acer Aspire Timeline 3810T (AS3810T) laptops have specific LCD panels which often have backlight broken after some operation time (it's caused by a "flex strip"-type powerline bending breakup -- look at that blogpost for more info and pictures).

If your laptop is already out of warranty, you can buy a new LCD screen and replace it yourself.
  • Acer 3810T laptop commonly uses a 13.3" LCD screen [1366 * 768 WXGA; 18-bit RGB (3 * 6 bits) -> 262144 (218) colors] with LED backlight and 40-pin connector.
  • Pay attention to the specific brackets it has, as some display variations will not fit.
  • To prevent future problems, try to get a display with no such overbent "flex strips"; in this list, I've marked supposed "fragile flex" displays with a [bent flex] label.
  • Anyway, better don't buy a display without checking the actual part numbers and product photos (and also datasheets, preferably).
---
Info last updated: 2016-05-10.




Screens confirmed to fit by someone.

AU Optronics (AUO):
B133XW01 V2 [bent flex]

LG Display (ex-LG.Philips LCD):
LP133WH2-TLA3
LP133WH2-TLA4

Samsung:
LTN133AT18



And those displays are believed to work, but need some confirmation.

AU Optronics (AUO):
B133XW01 V3 [bent flex]
B133XW01 V7 [bent flex]
B133XW03 V2
B133XW03 V3

LG Display (ex-LG.Philips LCD):
LP133WH2-TLB3
LP133WH2-TLL1
LP133WH2-TLM1

Toshiba:
LT133EE09300

---
List data last updated: 2013-08-21.

2012-07-29

HOWTO: GRUB 2 rescue mode

Sometimes (e. g., after some disk re-partitioning) your GRUB 2 installation may get corrupted, so after the power-on you get only a "grub rescue> _" command prompt.
In such cases you'll need to know which disk partitions Linux & GRUB are installed on. In our example, it's 'sda7' (the 7th partition of the 1st HDD).

Type the following commands into the GRUB rescue prompt:
set root=(hd0,7)
set prefix=/boot/grub
insmod linux
linux /vmlinuz root=/dev/sda7 ro
initrd /initrd.img
boot
Notes:
  1. instead of '(hd0,7)', '(hd0,msdos7)' can be used for root;
  2. an alternative prefix is '(hd0,7)/boot/grub';
  3. an alternative insmod command argument path is '(hd0,7)/boot/grub/linux.mod'.
After successfully booting your GNU/Linux system, you should repair your GRUB 2 installation (execute these command as root, use su, or even better, sudo):
# grub-install /dev/sda
# update-grub2
Note: some people like to execute not update-grub2, but update-grub or even grub-mkconfig.

On the next reboot, it should work fine.

Some more useful GRUB2 reading:
  1. GNU GRUB Manual
  2. GRUB2 - ArchWiki
  3. Grub2 - Debian Wiki
  4. Grub2 - Community Ubuntu Documentation
  5. How To Fix GRUB 2 [Linux] ~ Web Upd8: Ubuntu / Linux blog
  6. linux - Making "default saved" work with GRUB2...? - Super User
---
Last updated: 2013-08-31

And now for Debian "testing" / LXDE

After all the Ubuntu / Unity / GNOME 3 challenges, I've switched to Debian "testing" (pre-"Wheezy") distribution with LXDE, and it even seems to be usable :)

http://wiki.debian.org/LXDE

2012-04-07

MultiMedia Players in Windows and Linux

For MS Windows, my favourite audio player is foobar2000 [official site / Wikipedia]
(I'm tired of Winamp [official site / Wikipedia], and especially of the Windows Media Player [Wikipedia]; some people may like something else, e. g. AIMP [official site / Wikipedia]).

---

For playing video, I use VLC media player [official site / Wikipedia], MPC-HC ("Media Player Classic - Home Cinema") [official site / Wikipedia] and (very rarely) MPlayer (incl. forks).

===

In GNU/Linux, there are 2 powerful media players I frequently use (mostly for playing video): VLC and mpv [official site / Wikipedia].
mpv is a popular fork of MPlayer [official site / Wikipedia] & mplayer2 (itself a fork of MPlayer; now abandoned); they say it has more features and more rapid development process than the original one.
Sometimes I used mplayer[2] with a (now abandoned) GUI called gnome-mplayer.
BTW, I neither like nor use GNOME Videos (formerly called Totem) [official site / Wikipedia].
And some users also like xine [official site / Wikipedia] and Kodi (formerly XBMC) [official site / Wikipedia].

---

There are some pretty console audio players: mpg123 (probably the best MP3 player around) [official site / Wikipedia], cmus ("C* Music Player") [official site / Wikipedia], moc ("music on console") [official site / Wikipedia], mp3blaster (now obsolete) etc., but I prefer mpv there :)

And now about GUI audio players. Some years ago I used XMMS ("X MultiMedia System") [official site / Wikipedia] (now discontinued) and Amarok [official site / Wikipedia] (it was too overweight for me). In the near past, I used Rhythmbox [official site / Wikipedia]; when Banshee [official site / Wikipedia] became the default player in Ubuntu, I was very disappointed (it was much more buggier than Rhythmbox and used that C# / Mono / .NET / etc. stuff); then I tried to use LXMusic (it uses XMMS2 [official site / Wikipedia] backend and has a minimalist GUI) for some time, used Exaile [official site / Wikipedia] a few times...
...and finally switched to Audacious [official site / Wikipedia]
(Audacious is a fork of (now defunct) Beep Media Player [official site / Wikipedia], which itself was a fork of XMMS; BTW, it supports Winamp skins; not to be confused with Audacity [official site / Wikipedia], a popular audio editor).

Some other popular players:
---
Last updated: 2016-12-11