Gentoo Logo
Gentoo Logo Side

Gentoo Linux - Tips'n Tricks

Contents:

1. Wish list

Try echo 'LDFLAGS="-Wl,-O1"' >> /etc/make.conf

Switch to NPTL thread library Native POSIX Thread Library (NPTL) is a thread library which is, unlike previous attempts, a very thin layer on top of the kernel. This helps to achieve a maximum of performance for a minimal price. It is intended as a replacement of the old linuxthreads library. The major benefit of NPTL over linuxthreads from a users perspective is that it's faster (refer to the PDF for benchmarks). For programmers it has the added benefit of being more posix compliant, as the name suggests.

2. Fonts

blas ln -s /usr/bin/gfortran-4.1.1 /usr/bin/g77 My guess is that it's looking for g77, yet that was dumped in GCC 4 and replaced by gfortran. gfortran should compile code made for g77 (Maybe a few warnings). It worked for me. If all else fails, emerge GCC 3.4.4 with the fortan USE flag. Don't use it as your compiler but it will provide g77 for you, and BLAS should compile fine.

3. Fonts

fc-cache -fv

4. adesklets

Make users see logs: Edit /etc/syslog-ng/syslog-ng.conf: #destination messages { file("/var/log/messages"); }; destination messages { file("/var/log/messages" owner("root") group("users") perm(0640)); }; Edit doityourself adesklet:

5. Mouse

1. downlad the cursor theme to a directory. Doesn't matter where. 2. extract everything to ~/.icons/NewTheme/ (for example and yes it's ~/.icons) 3. ln -s NewTheme default (default is the linkname, change the link if you want another theme) Restart your X server and enjoy.

6. udev rules

Upgrading to udev: edite

udevinfo -q path -n /dev/input/mouse1 /class/input/mouse1 udevinfo -a -p /sys/class/input/mouse1 SYSFS{manufacturer}=="B16_b_02" SYSFS{maxchild}=="0" SYSFS{product}=="USB-PS/2 Optical Mouse" SYSFS{serial}=="0000:03:00.0" BUS=="usb" more /etc/udev/rules.d/10-local.rules BUS="usb", SYSFS{serial}="0000:03:00.0", NAME="%k", SYMLINK="logitech-mx500" udevstart presto!

7. Emergency

mount -o remount,rw /

8. User settings - stuff I edited by hand to make life easy

.Xmodmap .xfce4/xinitrc BROWSER="firefox" sh /etc/xfce4/xinitrc

9. USB PCMCIA

PCMCIA USB 2.0 card caused my build in network card to randomly stop working. dhcpcd -d eth0 would give in /var/log/messages: dhcpcd[32095]: dhcpStart: ioctl SIOCSIFFLAGS: No such device

10. Network

Changing temporarily the MAC adress of a NIC ifconfig eth down ifconfig eth0 hw ether 4C:00:10:80:75:5A ifconfig eth up

I edited /etc/init.d/modules and replaced the modules-update part by a reminder to run this commmand after every kernel update. Since kernel updating involves a few carefull steps anyway, why not do it here once and boot faster?

Wake-On-Lan (WOL) Tools: wakeonlan (found this most usefull one) etherwake ethtools

Wake-on-Lan over Internet = Wake on Wan (WOW) Usefull internet tool http://www.depicus.com/wake-on-lan/woli.aspx From this site: If you wish to use Wake On Lan over the internet you will need to set up your destination firewall/router to allow "Subnet Directed Broadcasts". Most routers and firewalls disable this option by default. You will then need to allow traffic through on your firewall/router on a specific port. The choice of ports is up to you.

It also worked with wakeonlan script (just copy it to some remote host you use for testing). wakeonlan -i my_fixed_ip -p my_port my_mac_adress

Setup portmapping in firewal, map a non-standard but further arbitrary port number outside to inside network. For my Speedtouch 510 this reads:

Code listing 10.1

	  NAPT Settings  	
	  Type 	Inside address 		Outside address 	Prot 	State
	  Temp 	10.255.255.255:7 	unspecified:7 	udp 	NONE
	

or following line in user.ini, section [nat.ini] create protocol=udp inside_addr=10.255.255.255:7 outside_addr=0.0.0.0:7 foreign_addr=0.0.0.0:0

11. Hostname and domainname

12. Change to udev from devfs

changed /etc/fstab added users to cdrom group using usermod -G xxx,cdrom username where xxx are current groups found by groups username. This solve the problem that xine and other apps cannot open /dev/dvd for reading.

13. Xcdroast

After kernel 2.6.8 xcdroast using cdrecord didn't work anymore. I added the device in setup by hand: /dev/hdc since I'm using udev. Then it only works as root unless you fiddle around which I didn't do yet.

14. Virtual Private Networking using vpnc

Code listing 14.1: Kernel configuration

	  <M> Universal TUN/TAP device driver support
	  
	  # new entry in ifconfig
	  vpnlink   Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:134.130.243.105  P-t-P:134.130.243.105  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1412  Metric:1
          RX packets:1282 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1336 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:1252359 (1.1 Mb)  TX bytes:194253 (189.7 Kb)
	

15. Network time - ntp

Note that if you dual boot with Windows, then # you should set it to "local". CLOCK="local" # If you wish to pass any other arguments to hwclock during bootup, # you may do so here. CLOCK_OPTS="" # If you want to set the Hardware Clock to the current System Time # during shutdown, then say "yes" here. CLOCK_SYSTOHC="yes"

/etc/init.d/ntp-client to set your time at boot /etc/init.d/ntpd to maintain your time during operation Query if * before output of ntpq -pn is present, indicating update has taken place.

Check if time is not to crazy (up to few minutes) ntpdate pool.ntp.org Configuration file /etc/conf.d/ntpd.conf

Code listing 15.1

	  server 0.europe.pool.ntp.org
	  server 1.europe.pool.ntp.org
	  server 2.europe.pool.ntp.org
	

16. gcc compiler version updates

Once in a while a new gcc version appears and you have to pay attention... some tricks

gcc-config -l Show gcc versions available gcc-config 1 Select (latest) one Q: I have upgraded gcc and now emerge fails with messages such as Code: grep: /usr/lib/gcc-lib/i686-pc-linux-gnu/<old_version>/libstdc++.la: No such file or directory A: This typically happens because some packages have hard coded the path to libstdc++.la. Run env-update && source /etc/profile fix_libtool_files.sh <old_version>

CHOST (i686-pc-linux-gnu above) is incorrect as well. fix_libtool_files.sh <old_version> --oldarch <incorrect_CHOST>

17. Terminal

Set this in .Xresources:

Code listing 17.1

	  XTerm*faceName: Bitstream Vera Sans Mono
	  XTerm*faceSize: 10
	

or run it with xterm -fa "Bitstream Vera Sans Mono" -fs 12 -fg black -bg white -geometry 80x25 -rightbar

18. Alsa Sound

I had a little problem: the mixer settings (Master and PCM) are being reset on boot, so I have to unmute one or the other every time I reboot. To fix this, first setup the volumes the way you want them. alsactl store and then rc-update add alsasound boot The volume settings are then restored on boot. and by editing /etc/conf.d/alsasound

19. Basic System Software

Download stuff recursively: wget -r --retr-symlinks ftp://remotedir

Display setting with ssh "Xlib: connection to "engr01ras.eos.ncsu.edu:10.0" refused by server Xlib: Client is not authorized to connect to server" This only happens when X11 forwarding is not being used. When someone is using X11 forwarding, information is passed to the remote access server from the SSH client and the $DISPLAY variable is set to a non-existent display on the remote access server. The remote access server then automatically acts as a proxy and sends the X11 applications GUI through the encrypted SSH tunnel. The cause of the actual error is that the $DISPLAY variable is set to a display greater than 10 on the remote access server, but X11 forwarding is not enabled. As a result, the application actually tries to display on the server instead of being proxied. Since the remote access servers don't run X (and you wouldn't be allowed to display on them even if they did), the connection is refused.

X11 Forwarding in sshd_config on but I get error when ssh -X ing: ssh -Y (trusted X forwarding) solves it.

20. Prelink

When my system was running fine for coupleof weeks I wanted to feel the thrill of prelink : ) I just followed the Gentoo prelink HOWTO and all went as advertised. Nice feature is the undo option of prelink. Noticable startup speed-up with KDE apps, not to sure about the rest. Anyway, I now use xfce4 which is way faster than kde. I didn't figure out yet how to prelink only a subset of programs (e.g. only kde). I used prelink -afmR

21. XFCE4

Added %users myhostname=NOPASSWD:/usr/libexec/xfsm-shutdown-helper to /etc/sudoers using visudo command to enable shutdown form xfce4 as user. Carefull with sudo. Putting localhost instead of myhostname doesn't work? Putting a single myuser doesn't work?

22. TeXmacs

TeXmacs [wyswyg structured scientific editor] compiled without a hitch... To keep up with the rapid (but stable) development I added this to my /etc/portage/package.keywords file, to use the unstable=latest version. At some point I could not compile TeXmacs anymore when guile got update to guile-1.6.4-r1. I got message ERROR: Unbound variable: include-deprecated-features Downgraded to 1.6.4 and all was fine again. No, this was not fine... When I export GUILE_LOAD_PATH=/usr/share/guile/1.4.1 and then run texmacs, it seems ok. Is guile-gtk problem? http://bugs.gentoo.org/show_bug.cgi?id=14266 First edit your /etc/make.conf and uncomment the following line: Code: PORTDIR_OVERLAY=/usr/local/portage Then you have to create folders with the same hierachy than the portage tree: Code: # mkdir -p /usr/local/portage/x11-libs/guile-gtk/ Copy the ebuild into this new folder, go there and create a new digest: Code: # cp guile-gtk-0.19-r2.ebuild /usr/local/portage/x11-libs/guile-gtk/ # cd /usr/local/portage/x11-libs/guile-gtk/ # ebuild guile-gtk-0.19-r2.ebuild digest Now you can check whether portage acknowledges the new ebuild (etcat can be found in the gentoolkit package, this step isn't mandatory): Code: # etcat -v guile-gtk [ Results for search key : guile-gtk ] [ Candidate applications found : 4 ] Only printing found installed programs. * x11-libs/guile-gtk : [ ] 0.19 (0) [ ] 0.19-r1 (0) [ ] 0.19-r2 (0) OVERLAY [M~ ] 1.2.0.31 (0) Now the fixed ebuild should be the one used by default: Code: # emerge -vp guile-gtk These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] x11-libs/guile-gtk-0.19-r2 0 kB [1] Total size of downloads: 0 kB Portage overlays: [1] /usr/local/portage But I get Calculating dependencies ...done! >>> emerge (1 of 1) x11-libs/guile-gtk-0.19-r2 to / >>> md5 src_uri ;-) guile-gtk-0.19.tar.gz >>> Unpacking source... >>> Unpacking guile-gtk-0.19.tar.gz to /var/tmp/portage/guile-gtk-0.19-r2/work >>> Source unpacked. /usr/sbin/ebuild.sh: line 17: /usr/local/portage/x11-libs/guile-gtk/files/guile-gtk-0.19-Makefile.in.patch: No such file or directory !!! ERROR: x11-libs/guile-gtk-0.19-r2 failed. !!! Function src_compile, Line 17, Exitcode 1 !!! patch failed

23. Portage package manager i.e. "emerge"

Interrupt emerging of package: Ctrl+Z in terminal of process Resume it in foreground, possibly with some new commands appended (!) fg && someotherprocess

If the operating system on which bash is running supports job control, bash contains facilities to use it. Typing the suspend character (typ- ically ^Z, Control-Z) while a process is running causes that process to be stopped and returns control to bash. Typing the delayed suspend character (typically ^Y, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to be returned to bash. The user may then manipulate the state of this job, using the bg command to continue it in the background, the fg command to continue it in the foreground, or the kill command to kill it. A ^Z takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded.

Monitor emerging of package It depends on your version of portage, but there is log files in /var/log/portag e and another log file with less information at /var/log/emerge.log If your still in the bootstrap, running 'ps aux|grep [e]merge' will tell you wha t it is emerging at that time, and by looking at the emerge itself you can usual ly deduce what the current program is. 'genlop -c' is supposed to tell you info about whats currently compiling, but it never works with me for some reason I hope one of these things help

emerge --resume --skipfirst Resume failed emerge, skipping first package if some unresolvable problem with it occurs and there is no dependency problem.

Portage got really slow around 50% of updating package... python-rebuild Didn't hang at 51 for long time but still way to slow overall. moving /usr/portage to other partition and moving back no effect, 50 % hang was back??? rm -rf /usr/portage/* rm -rf /var/cache/edb/* The first updating cache again hung long at 50-51%... dep script (carefull!) may indicate redundant entries in world file. http://forums.gentoo.org/viewtopic.php?t=142475&highlight=prune

After switching to new gcc version some compiles failed with: libtool: link: `/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la' is not a valid libtool archive Using from libtool package: fix_libtool_files 3.3.4 where 3.3.4 is your old gcc version gcc-config -l

Find out which package is requiring some other package to be update/installed emerge -tuDav world

with -N = --newuse packages recompiled which have old USE variable settings emerge -tuDavN world

emerge -tuDavN world emerge -a --depclean revdep-rebuild

If you want scientific packages USE=f77 will build with gcc the g77 fortran compiler.

Code listing 23.1

	  Ditching Gnome and KDE packages completely.
	  vim /var/cache/edb/world	# Remove packages you don't want
	  emerge depclean -p		# Check clean
	  emerge depclean	        # Do clean
	  rm -f ~/.revdep*		# Fresh dependency check
	  revdep-rebuild -p		# Check
	  revdep-rebuild		# Do
	

First edit your world file to remove any packages that you don't want anymore, then emerge depclean -p to see what would be removed... IMPORTANT: make sure to check this for sanity!! I have read posts where depclean removed some INSANE packages that wound up hosing systems. If you are having problems, check out the regenworld command, it rebuilds your world file from the portage log which records all packages emerged, unmerged, injected, etc. If it appears to be mostly harmless packages, then go ahead and do emerge depclean to remove the packages listed in the previous step the rm -f ~/.revdep* cleans up any old revdep-rebuild files to make sure results are accurate, and the revdep-rebuild commands are there to fix anything depclean breaks.

Cache intermediate compile results for 5-10 x speedup I only need this really for openoffice (and gnome or kde which I ditched).

Use equery instead. What packages (i.e. all not just world file) installed? qpkg -I -v -nc | sort

Installing Gentoo remotely (surprise your colleagues : ) Install via ssh and regain control after logging off. Use screen. screen -R (starts a new screen session) screen -ls (lists current running sessions) screen -r PID # PID number listed in screen -ls Don't type exit in you screen session out of habit.... -R attempts to resume the first detached screen session it finds. If successful, all other command-line options are ignored. If no detached session exists, starts a new session using the specified options, just as if -R had not been specified. The option is set by default if screen is run as a login-shell (actually screen uses "-xRR" in that case). For combinations with the -d/-D option see there. -ls and -list does not start screen, but prints a list of pid.tty.host strings identifying your screen sessions. Sessions marked `detached' can be resumed with "screen -r". Those marked `attached' are running and have a controlling terminal. If the session runs in multiuser mode, it is marked `multi'. Sessions marked as `unreachable' either live on a different host or are `dead'. An unreachable session is considered dead, when its name matches either the name of the local host, or the specified parameter, if any. See the -r flag for a description how to construct matches. Sessions marked as `dead' should be thoroughly checked and removed. Ask your sys- tem administrator if you are not sure. Remove sessions with the -wipe option.

It depends on your version of portage, but there is log files in /var/log/portage and another log file with less information at /var/log/emerge.log If your still in the bootstrap, running 'ps aux|grep [e]merge' will tell you what it is emerging at that time, and by looking at the emerge itself you can usually deduce what the current program is. 'genlop -c' is supposed to tell you info about whats currently compiling, but it never works with me for some reason I hope one of these things help

Find out what packages depend on package_X (e.g. you want to delete X): qpkg -q package_X

Keeping things slim on disk: rm -rf /usr/portage/distfiles # where stuff is downloaded rm -rf /var/tmp/portage # where stuff is compiled...so don't rm during an emerge.. This is now superseded by eclean script in gentools package.

It looks like portage is still using the -r1 version of the ebuild (cf error message). To deal with files that aren't by default in portage, you really should use the portage overlay. First edit your /etc/make.conf and uncomment the following line: PORTDIR_OVERLAY=/usr/local/portage Then you have to create folders with the same hierachy than the portage tree: Code: mkdir -p /usr/local/portage/x11-libs/guile-gtk/ Copy the ebuild into this new folder, go there and create a new digest: # cp guile-gtk-0.19-r2.ebuild /usr/local/portage/x11-libs/guile-gtk/ # cd /usr/local/portage/x11-libs/guile-gtk/ # ebuild guile-gtk-0.19-r2.ebuild digest Check whether portage finds new ebuild (etcat in gentoolkit package) # etcat -v guile-gtk [ Results for search key : guile-gtk ] [ Candidate applications found : 4 ] Only printing found installed programs. * x11-libs/guile-gtk : [ ] 0.19 (0) [ ] 0.19-r1 (0) [ ] 0.19-r2 (0) OVERLAY [M~ ] 1.2.0.31 (0) Now the fixed ebuild should be the one used by default: emerge -vp guile-gtk

emerge -ept world Shows dependencies

24. Gnome 2.6 and Openbox

I just emerged Gnome 2.6.1_rc1, and so far everything is great, except for the fact that I can't use any of the applets whatsoever. No clock, no desktop pager, no notification area, nothing. When I start up Gnome, I get constant error messags like this one: Code: The panel encountered a problem while loading "OAFIID: GNOME_NotificationAreaApplet". Details: Unknown COBRA exception id: 'IDL:omg.org/COBRA/INV_OBJREF:1.0' Do you want to delete the applet from your configuration? The error messages are all the same; only the name of the applet changes. I've tried re-emerging gnome-applets and I'm currently in the middle of running revdep-rebuild which may or may not fix it. Fixed. Log out su cd /tmp rm -r * startx Everything works 100% including my nautilus side-pane view, which I also found to be crashing everytime I tried to use it. None of my panel settings were changed either. All my little applets are now whirring away!

How to remove and edit default actions in Gnome 2.6.x Abstract This small howto explains how to edit and remove default actions set in the "File types and programs" dialog. Table of Contents Motivation Because someone seems to have forgotten an option to edit and remove actions in the "File types and programs" dialog, you will have a quite long list of items in it after just a few typos ;-) The "File types and programs" dialog Edit/Remove actions you've assigned Every application that is assigned by the user through this dialog gets an entry in ~/.gnome/application-info/user.applications. Here a small example for assignments of gvim: gvim mime_types=text/x-java mime_types=text/x-java If you don't want gvim to be assigned to text/x-java files anymore, simply remove these mime-type entries from the "gvim-section" or (as gvim is only assigned to text/x-java files here) remove the whole gvim section. Edit/Remove actions assigned by default I'm not sure about these things here, but they seem to work. This part is a little bit more tricky not that much ;-) First you have to find your gnome-vfs mime database. I found it on my system in /usr/share/mime-info/. There should be a gnome-vfs.keys in it. In this file you should find descriptions in various languages and the application and component assignents for every mime-type you see by default in your "File types and programs" dialog. I will use video/mpeg (without all those translations) as an example here: video/mpeg description=MPEG video default_action_type=application short_list_application_ids_for_novice_user_level=vlc,xmps,plaympeg,omsomi,mpeg_play,gtv short_list_application_ids_for_intermediate_user_level=vlc,xmps,plaympeg,omsomi,mpeg_play,gtv short_list_application_ids_for_advanced_user_level=vlc,xmps,plaympeg,omsomi,mpeg_play,gtv category=Video default_action_type ... is set to "application" which means that gnome will first try to use an application listed in the "application list" for handling this mime-type. short_list_application_ids_for_* Here you get a listing of applications assigned to this mime-type. I'm currently not sure, if this listing is complete or not. If you have some more information about this, please contact me.

Gnome 2.6 running smooth now, really nice. EDIT Only one point: when starting gnome for first time, it complaints something is wrong with my /etc/hosts. Problem was that I didn't have my machine name in there: changing 127.0.0.1 localhost to 127.0.0.1 localhost machine_name fixed this. My mousebutton config script (see X-window section) I just added to startup programs via the configuration panel. rc-scripts: gdm failed to stop This harmless. Shutting down from gdm, gmd shuts itselfdown before the rc-script for shutdown starts. The latter want to shutdown gdm also and fails cuz it ain't there anymore. Switched to openbox as default window manager (WM). Just for ya noobs out there: WM = Metacity, kwin, openbox DM = KDE, Gnome You can also set the system wide default window manager for Gnome with the GConf editor or via the command line: -t = type of the value -s = set a value -g = get value gconftool-2 -t string -s "/desktop/gnome/applications/window_manager/default" "/usr/bin/openbox" Check it gconftool-2 -g "/desktop/gnome/applications/window_manager/default" with result /usr/bin/openbox.

25. Xorg

xrandr prints out possible modes you can switch to: xrandr --size 1400x1050 usefull for wrestling with beamers.

DisplaySize 406 325 to the \u201cMonitor\u201d section. To calculate what numbers to use take the resolution of your monitor, multiply by 25.4, then divide by the desired DPI. In my case, I run at 1600x1280 and want 100dpi, so 1600 x 25.4 / 100 = 406.

Widescreen LCD TV Sharp Aquos LC-26GA3E 26" LCD TV Resolutions supported: VGA: 640x400 720x400 640x480 WVGA: 848x480 SVGA: 800x600 XVGA: 1024x768 XWGA: 1280x720 1280x768 1366x768 SXGA: 1280x1024 Hsync: 31.5-68.7 kHz Vsync: 60-85Hz This forced me at last read man xorg.conf and to figure out how to write the following ModeLine Modeline "1280x800@60" 83.91 1280 1312 1624 1656 800 816 824 841

ModeLine "name" mode-description This entry is a more compact version of the Mode entry, and it also can be used to specify video modes for the monitor. is a single line format for specifying video modes. In most cases this isn't necessary because the built-in set of VESA standard modes will be sufficient. The mode-description is in four sections, the first three of which are mandatory. The first is the dot (pixel) clock. This is a single number specifying the pixel clock rate for the mode in MHz. The second section is a list of four numbers specifying the horizontal timings. These numbers are the hdisp, hsync- start, hsyncend, and htotal values. The third section is a list of four numbers specifying the vertical timings. These numbers are the vdisp, vsyncstart, vsyncend, and vtotal values. The final section is a list of flags specifying other characteris- tics of the mode. Interlace indicates that the mode is inter- laced. DoubleScan indicates a mode where each scanline is dou- bled. +HSync and -HSync can be used to select the polarity of the HSync signal. +VSync and -VSync can be used to select the polarity of the VSync signal. Composite can be used to specify composite sync on hardware where this is supported. Addition- ally, on some hardware, +CSync and -CSync may be used to select the composite sync polarity. The HSkew and VScan options men- tioned above in the Modes entry description can also be used here.

Tool: Generalized Timing Formula gtf - calculate VESA GTF mode lines # 1280x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 80.14 MHz Modeline "1280x768_60.00" 80.14 1280 1344 1480 1680 768 769 772 795 -HSync +Vsync

26. XDM Login - not so crappy

emerge xmessage xloadimage Followed guide Gentoo Wiki - XDM

27. Taking screenshots

From ImageMagick package: import file.format Then click on window and snapshot is taken!

28. OpenOffice

Running ooffice2 -minimized once caused subsequent invocation of office2 to start much faster without opening any default document. Strange: office2 -nologo doesn't do this? Confusing: ooffice2 -h says that -minimized keep startup bitmap minimized. -invisible no startup screen, no default document and no UI. -nodefault don't start with an empty document -nologo don't show startup screen.

OpenOffice compiles without a hitch with my above CFLAGS settings. Runs faster than ever. I tried Ximian version also, but didn't notice too much difference so dumped it again.

It is seems that the app-office/openoffice-bin ebuild leaves some unstripped binaries as part of the installation. By stripping the binaries of symbols we can reduce the size of these components, thus reducing memory consumption and boosting the speed of OpenOffice a little. Simply enter the following two lines: # cd /opt/OpenOffice.org1.0.2/program # for bin in `file * | grep "not stripped" | egrep -o "^.+\.so[^: ]*"`; do strip ${bin}; done OpenOffice features a nifty "quickstart" feature whereby the code can be pre-loaded into memory. By making use of this feature we can significantly reduce the startup time for any OpenOffice application. Furthermore, that damned dialog box (you know, the one that you can't move and dominates your screen for about 15 seconds) is nowhere to be seen It is simply a matter of invoking ooffice with two particular parameters (-plugin -quickstart). The only problem is that, while it works, the pre-loaded component itself has tendency to unload itself after a relatively short period of time, negating its usefulness somewhat. To get around this, use this simple but effective script (adapted from a script by Sandeep Khanna on the GNOME User's Board):

Code listing 28.1

	  #!/usr/bin/bash
	  i=0
	  while [ $i -eq 0 ]
	  do
	  {
	  dummy=`ooffice -plugin -quickstart ;`
	  i=$?
	  echo "OpenOffice was unloaded. Loading it again..."
	  }
	  done
	

I saved this as /usr/bin/ooqstart.sh then issued: Code:Now, as I am a Gnome user I selected Applications -> Desktop Preferences -> Advanced -> Sessions. I then clicked the Startup Programs tab, clicked the Add button and typed in ooqstart.sh. Now whenever I start Gnome, this script is loaded into memory. The script ensures that whenever the pre-loaded ooffice unloads, it will be immediately loaded again. Now give OpenOffice a spin and be happy! If you want a faster startup time for openoffice, make a link in your kde autostart folder to : /the/directory/of/openoffice/program/swriter -quickstart

Setting the default fonts in OpenOffice NOTE: Doesn't work for Formula Editor fonts! Format Menu --> Styles --> Catalog... In dialog box, select Default, then click Modify. Next, File --> Templates --> Save... In dialog box, select Default in Categories, set template name in New Template field (I'll call mine "default", just to be different), and OK to save. Next, File --> Templates --> Organize... In dialog, double click on Default folder, select new "default" template thereunder, then right click on selected item. From context menu, select "Set As Default Template"

29. Wine

Added user,exec to cdrom in /etc/fstab to run as user setup from cd. (user only turns of exec) wine /pathtocdrom/setup.exe wine --dll hlink=n "c:\Program Files\Microsoft Office\Office\POWERPNT.exe" wine: could not load "Z:\\mnt\\cdrom\\SETUP.EXE" as Win32 binary fstab contained /mnt/cdrom

30. Kernel Backery

CC_OPTIMIZE_FOR_SIZE = only for embedded devices force -Os optimization which I don't want. DEFAULT_DEADLINE

Old kernels: emerge -P gentoo-sources Deletes old kernel trees Modules in /lib/modules/ with older kernel numbers can be ditched too.

USB adressing changed starting from 2.6.10 load usb as module http://www.spinics.net/lists/usb/msg02644.html Thanks for the tipp: I've compiled the USBcore as a module now. Before it was compiled into the kernel. In the file /etc/modprobe.conf I've added the line: options usbcore old_scheme_first=y . It seems to work now :-) Can you please explain in a few sentences the difference between the "new" and the "old" USB scheme? I'll try... The "old scheme" is the way Linux worked before 2.6.10. When a new device is plugged in, the system first assigns it an address, then reads the initial 8 bytes of the device descriptor, then reads the entire 18-byte device descriptor. The "new scheme" is basically the way Windows works. (Not surprisingly, some devices won't work any other way.) When a new device is plugged in, the system first issues a 64-byte read request for the device descriptor, then resets the device, then assigns it an address, and then reads the actual 18-byte device descriptor. The reason for these shenanigans is that with a full-speed device, the maximum packet size for endpoint 0 (ep0maxpacket) isn't known beforehand. It could be 8, 16, 32, or 64 bytes. (Low-speed devices must use 8, and high-speed devices must use 64.) The ep0maxpacket value is stored in the initial 8 bytes of the device descriptor, but to read the device descriptor you have to use endpoint 0! The two schemes above are the two common solutions to this chicken-and-egg problem. The old scheme is the one recommended by the USB Implementors Forum (which makes it the "Standard"); the new scheme is the one used by Microsoft (which makes it another kind of "Standard"!). A well-designed standards-compliant device will work okay with either scheme. Unfortunately it seems that no matter which scheme you pick, some badly-designed non-compliant devices won't work. There's an additional usbcore.ko module parameter people can use in especially bad cases: use_both_schemes=y This will cause the system to try one of the schemes, and if it fails then try the other scheme. (Maybe that should always be the default...)

Taking over old kernel config when you get new kernel sources. Copy the old .config from the old kernel tree into the new one, go into the new one and do a "make oldconfig". It will prompt you to select how you want to handle new options in the kernel and will leave your config correctly set for the new version. Then just proceed as you normally would (make dep menuconfig bzImage modules modules_install, etc)

31. Microphone setup

# Let mic do capture amixer -c 0 sset Mic,0 100%,100% unmute cap # Let capture work amixer -c 0 sset Capture,0 100%,100% unmute cap Test: record -i mic -l -o test.wav without recording, look at volumen levels to see if works. arecord -f dat -d 5 -D hw:0,0 test.wav && aplay test.wav rec -r 44000 -v 50 lala.wav record in package

32. Video chat

Gnomemeeting Is really cool. Default settings are silly: Codecs > Audio Codecs Enable silence detection Codecs > Video Codecs Enable video transmission Enable video reception Maximum video bandwidth 100kB/s Minimum video quality 20% Transmit at leas 30 fps Emerged 1.2.2. Possibly change optimization from -O3 to -O2? Note that -O2 is regarded as safer than "-O3", and "-O3" can often be a counter-productive attempt at optimization.

GnomeMeeting 1.2 supports STUN which helps greatly with most NAT gateways. In most cases, going through NAT will require no upgrade or configuration of the NAT gateway. There are however a few cases where it is required to forward a few ports used by GnomeMeeting to your internal machine. That is due to limitations of some NAT stacks (like the Linux one) to handle modern VoIP protocols like H.323 and/or SIP and more particularly RTP. Notice that if you are behind NAT and want to be able to receive calls, you will always need to forward the TCP port 1720 to your internal machine, whatever your type of NAT is. Similarly, if you want to call Netmeeting or other clients that do not support H.245 Tunneling, you will always need to forward the TCP H.245 port range to your internal computer (see below). Forwarding the other port ranges described below is sometimes required, sometimes not, it depends on your type of NAT. NAT can be categorized in several types. To know what type of NAT you are using, go in the configuration assistant and run the NAT test. You will have to forward some ports or not following the NAT type detected by the test. There are several possibilities : "Cone NAT". If it reports "Cone NAT", then enable STUN support and your are ready to make and receive calls. * Cone NAT, Restricted NAT, Port Restricted NAT: No configuration is required, you just need to enable STUN support and you are ready to make calls. If you want to be able to receive calls, you need to forward the TCP Listening Port. The H.245 TCP Port Range is only required to make calls to old clients like Netmeeting. Other port ranges are not required.

Direct connection on LAN:

33. Speech Recognition

Most details I found on topics [SOUND] speechd lets your Computer speak and Microphone Setup and Voice Command Setup

Voice command I installed the packages cvoicecontrol (don't need gnome-panel, gnome2.6 has panel inside) and configged as described in links above. I have to shout at the laptop (not uncommon though ;) ...)

Dictation Not yet found...

34. Headset and Microphone setup

Just out of curiousity.... so I bought a Logitech headset which (great for UT2004 with ongame chat also..). It has noise-reduction microphone and a wide frequency range 20Hz-20KHz (headphone) 100-16KHz (microphone) and a microphone on-off switch, just in case you start formating your harddrives using speechrognition... :) It all works without to much hassle!

35. Skype Voice Over IP (VoIP)

Finally put my headset to some real use... Using masked skype version: since I trashed all kde stuff I don't have artsd sound serer so on startup skype complains: No running artsd or esd found Instead I use enlightenment sound server: after starting as root /etc/init.d/esound start with this running skype works out of the box. I noticed that it doesn't close properly, it keeps running so I added killall skype skype.bin to my invocation of skype so it is really gone after exiting.

36. Speech generation

Nice german speech generation: http://de.gentoo-wiki.com/HOWTO_Gentoo_deutsch_sprechen_lassen_mit_mbrola

speechd-el and speechd packages make emacs speak without difficulty. Very cool.

I ran into a compile problem with an error that said "cannot find -ltermcap". This was fixed by emerging the package "libtermcap-comat". Once that was done, Festival compiled just fine. Compatibility package for old termcap-based programs

Speech generation (Text-To-Speech, TTS) I installed the packages festival, mbrola

Dutch speech generation There is package for download form which you can extract the festival stuff for Dutch speech generation. http://nextens.uvt.nl/index.html Not working yet.

Improved voices - installing manually Requires sox. To install: After installing festival, download and unzip one of the festival engines. http://hts.ics.nitech.ac.jp/download.html It's going to create a directory structure that's different than the one currently used by festival, so you have to copy it out to the right spot. At the time of this writing, english Festival voices are stored in: /usr/lib/festival/voices/english by default. Untar and copy the code in lib/voices/us there: I prefer the "slt" voice. Code: tar xzvf cmu_us_slt_arctic_hts.tar.gz cp -r lib/voices/us/* /usr/lib/festival/voices/english Making this the default voice: Unfortunately there's something wrong with these engines, and I didn't want to read all the way through all of Festival to figure it out. Suffice to say it's something in the initialization. You'll have to start with some other voice before loading any of these. For that reason, make this your /usr/lib/festival/siteinit.scm (with suitable modification based on whichever voice you downloaded) file: Code: (voice_kal_diphone) (set! voice_default 'voice_cmu_us_slt_arctic_hts) Troubleshooting 1) You have to have perl on your system, because the interface between Festival and this voice is written in perl. Make sure you have perl installed. 2) The actual engine, which is stored at /usr/lib/festival/voices/english/[whatever you installed]/hts_engine is an ELF x86 binary. If you don't have that, you'll have to recompile and copy it in there. It's available in the download section from the website I mentioned.

37. Mobile phone - Sony Ericsson W880i

Plugged in the USB cable, and on the phone enabled file-transfer mode. dmesg showed... fdisk /dev/sdb fdisk /dev/sdb Command (m for help): p Disk /dev/sdb: 995 MB, 995958272 bytes 64 heads, 32 sectors/track, 949 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 1 950 972615+ 6 FAT16 mounted using

38. Printing

Installed cups and and started it with /etc/init.d/cupsd start and added it to default runlevel with rc-update add cupsd default. Network printers popped up in KDE printer utility. Easy. Later I took cups out of default runlevel keep the booting fast. I just (re)start cups @ first print job by hand using /etc/init.d/cupsd restart.

Note: I would like to have a script which starts cups the on-demand at first print job?

lpr -Plp0 -o page-ranges=1-4 -o page-top=10 -o number-up=4 filename.ps page-ranges is the pages you want page-top is the margin in points from the top of the page. Experiment with this, because it will be added to the page formatting already set. number-up is the number of pages you want on each side of the sheet.

xpdf: entering in the print box psnup -2 | lpr -Pprintername prints 2 on 1

HP LaserJet 2420 DN Other printer drivers had problems with duplex printing. Installed hpijs printer drivers (package net-print/hpijs), then restarted cups, selected hpijs driver for this model printer. NOTE: the hplip package succeeds hpijs but does 1000 thinks I don't need and draws in many dependent packages. Therefore I don't use it. Furthermore, it requires extra configuration to get it to work (didn't work yet for me). Gentoo Forums - HPLIP and CUPS Howto hpijs driver more /etc/cups/printers.conf

Code listing 38.1

	  # Printer configuration file for CUPS v1.1.23
	  # Written by cupsd on Thu Nov 16 21:45:39 2006
	  <DefaultPrinter lphome>
	    Info 
	    Location 
	    DeviceURI ipp://lphome/631/ipp
	    State Idle
	    Accepting Yes
	    JobSheets none none
	    QuotaPeriod 0
	    PageLimit 0
	    KLimit 0
	  </Printer>
	

Make sure cupsd is running /etc/initd/cupsd restart and that printer of choice has been started http://ntbtad02:631

To get any ps file to print 2- (or 4-) on 1 side I wrote some scripts. These convert the ps file and open it in ghostview (gv): gv2 gv4 For PDF I use packages pdfjam and pdftk = pdftoolkit which allow rotation and printing n-sides on 1 page using LaTeX. pdfnup --nup 2x1 source.pdf , pdfjoin and pdf90 Alternatively, I used some old scripts to get any pdf file to print 2- (or 4-) on 1 side I wrote some scripts: gv2pdf gv4pdf These convert file to ps if necessary, then run psnup (required) and open gv for you. WARNING: scanned files in pdf format give tremendous (say 200 MB..:)) files. This however works for any file.

I tried my luck with CUPS printing 2- (or 4-) on 1 side but at least our printer gives out stack errors etc. so I stick with my scripts. CUPS is much much faster than my stupid solution.

Printing to duplex printer for which no options are set. Just make a "printer instance" = set of options for a printer next to the defaults lpoptions -p ps5d/d -o media=A4 -o sides=two-sided-long-edge Now ps5d/d can be used with lpr -P command!

Printing to a CUPS server on the network: uncomment in /etc/cups/cups.conf ServerName xxx.yyy.zz NOTE: putting this in /etc/cups/client.conf I got the following error when trying to locate the network printer (with integrated server) on my local network. Why?

Code listing 38.2

	  # lpq -Plphome
	  lpq: Unable to contact server!
	  # From cat /etc/printcap: xxx = server at my work network to
	  # get my local network printer to be found
	  lphome|lphome:rm=xxx:rp=lphome:
	

The clue I found by comparing /etc/printcap

39. Emacs

Eleven Megabytes Continually Swapping... .emacs

Using calender: set it up as explained in emacs manual. Put a link emacs -f calendar to fire up my calendar. Add appointments (not related to diary) M-x appt-add

Search replace multiple files: TAGS search Use etags to make a list of TAGS and search these.

emacs --eval="(calendar)" startup emacs with calendar

`emacsclient', which comes with Emacs, is for editing a file using an already running Emacs rather than starting up a new Emacs. It does this by sending a request to the already running Emacs, which must be expecting the request. * Setup: Emacs must have executed the `server-start' function for `emacsclient' to work. This can be done either by a command line option: emacs -f server-start or by invoking `server-start' from `.emacs': (if (SOME CONDITIONS ARE MET) (server-start)) When this is done, Emacs starts a subprocess running a program called `emacsserver'. `emacsserver' creates a Unix domain socket. The socket is either named `.emacs_server', in the user's home directory, or `esrv-USERID-SYSTEMNAME', in the `/tmp' directory, depending on how `emacsserver' was compiled. To get your news reader, mail reader, etc., to invoke `emacsclient', try setting the environment variable `EDITOR' (or sometimes `VISUAL') to the value `emacsclient'. You may have to specify the full pathname of the `emacsclient' program instead. Examples: # csh commands: setenv EDITOR emacsclient # using full pathname setenv EDITOR /usr/local/emacs/etc/emacsclient # sh command: EDITOR=emacsclient ; export EDITOR When emacsclient is run, it connects to the ".emacs_server" socket and passes its command line options to "server". When "server" receives these requests, it sends this information on the the Emacs process, which at the next opportunity will visit the files specified. (Line numbers can be specified just like with Emacs.) The user will have to switch to the Emacs window by hand. When the user is done editing a file, the user can type "C-x #" (or M-x server-edit) to indicate this. If there is another buffer requested by emacsclient, Emacs will switch to it; otherwise emacsclient will exit, signaling the calling program to continue.

USE="Xaw3d -motif" emerge emacs

Select other window: C-x-o

Mouse wheel scrolling needs to be activated (not on by default here): (mouse-wheel-mode) in your .emacs file.

In order to get auctex running with GNU emacs: USE="Xaw3d -motif" emerge emacs

40. Maple

Maple 10 I had the problem described here. Solution works, note that you HAVE to use sed to edit the file, doing it by hand you get complaints that the vm.tar.Z files is corrupt. I had just the iso downloaded, no need to burn a cd though: modprobe loop (need module compiled in kernel .config) then mount the iso mount -o loop -t iso9660 maple10_su_windows_linux_mac.iso ./tmp copy it and cat LinuxInstaller.bin.bak | sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" > LinuxInstaller.bin to fix it. Then graphical installation goes fine.

Maple 8 [solved] PROBLEM ./installMapleLinuxSU gives bash: ./installMapleLinuxSU: /bin/sh: bad interpreter: Permission denied SOLUTION: I copied the contents of the CD to my hard drive to avoid this. PROBLEM running ./installMapleLinuxSU I get dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory rm: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory SOLUTION (this is a known problem with e.g. SuSE Linux) Copy entire CD to disk and comment out in line 1331 of the LinuxInstaller.bin file #export LD_ASSUME_KERNEL

Maple 8 and Acroread [partially-solved] Configuration file ~/.Xdefaults PROBLEM The mousewheel doesn't work in Maple (versions 7 and 8 I know of) and Acroread. SOLUTION: This will allow mousewheel-scrolling when you hover over the right scroll bar. It doesn't work with the horizontal scrollbar or without hovering over a scroll bar unfortunately. Add a line to your ~/.Xdefaults (or ~/.Xresources):

41. System Management Stuff I stumbled upon

  • /etc/conf.d/rc RC_TTY_NUMBER=11 # Set to "yes" if you want the rc system to try and start services # in parallel for slight speed improvement. Set to "yes" if you want to save /dev to a tarball on shutdown # and restore it on startup. This is useful if you have a lot of # custom device nodes that udev do not handle/know about. # (ONLY used by UDEV enabled systems!) RC_DEVICE_TARBALL="yes"
  • shell stuff goes into .bash_profile. Make this one be executed every logon by putting it.... I put my PATH="${HOME}/bin:${PATH}" into .bashrc. Not sure yet what is better way.
  • # coreutils replace following packages, hence (innocent) complaints of emerge: *** Package in world file is not installed: sys-apps/sh-utils *** Package in world file is not installed: sys-apps/fileutils *** Package in world file is not installed: sys-apps/textutils

42. Mozilla Thunderbird - Email

Menu appearance (e.g fontsize): same as firefox

43. Mozilla Firefox - Browser

Menu appearance (e.g fontsize) In user setting directory, edit (starting from the example there) chrome/userChrome.css

Mozilla Firefox Some tweaks I found. Enter about:config in firefox adressbar: network.http.pipelining true network.http.proxy.pipelining true (if you use a proxy) network.http.pipelining.maxrequests 8 nglayout.initialpaint.delay 100

Launchy plugin = open-with-application launchy.xml file usage Launchy is now (from version 2.5.0 and up) able to use a XML file to add custom applications. So you can add your own applications to Launchy's context menu. At startup Launchy will look for a file called launchy.xml in the chrome directory in your profile. Get help in finding the path of your Mozilla profile. You can use this page to create a launchy.xml file. The content of the launchy.xml should look like this: label: The name of the application required command: The full path to the executable for the application required arguments: The arguments for the application optional type: The type of application required. The following types are supported: 1. Browsers (e.g. Mozilla Firefox) 2. Mail clients (e.g. Mozilla Thunderbird) 3. Media clients (e.g. Windows Media Player) 4. FTP clients (e.g. WS_FTP) 5. Download Managers (e.g. FlashGet) 6. File Explorers (e.g. Windows Explorer) 7. Editors (e.g. UltraEdit) 8. View Viewers (e.g. XnView) You can use both %ProgramFiles% and %SystemRoot% and %HOMEDRIVE% and %HOMEPATH% in the command and arguments and they are substitutes with their appropriated values.

Java plugin not working (Firefox wants to install?) ln -s /opt/blackdown-jdk-1.4.2.01/jre/plugin/i386/mozilla/libjavaplugin_oji.so ~/.mozilla/plugins

44. Unison [file synchronizer]

Running unison I at some time suddenly got:

Code listing 44.1

	  ** ERROR **: First `engine' section must include a `stock' section.
	  aborting...
	  Aborted
	

45. Maxima

xmaxima doesn't get build: add to /etc/portage/package.use tcltk

Maxima [solved] PROBLEM emerge gives an error. SOLUTION: most easy way out seems to me cd /usr/portage and then emerge app-sci/maxima/maxima-5.9.0-r2.ebuild Some references: Maxima list this one and this one

46. Video

Screenshot: use input filename.extension on console and select video window. However, in order not to get blue/black picture you must startup with x11 driver (not xv): mplayer -vo x11 xine -V x11

Mplayer Startup with gui: Movie aspect ratio:

47. Questions

To Do's:

  • I want to play *.rm files from realmedia. Packages masked (for good reasons). How to get only the codec to be used by xine or mplayer?
  • gv2 plugin Firefox
  • HOW to delete files with e.g. 5 character filename? how to find out which package Y required a package X to be installed? convert using gimp from command line wine + MSofficesu texmacs + bibtex
  • molcas [MC-SCF quantum chemistry package (not free, but open)]. Don't expect trouble though.

48. Pen Tablet - Wacom Intuos 3 A5

This is a nice tablet: I was afraid it would be to small, but I'm happy I didn't buy the A4.... A5 is large enough for me.

(1) Config kernel and build as modules: Device Drivers -Input devices support -> Event Interface -USB support -> USB Human Interface Device (full HID) support -Wacom Intuos/Graphire tablet support (1) Add to /etc/portage/package.use the local use flags: x11-base/xorg-x11 sdk x11-misc/linuxwacom sdk usb wacom Re-emerge x11-xorg with these package specific USE flags (3) Add to keywords.package to get latest version of linuxwacom. x11-misc/linuxwacom Emerge linuxwacom to build userland tools and (!) the drivers. (4) Add to /etc/udev/rules.d/10-local.rules (create it if it doesn't exist) the following line:

Code listing 48.1

	  KERNEL=="event*", SYSFS{idVendor}=="056a", NAME="input/%k", SYMLINK="input/wacom%e"
	

Check that everything's ok: # ls /dev/input/wacom # wacdump /dev/input/wacdump There should be a device that responds to keyboard, one that responds to mouse, and one that responds to the tablet. # cat /proc/bus/input/devices. # cat /proc/bus/usb/devices

X Intput Device Hotplug is not fullly supported at Xorg yet . But, Wacom X driver has implemented a workaround for those who have to unplug/replug the tablet while X is running. To make your tablet work without restarting X server, please switch your virtual terminals after replug your tablet. That is, to press Ctrl + Alt + F1 together then release them (screen turns to console); to press Ctrl + Alt + F7 together then release them (screen returns back to normal).

49. Webcam

NOTE: don't select OVCamChip support in kernel! Via helpfull site http://www.qbik.ch/usb/devices found a simple webcam with driver support for linux. Terratec TerraCAM Pro USB Sensor: OV7620AE Bridge: OV518 Driver page: http://alpha.dyndns.org/ov511/status.html http://tven.terratec.net/modules.php?op=modload&name=News&file=article&sid=18&menu=206 Technical data: Image sensor 1/3" color sensor Focusing Manual Focal range 10 cm to infinity Diaphragm Automatic Image resolution Up to 640 x 480 pixels (VGA) Frame rate Up to 30 frames/second (QSIF), 25-30 frames/second (SIF) Color depth Up to 24-bit Compression Hardware compression, (4:1, 6:1, 8:1) Cable length 1.5 m

Code listing 49.1

	  Kernel Configuration:
	  # Device Drivers
	  <*> Support for Host-side USB
	  [ ]   USB verbose debug messages
	  ---   Miscellaneous USB options
	  [*]   USB device filesystem
	  [ ]   Enforce USB bandwidth allocation (EXPERIMENTAL)
	  [ ]   Dynamic USB minor allocation (EXPERIMENTAL)
	  ---   USB Host Controller Drivers
	  <M>   EHCI HCD (USB 2.0) support
	  [ ]     Full speed ISO transactions (EXPERIMENTAL)
	  [ ]     Root Hub Transaction Translators (EXPERIMENTAL)
	  <*>   OHCI HCD support
	  < >   UHCI HCD (most Intel and VIA) support
	  ---   USB Device Class drivers
	  <*>   USB Printer support
	  <*>   USB Mass Storage support
	  ---   USB Human Interface Devices (HID)
	  <*>   USB Human Interface Device (full HID) support
	  [*] HID input layer support
	  [ ]   Force feedback support (EXPERIMENTAL)
	  [ ] /dev/hiddev raw HID device support
	  --- USB Multimedia devices
	  <M> USB OV511 Camera support
	

Code listing 49.2

	  # Video 4 Linux (I2C also required for driver below)
	  # Device Drivers
	  Multimedia devices
	  <M> Video For Linux
	  <M> I2C support
	  <M>   I2C device interface 
	  <M> I2C bit-banging interfaces
	  I2C (pronounce: I-square-C) is a slow serial bus protocol used in 
	  many micro controller applications and developed by Philips.
	  SMBus or System Management Bus is a subset of the I2C protocol.
	  You will need this for x hardware sensors support, and also for Video
	  For Linux support.
	

Compilation and modules-update makes module loadable. Note videodev autoloads with it. # modprobe ovcamchip # modprobe ov511 Module Size Used by ov511 94976 0 videodev 7296 1 ov511 v4l2_common 4928 1 ov511 ovcamchip 25288 0 i2c_core 19024 2 ov511,ovcamchip PROBLEM: # Running xawtv This is xawtv-3.91, running on Linux/i686 (2.6.6) WARNING: Your X-Server has no DGA support. can't open /dev/v4l/video0: No such file or directory v4l-conf had some trouble, trying to continue anyway v4l2: open /dev/v4l/video0: No such file or directory v4l2: open /dev/v4l/video0: No such file or directory v4l: open /dev/v4l/video0: No such file or directory no video grabber device available # dmesg drivers/usb/media/ov511.c: USB OV518+ video device found drivers/usb/media/ov511.c: Device revision 0 drivers/usb/media/ov511.c: Compression required with OV518...enabling drivers/usb/media/ov511.c: Sensor is an OV7620AE drivers/usb/media/ov511.c: Device at usb-0000:00:03.1-2 registered to minor 0 usbcore: registered new driver ov511 drivers/usb/media/ov511.c: v1.64 for Linux 2.5 : ov511 USB Camera Driver In process /dev/video0 got created (not there before) with the proper access settings: #ls -ll /dev/video0 lr-xr-xr-x 1 root root 10 Sep 19 13:58 /dev/video0 -> v4l/video0 Tested with Xawtv and vidcat Enforce Bandwidth Allocation turned off in the USB kernel configuration. The 1.64 driver coming with kernel 2.6.8 was a bit old? 2.28 driver compiles only when i have I2C support (required by v4linux). It works with xawtv -noxv /dev/v4l/video0 NOTE: The driver with (even) 2.6.8 kernels doesn't include the REQUIRED compression module ov518_compr! I therefore used the latest driver from driver page. This now differnt organization of modules ov511 (with the ov518_compr now included) ovcamchip (now separate module for sensor chips) Simply unpack driver, cd to it, run make clean; make; make install; modules-update Done. Works fine with Xawtv, here my config. ./files/DOTxawtv

Code listing 49.3

	  # cat /proc/bus/usb/devices
	  S:  Manufacturer=OmniVision Technologies, Inc.
	  S:  Product=USB Camera
	

Kernel drivers: version 2.27 and 1.64?

Code listing 49.4

	  Multimedia devices --->
	  <M> Video For Linux
	  --- Video Adapters
	  <M> OmniVision Camera Chip support
	


line
Updated Today
line
M. Wegewijs
Author

line
Summary:  Here I collect general tricks I found (out) while using Gentoo Linux for over the last 2 years. As Gentoo is all about choices, here are the ones I made. These include tricks related to side-devices (mice, tablets, memory sticks, etc.) but not those related to specific core-hardware (mainboard, cpu, bios, etc). For the latter see my other guides. DISCLAIMER: These are notes I for my own personal use, made available for your convenience. They may not make any sense, be outdated or be simply plain wrong here and there. Use at your own risk.
line

Donate to support our development efforts.

line
The Gentoo Linux Store
line
php|architect

php|architect is the monthly magazine for PHP professionals, available worldwide in print and electronic format. A percentage of all the sales will be donated back into the Gentoo project.

line
Tek Alchemy

Tek Alchemy offers dedicated servers and other hosting solutions running Gentoo Linux.

line
DDR Memory at Crucial.com

Purchase RAM from Crucial.com and a percentage of your sale will go towards further Gentoo Linux development.

line
Win4Lin at NeTraverse

Win4Lin from NeTraverse lets you run Windows applications under Gentoo Linux at native speeds.

line
Copyright 2001-2003 Gentoo Technologies, Inc. Questions, Comments, Corrections? Email www@gentoo.org.