Archive

Archive for the ‘linux’ Category

Eclipse lockups, adb, Linux, ModemManager

September 24, 2014 Leave a comment

I’ve been seeing Eclipse freeze spontaneously lately, both in Fedora 20 (my daily environment) and Ubuntu 14.04 / 14.10 (separate boot for playing with Android L).

https://code.google.com/p/android/issues/detail?id=75562

I tracked down the issue (using jstack) to an adb related thread inside Eclipse Android Tools. Doing adb kill-server would end the freeze, until the next time.

Then I had an idea to check the system log the next time it would happen. Interesting. Turns out, ModemManager, a part of NetworkManager (used by both Ubuntu and Fedora for automated network configuration) was:

– recognizing my Android phones as modems
– trying to determine their capabilities
– timing out when doing that (but taking a few seconds to do so)
– and this was causing the adb thread inside Eclipse to wait, freezing the Eclipse UI

Two possible workarounds, I’m using the second one:

– switching USB connect mode in each phone’s settings from MTP (default) to Camera
– adding stuff to udev configuration to blacklist the Android phones from ModemManager‘s automatic detection


/etc/udev/rules.d/51-android.rules

# Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="wheel", ENV{ID_MM_DEVICE_IGNORE}="1"
# ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="wheel", ENV{ID_MM_DEVICE_IGNORE}="1"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="wheel", ENV{ID_MM_DEVICE_IGNORE}="1"

The ENV{ID_MM_DEVICE_IGNORE}="1" stuff at the end tells ModemManager that the device is not a modem.

PS – to be fair, Android phones can act like modems, when enabled in the phone’s system settings. Why they also look like modems, but don’t respond to commands, even when this setting is off.. Who knows?

PPS – there appears to be no way to uninstall ModemManager from Fedora and keep NetworkManager, too bad.

Categories: android, linux, tools

Debian, XFCE, Google Chrome, ugly fonts (all of a sudden)

August 15, 2012 5 comments

I noticed today that KDE4 in Debian Testing is now at (almost) the recent version and decided to give it a try.

After doing this (and purging KDE4 from my system… again…) I returned back to my usual XFCE environment and all of a sudden fonts in Google Chrome looked ugly, different than before.

The fonts in Chrome’s window decorations (page title, bookmarks bar) were fine, it’s just the fonts in web page content that appeared without hinting. Other apps were fine too.

Checked XFCE’s font settings (I prefer to use anti-aliasing and slight hinting), switched antialiasing and hinting off and on, checked /etc/fonts, nothing helped.

Did some searching on the web, and here is the fix.

~/.fonts.conf needs to have a section at the end (marked below) that apparently doesn’t get added by XFCE’s font config applet, but is necessary for Chrome.


<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintmedium</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
<!--
***** 
***** The following section was missing.
***** Adding it fixed web page fonts in Chrome.
*****
-->
 <match target="font">
  <edit name="autohint" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>
Categories: linux

Reducing MySQL memory usage

June 6, 2012 1 comment

My other site, http://www.aqua-mail.com is hosted in Xen virtual machine with 512 MB of RAM.

Of those 512, about 300 were taken by MySQL daemon, causing some swap use.

I was able to get MySQL down from 300 to about 60 megabytes of RAM by doing the following.

Most of my tables were already using MyISAM engine, but there was a couple using InnoDB.

1) Converted the remaining tables from InnoDB to MyISAM, by running this in the PhpMyAdmin SQL window:


ALTER TABLE table_name_here ENGINE=MyISAM;

2) Disabled InnoDB support by creating a new config file in /etc/mysql/conf.d, with this content:


[mysqld]
default-storage-engine = myisam
skip-innodb

The file can have any name you want, as long as it ends with “.cnf“.

3) Restarted MySQL:


service mysql restart

I’m sure InnoDB is a terrific engine, and Oracle had a very good reason for making it the default starting with MySQL 5.5.

However, for a low-memory VPS system, low-traffic web site, avoid swap should probably be a priority.

Categories: linux

Google Chrome slow on Linux?

I’m running Google Chrome on Debian Wheezy (testing) 64 bit.

For the last couple of months it often had issues rendering the home page after the initial launch, getting stuck for a few seconds, then snapping back.

The last few days, it also started running slow as molasses.

Solution? Simple:

Went into chrome://plugins/

Disabled “Remoting Viewer”

( don’t need this anyway, and didn’t enjoy finding out it was enabled by default )

Was I hacked? My Linux system is behind a home router with a firewall, so it seems unlikely. Probably just a Chrome plugin bug.

Categories: linux