Monthly Archives: May 2009

Installing Samsung ML-2010 driver on an eeepc

Have been meaning to write this when I was struggling with it for the first time, but never got round to doing it. Now, I needed to do it again, and here’s my report.

If you own a Samsung ML-2010 (or 2010R) printer, you may or may not know that it requires very special printer drivers due to Samsung’s own printer language SPL. The eeepc by default only supports the printer by half. You may hook the printer up to your netbook and it will even recognize it and suggest the (normally) correct driver/PPD. However, if you go with those suggestions, you won’t be able to print, because the installed software lacks the translation engine for SPL. It could be included (as it is with most current Linux distributions). There is an open source implementation called splix that I have previously written about when I ported it to the D-Link DNS-323 NAS device. Unfortunately, I haven’t been able to find a working binary package for the eeepc (and was too lazy to set up a build or cross-compile environment for it.) I found an easy alternative, though, that didn’t involve installing the huge and messy Samsung driver in its entirety. Here’s what I did:

  1. download the Samsung unified driver and save it to /home/user
  2. extract it (e. g. through the file manager and right-click on the archive). You should end up with a folder /home/user/cdroot.
  3. open a terminal (press house-key and “T”)
  4. cd /home/user/cdroot/Linux/i386/at_root/usr/lib/cups/
  5. cp backend/mfp /usr/lib/cups/backend/
  6. cp filter/rastertosamsungspl* /usr/lib/cups/filter/
  7. /etc/init.d/cupsys restart

Before you delete the driver archive and the extracted cdroot directory, be sure to add your printer. When the “add printer” wizard suggests a driver, don’t accept the default, but select the ppd from file. You’ll find the ppd files covered by the unified driver under: cdroot/Linux/noarch/at_opt/share/ppd/ML-2010spl2.ppd

Note, that not all printers supported by the unified driver use SPL. So, the procedure above may not work for every one of those printers. If you pick a ppd file of a printer using a different printer language, you will get errors in the cups logs (/var/logs/cups/) about a missing filter. You may get away with copying the other filters, too (in step 6). However, those may depend on additional libraries (check with ldd), which also may need to be copied to appropriate places (like /usr/lib).

Advertisements
Tagged , , , , , ,

How I learned to love my wife’s eeepc … again

Last year, when my wife was somewhat annoyed with me tinkering around with our computer rendering her unable to access her email, she saw the ASUS eeepc during some TV coverage of cebit. She had to have it.

I decided, at the time, that if my wife wants to have a technical gadget, it was my duty to support that, esp. as it was a Linux box. Furthermore, her birthday in November would give the display time enough to grow a bit from the original, tiny one. So, I waited and eventually bought a 900A at a very good price some time in October last year.

I configured the beast and with the exception of my wife having to switch to thunderbird from evolution, she felt comfortable from day one. It even encouraged here to play around more and try things out, where previously she would have constantly been afraid to break something. The only minor issue was with the keyboard, where the space-key was not mounted evenly and was very hard to operate. This we didn’t regard as a big problem until two months ago, when we sent it to ASUS to have the issue fixed. The whole repair procedure was very convenient and professional. The only very minor thing was that when the online tracking tool said the machine was fixed, we got no further update as to whether it was shipped already, or when it would. So, for a few days, we were a bit lost. Overall, though, I’d give the service a big thumbs-up.

When the netbook returned, I noticed the disk had been reset and the software updated. I don’t know why replacing the keyboard requires deleting user data, but I had been warned and backed everything up. That was no big deal. What was a bit annoying was the fact that the touchpad behaved differently. On every other mouse movement you would accidentally e. g. activate a link on a web page, or activate an item in a sub-menu when actually you wanted to dismiss the menu. I twiddled around with the settings for a bit and managed to get it work in a way that at least did not render the touchpad completely useless, but it was still kinda annoying with unwanted clicks every now and then. Then the netbook stopped to join our home WLAN network. You would need to explicitly join on every reboot and then the notification area icon would not refresh the status (even if ifconfig would show the DHCP address). Finally, pressing the power button no longer brought up the shutdown/suspend dialog and when shutting down through the power icon in the notification area, the system would not power off completely. You would always have to wait for disk activity to stop and then have to press and hold the power button (prolly smth. around ACPI broken). Very, very odd … and very annoying.

So I started to review my options, was even looking at other distributions, esp. at ubuntu-based ones, where I was hoping a larger, technical community would help working out such issues better. Before going there, I wanted to see if a factory reset might be enough to get things back to normal. I backed up the whole user directory to my DNS323 NAS device. Then, just to play it safe, I followed the steps here to get a way to boot into single-user mode. Then I rebooted, entered the grub menu by holding F9 after powering on, and selected “Restore factory settings”. I followed the wizard, rebooted again, joined the WLAN network, rebooted once more … and everything was back to where we were when we initially got the box: WLAN joined automatically, shutdown dialog displayed on press of power button, touchpad working as before.

The conclusion then was that some updated messed up the system. Now, while I understand automatic updates for security fixes and new features, I hate it, when they break a running system. If that’s what I wanted, I’d never have switched from Windows to Linux. So, what I did was manually install just a few application updates that I though would not do any harm (firefox, acrobat reader, and such), then I disabled automatic updates.

Disable Automatic Updates

Disable Automatic Updates

As my wife uses German localization, “Software-Verwaltung” would be “Software Management” on the preferences/settings tab, “Aktualisierungen” is “Updates” and the two checked boxes would be something along the lines of “Confirm installation of updates” and “Show Icon on demand”. Everything else is deselected.

Since the update service had already downloaded the list of available updates and I don’t have a way of saying “I don’t want this update, EVER”, on every reboot the notification area would alert me and ask me whether I want to install the available updates. I know my wife had basically installed every single update just to get rid of that pop-up. As I didn’t want that, again, I needed to turn that off, too. Here’s how I did it:
rm -rf /var/cache/UpdateService/
cp /opt/xandros/share/UpdateService/Updates.xml /opt/xandros/share/UpdateService/Updates.xml.orig

Then edit /opt/xandros/share/UpdateService/Updates.xml to look like this:
<data remote-timestamp="Fri, 22 May 2009 06:56:07 GMT" timestamp="2009-05-23 21:14:15 UTC" >
</data>

Now, everything’s back to normal, and my wife is a happy camper again. (And if she is, I am … or at least, if she isn’t, it’s hard for me to be ­čśë )

Tagged , , , ,

Java Generics demystified

After having just bashed one book, I need to do something for the Yin/Yang balance. So, here’s a book recommendation:

Book: Java Generics and Collections

Book: Java Generics and Collections

While one may sometimes think that books on programming languages are obsolete with everything out there on the Internet, there are situations when after researching for hours, reading tutorials, blogs reiterating the tutorials, etc., you wish you just had somebody with some real in-depth knowledge to explain things to you. If the matter in question is generics in Java, I can absolutely recommend this book by Maurice Naftalin (funny last name, though) and Philip Wadler. It goes way beyond what the vast majority of tutorials explain. You might find everything in the Java Language Specification, but this book is certainly easier to consume.

It has solved these questions for me:

  • Q: How do you subclass a class with fairly wide type bounds in such a way that you restrict the bounds but not just select a parent further down the chain? For example, you may want to allow just one specific type.
    A: You don’t put the type in the declaration of your child class, but in its extends/implements clause. So, you don’t do:

    // THIS DOES NOT COMPILE
    public MyMap<String, MyObject> extends AbstractMap {

    You could potentially do:

    public MyMap<K extends String, V extends MyObject> extends AbstractMap {

    Since String is final, that may be OK, but are you safe on V? Maybe, maybe not.
    To pin this down, you could do:

    public MyMap extends AbstractMap <String, MyObject> {
  • Q: How do you use a generic method when the type cannot be inferred from the method parameter (e. g. because there is none)?
    A: Let’s say you have a method like this:

    public class MyClass<T extends Blah> {
    ...
    public List<T> getList()

    And then you want to call this from another generic class. The following may work but -Xlint:unchecked complains.

    public class MyOtherClass<T extends Blah> {
    MyClass<T> foo;
    ...
    List<T> bar = foo.getList();

    The clean way to do it, is:

    List<T> bar = foo.<T>getList();

If you’re interested, you’ll find the book with this information:

Title: Java Generics and Collections
Authors: Maurice Naftalin, Philip Wadler
Published: October 2006
Pages: 284
ISBN 10: 0-596-52775-6 | ISBN 13: 9780596527754