Monday, August 29, 2016

Slow name resolution after vpnc connection times out



I've had this issue with an Ubuntu 14.04 install for a while. After leaving the laptop to suspend with a vpnc connection open, problems would arise. I would come back and log into the pc, but validating th password takes around 10 seconds! Subsequent calls to sudo do the same.

The 10 second timeout is caused by name resolution trying to resolve hostnames via a VPN-only name server. The culprit is vpnc which failed to clean up the name resolution configuration when the VPN connection failed. More details here: https://www.pythian.com/blog/ubuntu-904-jaunty-jackalope-vpnc-and-resolvconf/

 As suggested in the link above, the cure is to run
sudo /sbin/resolvconf -d tun0

possibly via a cron script to facilitate automatic cleanup.

Tuesday, April 12, 2016

Slow dns lookups after suspending with vpnc running

Resolution:
remove "search lan" from /etc/resolv.conf

Friday, February 20, 2015

mythbackend hangs with error "MainServer: Unknown socket closing MythSocket"

This error seems to occur every few months. It will also take down XBMC To fix it:
  1. kill -9 xbmc 
  2. sudo service mythbackend stop
  3. sudo service mysql stop
  4. ps ax|grep mythbackend
  5. kill -9 all mythbackend instances found
  6. sudo service mysql start
  7. sudo service mythbackend start
Finally restart XBMC and rock on!

Saturday, November 8, 2014

usb IR receivers change device name on reboot

I have three USB ir receiver devices in the HTPC, /dev/lirc[123]. On reboot they sometimes switch places and then I have to edit /etc/lirc/hardware.conf to point to the right one. In my case, the right one is the FINTEK. There seems to be a stable device name in /dev/input/by-id/*FINTEK*, but plugging that into hardware.conf instead of /dev/lirc[123] does not work.

Tuesday, January 8, 2013

Using a second IR receiver in Asrock ION330 HTPC

I have added a Windows MCE USB IR receiver to replace the failing builtin receiver in the ION330. Its a cheap chinese HP-branded unit from ebay. The kernel log identifies it as a
[17299.712107] mceusb 2-6:1.0: Registered FINTEK eHome Infrared Transceiver with mce emulator interface version 2
I followed these steps to get it working:

  1. sudo dpkg-reconfigure lirc
    and choose a Windows Media Center Remote (all) as receiver. I chose None for transmitter.
  2. Manually edit /etc/lirc/hardware.conf to use /dev/lirc1, since the builtin Nuvoton receiver is on lirc0
  3. Work around this bug by this method (for Ubuntu 12.04, should be fixed for 12.10):
     sudo ln -s /lib/modules/3.2.0-23-generic-pae/kernel/drivers/staging/media/lirc /lib/modules/3.2.0-23-generic-pae/kernel/drivers/staging/lirc
    Remember to substitute your kernel version.
  4. sudo service lirc restart
  5. testing with irw now works

Saturday, May 28, 2011

Control HTPC with keyboard/mouse from laptop

use x2x.
ssh to the HTPC with X forwarding
ssh -X HTPC
Then install x2x on the htpc:
sudo apt-get install x2x
Allow xhost connections to the htpc:
DISPLAY=:0 xhost +
finally issue the command
x2x -east -to :0


Note that xhost allow all is unsecure, unless you are on a trusted network. It is advisable to ssh tunnel x2x when running over an unsecure network.

Monday, April 25, 2011

Canon MP640 on Ubuntu

I used the excellent guide of Eduard Dopler to get it working.

Reposting here for archival purposes:

Install Canon MP640 on Ubuntu
Before all else: The multifunction printer MP640 by Canon works fine under Ubuntu, even via WLAN!



1. Updates via PPA
In order to make sure that CUPS and SANE are up to date, I recommend fresh updates via the PPA sources.

sudo add-apt-repository ppa:robbie.w/cups-bjnp
sudo add-apt-repository ppa:robert-ancell/sane-backends
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install cups-bjnp
sudo /etc /init.d/cups restart
2. Download Printer Drivers…
Afterwards we have to download the printer driver and—if required—the scanner software from the Canon (AsiaEurope*) site. Visit
Canon’s software center, select Linux and download the Debian printer driver and/or ScanGear.

3.a …and install them
Both files are compressed Debian packages which can be installed as usual, at least on 32-bit systems. People using this architecture can continue with step 4.

3.b Special attention for 64-bit
64-bit systems have to force the installation:

sudo dpkg -i --force-architecture ./cnijfilter-*
sudo dpkg -i --force-architecture ./scangearmp-*
Having installed it that way, we have to check whether the needed libraries are also available in a 32-bit version. Therefor there is the tool getlibs. In fact we have to go through all binaries installed by the Canon software, run them in getlibs and control if the corresponding libraries are installed. By doing that on my Lucid system, I found out that only /usr/bin/scangearmp has to be checked.

sudo getlibs /usr/bin/scangearmp
All missing libs should be listed that way and it prompts to download them. In my situation that was only the case for libgimp2.0.

4. Searching the printer
If the printer is not listed in the printer dialog by now, you can add it with the common printer tools of your desktop environment. Gnome, for instance, has the printer GUI in its System/Administration menu.

5. Editing the printer profile
This step is optional. Your printer should be able to print now. Expecting more features from your printer, you can add special functionality like black-white-printing or the like in your printer profile.
I recommend to edit the following files lest an update overwrites your changes (names may vary, backups of original files self-evident).

/usr/share/ppd/canonmp640.ppd
/etc­/cups/ppd/Canon-MP640.ppd
By editing these files with root access, you can

select more quality levels:
*OpenUI *CNQuality/Quality: PickOne
*DefaultCNQuality: 3
*CNQuality 1/Super High: "1"
*CNQuality 2/High: "2"
*CNQuality 3/Normal: "3"
*CNQuality 4/Standard: "4"
*CNQuality 5/Economy: "5"
*CloseUI: *CNQuality
print in black and white:
*OpenUI *CNGrayscale/Grayscale: PickOne
*DefaultCNGrayscale: false
*CNGrayscale false/Off: "false"
*CNGrayscale true/On: "true"
*CloseUI: *CNGrayscale
set a higher dpi rate:
*OpenUI *Resolution/Output Resolution: PickOne
*DefaultResolution: 600
*Resolution 600/600 dpi: "< >setpagedevice"
*Resolution 1200/1200 dpi: "< >setpagedevice"
*Resolution 2400/2400 dpi: "< >setpagedevice"
*CloseUI: *Resolution
You can also download my edited PPD file. The original one is released under the GNU GPL:
↶ canonmp640.ppd (30.6KB text/plain) or
↶ canonmp640.ppd.gz (4.5KB application/x-gzip)

Again you have to restart CUPS.

6. Final test
The printer driver comes with a handy status tool which is also the place to go if you want to find out what your printer currently does or if you want to check the availability. So cngpijmonmp640 shows you the printer status and ink level (screenshot at the top).

By the way…
Not only does the printer work, but of course also the scanner. I tested it successfully with xsane, ScanGearMP (single and over GIMP) and SimpleScan. Keep in mind that the sane-backends included in Lucid are too old for the MP640—but with the PPA mentioned above it’s very easy to have full compatibility by simply updating the package.

Moreover there is a RPM package for other distributions and the source.