Linux.com

Community Blogs



Install Minimal Ubuntu and Fluxbox

Install a minimal ubuntu system with the mini.iso.

You can get the image from https://help.ubuntu.com/community/Installation/MinimalCD.
Choose the release you want and the architecture appropriate for your machine.

If in doubt, get the 8.04 hardy for i386 (this is the LTS release for standard x86 machines).

At the boot prompt, type cli and hit enter.

This will install a minimal, command line only system.

No graphical packages will be installed and we avoid the gnome dependencies.

One caveat I encountered is that the installer succeeded in autoconfiguring my Intel Pro Wireless card,
but only offered WEP encryption support. Since my router is WPA encrypted, I had to temporarily disable wireless security (or use WEP).
(Once the system is installed and wpa_supplicant added, I reactivated WPA encryption.)

When the system install is completed and the initial boot is done you should be presented with a login in the terminal.

Login with your username and password, update apt repositories and upgrade packages with:

$ sudo aptitude update
$ sudo aptitude safe-upgrade
$ sudo aptitude full-upgrade


then install a minimal graphical environment with:

$ sudo aptitude install xorg slim synaptic medit dillo fluxbox xfce4-terminal xinit menu menu-xdg alsa-utils gdebi-core logrotate localepurge


Note: you can use any terminal emulator you want, I happen to like xfce4-terminal.  :)
logrotate will overwrite old log files with new ones and save disk space.
localepurge removes all of the support and files for languages you DO NOT select. You will be prompted with instructions. Read and follow them. I selected the three that begin with en_US and chose to remove everything else.
Optional:
Dillo is a light-weight web browser without all of the firefox dependencies.
Medit is an Awesome text editor which I enjoy. Xedit will be installed too.

After this, setup will continue and you will soon be presented another graphical prompt regarding uswap and swap space.
Select No (do not continue without swap = let uswap find a swap partition...if you have set one up.)

Once you get back to the terminal prompt, type

$ startx


to start the graphical interface and window manager, Fluxbox.

You should see a blank background and a small taskbar at the bottom of the screen.

Welcome to fluxbox!


Where's the "Start" button?
or just a menu?

Right-click the desktop. Voila!

Up next:

CONFIGURING FLUXBOX




 

Linux in Lebanon

I have been helping out at a computer lab in Neba, which is a small suburb of Beirut. The majority of the people that live there are foreigners from Syria, Egypt, and other Middle Eastern countries.

Read more... Comment (0)
 

Gnome-shell in Ubuntu 9.10

Even though gnome-shell is really only a preview of what is to come for gnome 3.0 and it's still buggy and sometimes not completely stable perhaps, I really like it. When I first saw the screenshots I was less then impressed, I thought it didn't at all look like anything new or innovative, but rather messy and confusing. But me being ever interested in new things and all I just had to give it a try (the gnome-panel look was starting to bore me). Installing was easy
sudo apt-get install gnome-shell
and starting it afterwards was easy too
gnome-shell -r
Though first I had to disable compiz, which I don't really use anyway. I was also using avant-window-navigator, which disappeared on me but still kept part of my notification area to itself. So the time after that I first closed AWN and all was as it should be. I didn't feel like having to manually start gnome-shell every time I logged in so I started looking into a way to replace metacity and gnome-panel with gnome-shell and found that this could be done by editing you gconf (with, for example, gconf-editor) and setting the /desktop/gnome/session/required_components/windowmanager key from metacity to gnome-shell. Of course, since it is a composited window manager you need a video card and driver that can handle screen compositing.
 

Beautify your Linux desktop with Linux wallpapers and artwork!

Some Linux distributions put a lot of time into making sure that their default desktop looks pretty. Others do not. Either way, you don't have to settle for the included artwork in a distribution! Plenty of options exist on the Internet to find more icons and backgrounds for your computer. Here, I will focus on finding Linux specific content, as well as how to participate in the online community of artwork content creation.

Read more... Comment (0)
 

debian Lenny & wacom cintiq 12wx

I recently bought a wacom cintiq 12 wx, after hours of searching, here's how I, eventually, make it work. Hope these clues will be useful to others.  My config :
a fresh Debian Lenny install on a nvidia card Geforce 6800 with 2 video outputs. After conecting the wacom cintiq on the DVI output and having my primary screen on the other VGA output,  my first step was to set  2 X seperated screens.

1. Install the Nvidia driver and setting seperated X screens

I started to install the nvidia driver from nvidia.com (yes, I did use the restricted driver in that case, avoiding much pain) :

http://us.download.nvidia.com/XFree86/Linux-x86/185.18.29/NVIDIA-Linux-x86-185.18.29-pkg1.run 

many pages and blogs explain how to install this on Debian, I will not get further through that point. The  thing is to have a starting xorg.conf working.   see this link :  http://blog.chewearn.com/2008/10/09/nvidia-separate-x-screen-in-intrepid-ibex-beta/

After installing the package from Nvidia... In gnome or whathever, run in terminal   (as normal user), the nvidia configuration tool:

$ nvidia-settings

click on  the “X Server Display Configuration” left pane, if the second screen is not detected,  click "detect displays",  the second display should come up. Click on the "configure" button,  set "seperate X screen". Set your main screen with the resolution of your choice, choose "absolute" option under Position. The NVidia tool detects and auto configures the display for the cintiq (max resolution at 1280 x800), select "RightOf" under Position.

save your X config in your home directory by clicking on "Save to x configuration page" in order to modify it. Backup your old xorg.conf! just in case ..

$sudo cp /etc/X1/xorg.conf xorg.conf.back
$sudo cp ~/xorg.conf /etc/X11/xorg.conf

See my xorg.conf in appendix 1. Note the 'RightOf' option in ServerLayout subsection ... that can be changed to Leftof

 With this working xorg.conf, restart Xserver :

ctrl+backspace

If X restarts without error, you can breath again, otherwise, recover your xorg.conf backup. Now, after log into X, I had 2 seprate X screens, with 2 gnome desktops and only the mouse can cross.

2. Install the tablet

connect your usb wacom

After setting the dual screen, it's time to connect your wacom cintiq through one USB output  of your CPU. Then open a terminal, let's check if the wacom is recognised by using lsusb :

$ lsusb
Bus 001 Device 004: ID 056a:00c6 Wacom Co., Ltd  

the number 00c6  identify the wacom as a Cintiq 12wx

Download last wacom driver and apt-get before compile

first :

$sudo apt-get update

Install the current kernel headers

$sudo apt-get install linux-headers-$(uname -r)

Install  libraries :

$sudo apt-get install build-essential
x11proto-core-dev
libxau-dev libxdmcp-dev
x11proto-input-dev
x11proto-kb-dev xtrans-dev
libx11-dev x11proto-xext-dev
libxext-dev libxi-dev
linux-libc-dev libc6-dev
libncurses5-dev
xserver-xorg-dev tk-dev
tck-dev -y

Install the wacom tools :

$sudo apt-get install wacom-tools xserver-xorg-input-wacom

 From the linux wacom project, get the last driver source code:
http://linuxwacom.sourceforge.net/index.php/dl. When I got the source code, the last package was : linuxwacom-0.8.2-2.tar.bz2. Download and untar in your home directory.

$tar xvfj linuxwacom-0.8.2-2.tar.bz2
$cd linuxwacom-0.8.2-2

3. Now  compile and install the linuxwacom module

before the compilation, I had to (on my system) create or check those following links :

$ sudo ln -s /usr/include/pixman-l/pixman.h /usr/include/pixman.h
$ sudo ln -s /usr/include/pixman-l/pixman-version.h /usr/include/pixman-version.h

In the linuxwacom-0.8.2-2 directory :

$ ./configure -enable-wacom
$ make
and now  install the driver :
$sudo make install

4. xorg config

Backup again your xorg.conf

$ sudo cp xorg.conf xorg.conf.back

Edit xorg.conf in a text editor (gedit, vim, or whatever..) as root or sudo.
According to the xorg.conf, I posted below (see appendix 1), add these lines in "Sever Layout" section and after the lines concerning the keyboard and the mouse :

Section "ServerLayout"
......
    InputDevice    "stylus" "SendCoreEvents"
    InputDevice    "cursor" "SendCoreEvents"
    InputDevice    "eraser" "SendCoreEvents"
    InputDevice    "pad" "SendCoreEvents"

EndSection

For each input devices  given by the cintiq (stylus, eraser, cursor, pad), a section must be added

- the stylus :

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "USB" "on"
Option "Mode" "Absolute"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
Option "PressCurve" "0,15,85,100"
Option "Tilt" "on"
Option "KeepShape" "on"
Option "Speed" "0.5"
EndSection

Note the the option "ScreenNo" "1" limits the input device to the second screen, the cintiq 12wx screen.

- the eraser :

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "USB" "on"
Option "Mode" "Absolute"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
Option "Tilt" "on"
Option "Speed" "0.5"

EndSection

- the cursor:

Section "InputDevice"
    Driver "wacom"
    Identifier "cursor"
    Option "Device" "/dev/input/wacom"
    Option "Type" "cursor"
    Option "USB" "on"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
EndSection

- pad

Section "InputDevice"
    Driver "wacom"
    Identifier "pad"
    Option "Device" "/dev/input/wacom"
    Option "Type" "pad"
    Option "USB" "on"
EndSection  

5. Load the wacom module into the Kernel

 Back to the directory where you compiled the wacom driver (and to the corresponding sub directory of your kernel number), copy the file wacom.ko into the modules kernel directory:

$sudo cp linuxwacom-0.8.2-2/src/src/2.6.27/wacom.ko  /lib/modules/$(uname -r)/kernel/drivers/input/tablet/wacom.ko

Load the module :

$sudo depmod -e

then go back into  the source driver directory and uninstall the old driver :

$cd linuxwacom-0.8.2-2/prebuilt
$sudo ./uninstall
$sudo ./install

 Add Wacom Symlinks to “/etc/udev/rules.d”

first, go to the directory "/etc/udev/rules.d/" and check to see whether a file called “50-xserver-xorg-input-wacom.rules” is present. If not, download the most recent “50-xserver-xorg-input-wacom.rules” from Ron's Debian repository in your home directory:

$wget -O 50-xserver-xorg-input-wacom.rules "http://git.debian.org/?p=users/ron/wacom-tools.git;a=blob_plain;f=debian/xserver-xorg-input-wacom.udev;hb=e110b046292d6aff63b489c9b1aecec25d470cdb"

then copy it to "/etc/udev/rules.d"

sudo cp 50-xserver-xorg-input-wacom.rules /etc/udev/rules.d/50-xserver-xorg-input-wacom.rules

It's time to reboot, so everything will be in place ... Now, your wacom tablet should work.  check if the stylus cover the  screen and if the pointer moves to the stylus. Of course, it's not calibrated yet, the stylus is not exactly under the pointer. If no response, your tablet does not work.. and it was my case at this point ... argh ... so try this,  in a terminal, uninstall wacom-tools :

$sudo apt-get remove wacom-tools xserver-xorg-input-wacom -y

and install again

$sudo apt-get install wacom-tools xserver-xorg-input-wacom -y

then enter again in the wacom driver source directory :

$cd linuxwacom-0.8.2-2/prebuilt

$sudo ./uninstall
$cd ..
$make install

reboot again.

6. Calibrate the wacom : xsetwacom

Xsetwacom is a command line configuration interface, so you can control and change many options of your wacom.  You'll find all the parameters here : http://linuxwacom.sourceforge.net/index.php/howto/xsetwacom

The main issue here is to get the cursor below the pen. I didn't find any formula to translate the resolution of the 12wx screen in tablet unit. to figure this out, I used, by trial and error,  xsetwacom, to get the bottom x and y coordinates of the tablet. In a terminal :

$xsetwacom get stylus BottomX

gives you the button coordinate of the cursor on the X axis

$xsetwacom set stylus BottomX 26500

sets and corrects the X coordinate,  by moving those figures, I had, eventually, the cursor bellow the pen. Obviously, the Y axis must be set accordingly.

$xsetwacom set stylus BottomY 33440

Use the same settings for the eraser :

$xsetwacom set eraser BottomX 26500
$xsetwacom set eraser BottomY 33440

 In order to keep these settings at each reboot, make a simple "cintiq.sh" script. Make it executable, so Gnome (or other window manager, see Google for that) can launch in its startup program list. Personnally, I use fluxbox and added a line  to my "~/.fluxbox/startup" file : "cintiq.sh &" .

$touch cintiq.sh

edit the file (gedit, vim ..) and type your settings. Then, make it executable :

$chmod a+x cintiq.sh

With xsetwacom you can set all the extra keys that come with the wacom 12wx (the pad). Again, use xsetwacom and add your settings to the cintiq startup script. My settings, most of them are  set for Gimp: (see this link http://forum.ubuntu-fr.org/viewtopic.php?id=319659)

#!/bin/sh

# right buttons:

#10
--------
#5
#------7
#6
--------
#8

# left buttons:

#9
------------
#       1
#3---------
#        2
-----------
#4
xsetwacom set stylus Suppress "20"
xsetwacom set stylus RawSample "4"
xsetwacom set stylus ClickForce "6"

xsetwacom set stylus PressCurve "0 25 75 100"
xsetwacom set stylus BottomX 26500
xsetwacom set stylus BottomY 33440
xsetwacom set eraser BottomX 26500
xsetwacom set eraser BottomY 33440
xsetwacom set pad StripRDn "CORE KEY -" #zoom out in Gimp
xsetwacom set pad StripRUp "CORE KEY +" #zoom in  in Gimp
xsetwacom set pad StripLDn "CORE KEY ;"
xsetwacom set pad StripLUp "CORE KEY :"
xsetwacom set pad Button10 "CORE KEY ="
xsetwacom set pad Button9 "CORE KEY p" # switch to pen tool
xsetwacom set pad Button8 "CORE KEY ,"
xsetwacom set pad Button7 "CORE KEY SHIFT"
xsetwacom set pad Button6 "CORE KEY CONTROL y" #redo
xsetwacom set pad Button5 "CORE KEY CONTROL z" #undo
xsetwacom set pad Button4 "CORE KEY k" # ink tool
xsetwacom set pad Button3 "CORE KEY SHIFT"
xsetwacom set pad Button2 "CORE KEY CONTROL z" #undo
xsetwacom set pad Button1 "CORE KEY CONTROL y" #redo
xsetwacom set stylus TPCButton "off"
xsetwacom set stylus Button3 "Button 3"
xsetwacom set stylus Button2 "Button 2"
xsetwacom set stylus Button1 "Button 1"

Search Google about using Gimp with Wacom.

Appendix 1: xorg.conf

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "stylus" "SendCoreEvents"
    InputDevice    "cursor" "SendCoreEvents"
    InputDevice    "eraser" "SendCoreEvents"
    InputDevice    "pad" "SendCoreEvents"
EndSection

Section "Files"
    RgbPath         "/etc/X11/rgb"
    ModulePath      "/usr/lib/xorg/modules"
    FontPath        "/usr/share/fonts/X11/misc"
    FontPath        "/usr/share/fonts/X11/cyrillic"
    FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/Type1"
    FontPath        "/usr/share/fonts/X11/100dpi"
    FontPath        "/usr/share/fonts/X11/75dpi"
    FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "ServerFlags"
    Option         "Xinerama" "0"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option        "XkbRules"    "xorg"
    Option        "XkbModel"    "pc105"
    Option        "XkbLayout"    "be"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "USB" "on"
Option "Mode" "Absolute"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
Option "PressCurve" "0,15,85,100"
Option "Tilt" "on"
Option "KeepShape" "on"
Option "Speed" "0.5"

EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "USB" "on"
Option "Mode" "Absolute"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
Option "Tilt" "on"
EndSection

Section "InputDevice"
    Driver "wacom"
    Identifier "cursor"
    Option "Device" "/dev/input/wacom"
    Option "Type" "cursor"
    Option "USB" "on"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
EndSection Section "InputDevice"
    Driver "wacom"
    Identifier "pad"
    Option "Device" "/dev/input/wacom"
    Option "Type" "pad"
    Option "USB" "on"
Option "TVResolution" "1600x1280,1280x800"
Option "ScreenNo" "1"
Option "Twinview" "horizontal"
EndSection Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "WAC Cintiq 12WX"
    HorizSync       31.0 - 82.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Hitachi CM766"
    HorizSync       31.0 - 96.0
    VertRefresh     50.0 - 180.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 6800"
    BusID          "PCI:1:0:0"
    Screen          1
    Option      "AddARGBGLXVisuals"    "true"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 6800"
    BusID          "PCI:1:0:0"
    Screen          0
    Option      "AddARGBGLXVisuals"    "true"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "metamodes" "DFP: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "metamodes" "CRT: 1600x1280_70 +0+0; CRT: 1152x864 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option "Composite" "Enable"
EndSection
 

 

 



 

 

 

 

Playing Nintendo GameCube Games on Ubuntu

Let's face it, there is a definite lack of availible native games for our system of choice.  One method that can greatly expand upon the amount of games that can be played is running console emulators so that we can play traditional console games.  The best console emulator around for the Nintendo Gamecube is the Dolphin Emulator which has a native linux binary!  Here is a quick walkthrough to help people get there GameCube games running!

Step 1:  Download the emulator for your architecture from here (Either the 32 or 64bit version):

http://www.dolphin-emu.com/downloads.php

Step 2:  Install the libraries that Dolphin needs to run properly.

Open the terminal application and type:

sudo apt-get install scons g++ wx2.8-headers libwxbase2.8-0 libwxbase2.8-dbg libwxbase2.8-dev libwxgtk2.8-0 libwxgtk2.8-dbg libwxgtk2.8-dev libsdl1.2-dev nvidia-cg-toolkit libxxf86vm1-dbg libxxf86vm-dev libxext6-dbg libxext-dev libglew1.5-dev libcairo2-dbg libcairo2-dev libao2 libao-dev libbluetooth-dev libopenal1

Step 3:  Create symbolic link to fix Dependency error.

sudo ln -s /usr/lib/libbluetooth.so.3 /usr/lib/libbluetooth.so.2

Step 4: PLAY!  You are all set to go and can begin playing your favorite Gamecube games on Linux!

 

Cheers

 

Using CPULimit to prevent Firefox+ Flash CPU Overrun.

Ever had this situation?  Go to Youtube to watch the latest fashion in wedding dances, and suddenly your CPU goes to 98% and everything on ..... the ..... box ........ slows ............ to ........ a ........ crawl.   Well there is a way to prevent that overrun and get back control of your system. 

A  project caled CPULimit at sourceforge has for me presented an answer. In a nutshell what it does for your system is tell a running process that it can't consume more than X percent of the CPU max.  In practice on my laptop what I have seen is that while a video is loading I sometimes get some jerkiness for the first 30 seconds. Otherwise, no problem and normal performance, without the CPU overrun.

 Installation on many recent distro's can be accomplished by using the supplied package manager.  On *buntu or Debian just apt-get install cpulimit. Unfortunately I don't have ready access to a Red Hat or SuSE system to verify that they have the package available.   However with the project having been around since Aug 2006, I would be surprised if it wasn't at least in one of the extra's repositories at the very least.  

Once installed I found the process to work easiest when I did the following.

  1. Start Firefox as normal.
  2. Open a terminal window
  3. ps ax | grep firefox
  4. Note the PID of the Firefox process.
  5. sudo cpulimit -l 40 -p [PID]                       # -l 40 means 40% of the max CPU.

Now surf to a youtube (or other flash) video page and try it out.  If you start top you will notice that CPU usage of the Firefox process will max out at around 40% and not go higher. 

Problem space, for me at least was that I didn't want to have to start this by hand every time I opened a Firefox window. (I don't leave my browser or any other window open if I'm not using it,  my personal habit.) Additionally I hate have to  search for the cpulimit process and close it with a kill statement every time I close Firefox.  Time to script a daemon.

The following conditions at any one time could exist.

  • Firefox is running and cpulimit is not =  We need to start cpulimit
  • Firefox   is running and cpulimit is too =  Nothing needs to be done.
  • Firefox is not running and cpulimit is running = We need to kill the cpulimit process
  • Firefox is not running and cpulimit is not running = Nothing to do.

Given the above I now know I need only test for the 1st and 3rd condition since all other possibles require no action be taken by my script.  Follows is my script as I use it.  I'll cover it's aspects later.

 #!/bin/bash                                                                                                       
# Since it's a daemon put it in a while loop to keep it running.
while true; do

# check out the current PID of the running firefox and cpulimit,the extra
# grep is ugly but it gets rid of the case where grep finds itself when doing                   # a grep for the desired process. The awk strips out the PID so we can put                    # it in a variable                      ffpid=`ps ax | grep firefox | grep -v grep | awk -F  '{ print $1 }'`
cpupid=`ps ax | grep cpulimit | grep -v grep | awk -F  '{ print $1 }'`

       #  Check to see if the PID is not a null set 

        if [ $ffpid > "0" ]; then

               # now check to see if the cpulimt process is started and if not start it.                 # Then sleep for 30 seconds.  Otherwise go to sleep       

                if [ -z $cpupid ]; then
                        sudo cpulimit -l 40 -p $ffpid &
                        sleep 30
                else
                        sleep 30
                fi

        else

              # If Firefox is not running (PID not > than 0) we need to check if cpulimit     

              # is   running and stop t if it is.  Then sleep for 30 seconds, if not just sleep.

               if [ $cpupid > "0" ]; then
                        sudo kill -9 $cpupid
                        sleep 30
                else
                        sleep 30
                fi

        fi

done

Given the above script I need to add in the following info.   I tried using -n for the test instead of trying to see if the PID is greater than zero.  Unfortunately the result of the ps ax statement used to grab the PID is never empty so it always returns a true.   This doesn't work.  Since I know that the PID will have to be a number greater than zero I can test for that condition reliably.  

Now I called my script ffdaemon and put it in /home/bin (I've established this dir as being in my $PATH variable. ) and then chmod 755 the file to make it executable.  Now to get it to auto start when I login to my desktop, for KDE I did 

  • cd ~/.kde/Autostart
  • ln -s ~/bin/ffdaemon  ffdaemon 

Now whenever I login this daemon process is started and every 30 seconds it runs it's check.  I experimented with various times and for my system 30 seconds was fast enough to allow me to open firefox, and begin surfing, normally I'm not instantly running a video so I'm OK letting it wait 30 seconds.  Longer than that I could make it to a video first, shorter then the checks themselves became a cpu sucker. 

This is what worked for me, hopefully it's what will work for you as well.

 

Use gdm login with Chinese Language in .xprofile

The GDM locale is different, so don't use like zh_CN.utf8 or zh_CN.UTF-8. Just use zh_CN. That's true, enjoy it with your liked language.

 .xprofile

# mark's note!
# This locale is not real,just for GDM
# So do not use like zh_CN.utf8 or zh_CN.UTF-8
export GDM_LANG=zh_CN
export LANG=zh_CN

# Input for CJK
export XIM=ibus
export XMODIFIERS="@im=ibus"
export XIM_PROGRAM=ibus
export QT_IM_MODULE=ibus
export GTK_IM_MODULE=

 

A Willingness to Learn

The arguement against Linux that bothers me the most is the one that states that inexperienced users just can't handle the change away from Windows or some such.  In my opinion, the only thing holding these users back from learning Linux is an unwillingness to learn.  If they're willing to learn, then the transition is no problem at all.  If they're not, well, they'd be happier sticking with Windows anyway.

To illustrate, I'll talk about a couple of my own experiences.  The first of these was when my wife bought a Macbook Pro (I know, still not Linux...) to replace her Windows laptop.  My mom was interested in getting a laptop, so we sold her my wife's old one.  When we gave it to her, she was rightly concerned as to whether it had all the proper antivirus, antispyware, and firewall software on it.  After assuring her that it did, I told her that for what she uses a computer for, I could install Linux on it and she wouldn't need the antivirus and antispyware, and that she'd still be able to do what she needed to.  She was apprehensive to learn a different way of using the computer, so she declined and told me that XP was fine.  It's not that she's afraid of technology--as a high school librarian, her library was one of the first in the area to switch to computerized records back in the day--but she was comfortable with what she had.

In contrast, my wife's cousin came over a few months back, and was intrigued at the strange-looking (Gentoo running Gnome) desktop on my computer.  I told her what it was, and proceeded to show her stuff like Compiz, multiple workspaces, installation of programs from the repo, and the like: stuff that Windows couldn't offer.  She really liked what she saw, and was particularly impressed with Conky, so I asked her if she'd like me to install Linux on her computer.  She didn't like the sound of it, but I gave her a couple of live CDs for her to try out.  I figured that she wouldn't want to make the switch, but hey, I could take the loss of a few CDs.

The next time my wife's cousin came over to babysit, she asked me if I could "install that program" on her computer after all.  She complained that Vista was too slow on her computer, and was frustrated with its byzantine UAC and configuration tools and such.  After confirming that "that program" she referred to was Linux, I happily went about installing Ubuntu 9.04 on her computer.  (Yeah, I know, but Gentoo would have taken too long to install, and probably wouldn't have been an ideal distro to learn the basics with.)  Unlike my mom, she was interested in learning, watching me go through Jaunty's installer and asking questions about what I was doing.  She was impressed that Ubuntu installed so quickly, and was eager to get into using it when the install finished.

After she did the post-install setup and played around with Ubuntu for a while, I offered to customize her install to make the adjustment from Windows easier.  As much as I respect the free-as-in-speech aspect of Linux, I find it difficult to run an OS of the likes that the FSF would approve of.  I imagine that my wife's cousin, being a typically-connected teenager, would find it difficult as well given that she listens to mp3s, visits YouTube, watches DVDs, and the like.  Moreover, since I left Vista on her computer in case she wanted or needed to boot back into Vista, I thought I'd set it up so the NTFS partition was automounted, and then symlink her "Music" and "Video" folders to their respective locations on said NTFS drive so that she'd have access to her existing collections.  So, I fired up the terminal and went to work.  She was still interested in knowing what I was doing and why I was doing it, and surprisingly, she was fascinated with the command line and wished to learn how to use it.  She described it as something like "It's so cool, like you're talking to the computer!", which I suppose is pretty accurate.  So much for the old myth that new users don't want to use the command line, too.

After I finished installing the freedom-hating codecs and setting up /etc/fstab and installing a few miscellaneous programs (including Conky!), I set her free to explore her new OS.  She quickly took off, and by the time I looked at her screen again, she'd customized the theme from orange to green, set her own background, and done a few other things to make Ubuntu her own...none of which I'd showed her; she'd figured them out herself.  My wife's cousin hasn't come to visit since then, but I'm curious to see what she's gotten up to with Linux since then.  

I'd say that both my mom and my wife's cousin have comparable levels of computer knowledge, and they use their computers to do much the same thing.  The difference between them, though, is the desire to learn.  With such a willingness, my wife's cousin had no trouble adjusting to Ubuntu.  Granted, I installed it and set it up for her, but if I had been installing Vista out of the box on her machine, I'd have had to do similar setup as well.

So is every inexperienced user ready to switch to Linux?  No, but it's not because Linux is arcane and difficult to use, it's that the user has to be willing to try something new.
 

Getting Flash (Adobe) to stop crashing Firefox in Fedora 11

Before anyone hit's me over the head with "File a Bug Report" I'll save you the time you didn't take in checking to see if there was a bug and, there is. #505365 to be exact. The work around is known, it's a matter of waiting until Fedora decides on how to fix it.

Meantime, Firefox still crashes.  So what to do.  Well in dealing with the bug and in dealing with some stack traces I did, we came to the same idea.  There are a number of libs in Firefox, that are referenced by Firefox, the same names are referenced by flash.  The problem comes when Firefox runs it says "Do I have this lib if so use mine." and Flash says "Use the lib referenced by ldconfig"  OOOOOPS!

Yep, you now have conflicting libs, and the end result is a total panic by Firefox, resulting in a crash.  The solution?  Remove the conflicting libs from the Firefox directory (where Firefox expects them to be) and poof. All is well in surfing land.  If Firefox can't find the libs locally it happily uses the system libs without missing a beat.

The procedure is as follows. ($ is used to represent a command prompt)

$ cd /usr/lib/firefox

$ sudo mkdir lib-hold

$ mv  libfreebl3.chk libnss3.so libnssutil3.so libsmime3.so libssl3.so libfreebl3.so libnssckbi.so libplc4.so libsoftokn3.chk libnspr4.so libnssdbm3.so libplds4.so libsoftokn3.so lib-hold/

Now just install Flash as you normally would and viola, you now have a working flash installation that doesn't crash Firefox.

 

 

Walls

OK, so you have recommended a GNU/Linux flavour to someone who is interested, and you go and help her in installing her new system. Linux understands all the hardware, everything turns out to be a success (except for the to-be-spanked webcam), and here is a new desktop computer filled with free software. And than your fellow wants to watch some online video or listen to an MP3 stream - quite usual things to do. And the new system tells you, that it is intended to download some interesting things called "codecs" which are needed in order to watch a video or listen to an audio stream. And the new Linux-based desktop system tells the user that this may or may not be illegal in any particular country - Continue or Cancel? No more information is given.

And most users click Continue... And many users start to violate immediately their country's patent laws. Is this a crime?

If this is a crime - an illegal thing to do -, than the user is responsible for committing it. This must be a very small crime, but it is illegal. Some patent holders will not get their patent fees. And it is not about software patents - these are somewhat more complex technological patents, established for a long-long time. You can debate on it, but it is out there in the legal code, and is violated day by day. This is a small crime by an individual, and probably never ever will anybody punish an individual for this. But this has a bigger effect when you consider a larger scale of deployments. Ten million small individual crimes may add up to a large patent fee not paid, and that is a loss from the due payments of the economy. Audio and video codec developers... Many many company.

Most GNU/Linux distributions encourage this small crime - it is really easy, one click to commit it, and there is quite few information about it being committed. There are codec packs with paid patents for Linux systems, but the basic setup will not tell about it - instead, it shows just that small dialog. May be illegal. You can not know. We don't know either. Continue or Cancel?

There are large companies outside of Linux's scope, which do the same, and encourages a user to commit a crime for profit. For example, Microsoft sells their OEM software without the patent fees paid - such paying should be made by "the deployer" from entities like MPEG LA. But MPEG LA does not talk to end users, and the mentioned OEM software is available from the stores worldwide, so many end users are deployers at the same time. Those end users are forced to commit that small crime, using an illegal codec supplied by Microsoft. But this is not a problem regarding the individuals that use Linux on desktops. This is not a problem for Linux.

The problem for desktop Linux adoption is in networking. I mean networking with the companies that are the patent holders of such multimedia codecs. For example, the MPEG2 codec has patents from many companies worldwide. About 30 or 40. Large and small companies. Those companies may not have an inspiration to cooperate on driver development and supporting Linux in other ways as long as desktop Linux users tend to use their patented technologies illegally. And MPEG2 is just one codec of the many. Those companies may think: Linux users don't pay us what is due, so why should we support Linux? Instead, we should hide mandatory information and slow their adoption that way. Have you met such company walls already?

This, what I described, is a simple economical phenomena. Companies don't support entities which don't support companies.

We should find the ways to turn down the walls.

 
Page 7 of 10

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    04 Aug » 08 Aug - Virtual
    Details
  2. LFD312 Developing Applications For Linux
    18 Aug » 22 Aug - Virtual
    Details
  3. LFD331 Developing Linux Device Drivers
    25 Aug » 29 Aug - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board