Elijah Lofgren

I follow Jesus Christ and enjoy reading, writing, helping people, and making websites. Who is Jesus?

My life mission: "Whatever you do, do it all for the glory of God." - 1 Corinthians 10:31

You are here: Home » Ubuntu and Kubuntu Tips » Hardware Tips

Contents

Hardware Tips for Ubuntu and Kubuntu

How I got suspend to disk working

I tried for a long time to get suspend to ram working, but I couldn't get my PC to wake up properly.

Here's how I got suspend to disk working (adapted from Experimental Dapper and suspend2 packages):

Note: I don't use the nvidia driver anymore. Instead I use the open source "nv" one because suspending to disk didn't work right for me with the binary Nvidia driver. So if you have a nvidia card make sure you are using the open source "nv" driver.

  1. Add this line to your /etc/apt/sources.list:

    deb http://dagobah.ucc.asn.au/ubuntu-suspend2 dapper/
  2. Run:

    sudo apt-get update
  3. Run:

    sudo apt-get install suspend2
  4. Find the name of your swap partition:

    grep swap /etc/fstab

    Should output something like this:

    /dev/sda5       none            swap    sw              0       0

    That would mean that /dev/sda5 is the name of your swap partition, remember this

  5. Open /boot/grub/menu.lst and find a line like this:

    # kopt=root=/dev/sda3 ro
  6. Add something like " resume2=swap:/dev/sda5" to the end of it so it looks something like this (replace /dev/sda5 with the name of your swap partition):

    # kopt=root=/dev/sda3 ro resume2=swap:/dev/sda5
  7. Run:

    sudo update-grub
  8. Reboot your PC into the new kernel
  9. To suspend to disk run:

    sudo hibernate
  10. Then next time you turn on your PC, everything you had open should be restored on boot up.

Enable mounted CDs to be ejected when eject button is pushed

NOTE: I DON'T DO THIS ANYMORE AND I DO NOT RECOMMEND YOU DO IT! It makes tons of errors be spewed into /var/log/messsages

  1. Open /etc/sysctl.conf and add the following line:

    dev.cdrom.lock=0
  2. Reboot your computer.

Install and set up Nvidia binary driver

Follow the BinaryDriverHowto/Nvidia page in the Ubuntu wiki.

Note: I don't use the nvidia driver anymore. Instead I use the open source "nv" one because suspending to disk didn't work right for me with the binary Nvidia driver.

Disable second sound card so that flash will work

Add a line like the following to /etc/modprobe.d/blacklist

blacklist snd_ens1371

Get Samsung SCX-4100 printer and scanner working

Last updated: March 1, 2008, I can't seem to get my scanner working on Gutsy :/

  1. First, you need to install some required libs and programs:

    sudo apt-get install libstdc++2.10-glibc2.2 libsane-dev sane sane-utils
  2. Download the Linux driver from the SCX-4100 Downloads page
  3. Open a terminal and change to the directory where you downloaded the driver (example: /home/install/samsung-scx-4100-printer):

    cd /home/install/samsung-scx-4100-printer
  4. Extract the driver (the driver could be named something different if it has been updated):

    tar -xzf 20070725084555687_UnifiedLinuxDriver.tar.gz
  5. Start the driver installation script:

    sudo ./cdroot/Linux/install.sh
  6. Press "4" because you want to install the "[4] SCX 4100 Series" driver
  7. Press "1" since you want to "[1] Install driver package".
  8. You should already have CUPS installed so Press "2":

    [2] I am sure I have necessary software installed. Continue installation
  9. You'll get a whole spew of stuff printed on the screen along with some errors that you can probably just ignore.
  10. Open /etc/cups/printers.conf Under "DefaultPrinter scx4100" change the "DeviceURI" so it looks like this:

    DeviceURI file:/dev/usblp0
  11. Restart cups:

    sudo /etc/init.d/cupsys restart
  12. If printer gets stuck in a stopped state do the following (on KDE, I assume Gnome has something similar)
    1. Click on "K Menu -> System Settings"
    2. Click on "Printers"
    3. The "scx4100" printer should already be selected, if not click on it.
    4. Click on the "Printer" button near the top.
    5. From the drop-down click on "Start/Stop Printer -> Start Printer"
  13. Printing should now work.
  14. Add the following 2 lines near end of /etc/udev/rules.d/45-libsane.rules (use sudo with your favourite text editor)

    # Samsung|SCX-4100
    SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="3413", MODE="664", GROUP="scanner"

    Be sure to put it before LABEL="libsane_rules_end"

    All this does is make sure that the permissions for the device file is correct and setting its group to scanner. The device is identified by the vendor id and product id. So all users in group scanner will now have access to the scanning functions.

  15. Add the following 2 lines to the end of /etc/udev/rules.d/60-symlinks.rules (use sudo with your favourite text editor)

    # Create symlink for usb printer to /dev/usb/lp*
    BUS=="usb", KERNEL=="lp[0-9]*", SYMLINK+="usb/%k"

    A usb printer is assigned the device file /dev/usblp0 (or whichever number at the end). See /etc/udev/rules.d/20-names.rules which is where it is assigned. These lines make sure that the devices are also symlinked to /dev/usb/lp0.

    These rules will be read and executed on startup so no other startup scripts are necessary.

  16. You don't have to restart just execute:

    sudo /etc/init.d/udev restart

    This will restart udev.

  17. Scanning using OpenOffice.org (Insert -> Picture -> Scan -> Request), and the GIMP (File -> Aquire -> xscanimage -> Device dialog...) should now work.

Get Samsung SCX-4521F printer and scanner working

The Samsung SCX-4521F is a Laser Multifunction Printer, Copier, Fax, and Color Scanner. On the Samgung SCX-4521F Specifications page it says that is is compatible with the "Linux OS (via USB interface only) including Red Hat 8.0-9.0; Fedora Core 1 to 3, Mandrake 9.0 to 10.2, and SuSE8.2 to 9.2". I have successfully gotten the SCX-4521F working with Kubuntu Linux Dapper Drake. This how to has been reported to work in Mepis 6 beta 5. This how to has also been reported to work with the SCX-4100.

I found the tips on Samsung SCX-4100 Linux Installation page useful when trying to get the SCX-4521 working. To get the SCX-4521 printer and scanner working in Kubuntu (or Ubuntu) Linux:

  1. First, you need to install some required libs and programs:

    sudo apt-get install libstdc++2.10-glibc2.2
    sudo apt-get install libsane-dev sane sane-utils
  2. Download the updated driver from the SCX-4521F Linux driver download page.
  3. Open a terminal and change to the directory where you downloaded the driver (example: /home/install/samsung_printer):

    cd /home/install/samsung_printer
  4. Extract the driver (the driver could be named something different if it has been updated):

    tar -xzf 20051130084513156_DriversPack-1.0.165.tar.gz
  5. Start the driver installation script:

    sudo ./cdroot/Linux/install.sh
  6. Press "6" because you want to install the "[6] SCX 4x21 Series" driver
  7. Press "1" since you want to "[1] Install driver package".
  8. You should already have CUPS installed so Press "2":

    [2] I am sure I have necessary software installed. Continue installation
  9. You'll get a whole spew of stuff printed on the screen along with some errors that you can probably just ignore.
  10. Open /etc/cups/printers.conf Under "DefaultPrinter scx4x21" change the "DeviceURI" so it looks like this:

    DeviceURI file:/dev/usblp0
  11. Restart cups:

    sudo /etc/init.d/cupsys restart
  12. Printing should now work.
  13. Add 2 lines like this to the end of /etc/udev/rules.d/45-libsane.rules before the LABEL="libsane_rules_end" line (based on output of sane-find-scanner) so that people in the "scanner" group and not only root can use the scanner. (You'll have to reboot after doing this.):

    {literal}
    # Samsung|SCX-4521F
    SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="3419", MODE="664", GROUP="scanner"
  14. Restart udev:

    sudo /etc/init.d/udev restart
  15. Create a symlink that is required to for Xsane to be able to see the scanner:

    sudo mkdir /dev/usb 
    sudo ln -sfn /dev/usblp0 /dev/usb/lp0
  16. Now to keep from having to type the above commands after every reboot, do the following (thanks to Olivier Vogel for this info!):
    1. Create the file /etc/init.d/samsung.sh with the content:
      #!/bin/bash
      mkdir -p /dev/usb
      ln -sfn /dev/usblp0 /dev/usb/lp0
    2. Make it executable with the command:
      sudo chmod 775 /etc/init.d/samsung.sh
    3. Make it be run on every boot:
      sudo update-rc.d samsung.sh defaults
  17. Scanning using "xsane", OpenOffice.org (Insert -> Picture -> Scan -> Request), and the GIMP (File -> Aquire -> xscanimage -> Device dialog...) should now work.

Fix xsane crashing on Kubuntu

By default Kubuntu makes GTK applications use KDE styles. This sometimes causes problems, and in this case it causes xsane to crash.

Here's how to make the Ubuntu Human style be used for GTK programs:
  1. First install the "'ubuntulooks' theme for GTK+ 2.x ":
    sudo apt-get install gtk2-engines-ubuntulooks
  2. Open: K Menu -> System Settings"
  3. Click on "Appearance" in the top left corner.
  4. Click on "GTK styles and fonts"
  5. Under "GTK Styles" select "Use another style:" and choose "Human" from the drop-down list.
  6. Click the "Apply" button.
  7. There, you should no longer get a "Segmentation fault" when you start xsane. (Side note: I think if you log out and back in the colors used in GTK programs will no longer be orange, but will use your Kubuntu blue.)

Get Minolta Magicolor 2300 DL printer working

To get the Minolta Magicolor 2300 DL printer working you just need to follow the instructions on the foo2zjs driver page. You need to install the "build-essential" package to use the "make" command to build the driver. Install it by running this command:

sudo apt-get install build-essential