Monday, October 27, 2008

dual monitor on my laptop

Using xrandr and the monitor sitting on my desk.

Edit xorg.conf and add the "virtual" line (if there is no xorg.conf and it's
using the guess-mechanism, copy the guess from /var/log/Xorg.0.log )


Section "Screen"
...
Subsection "Display"
...
Virtual 1280 1824
EndSubSection
EndSection

Then create the script "switchDual"

$ cat bin/switchDual
#!/bin/bash

if [ -e /var/lock/subsys/gerbaudo/dualOn ]
then
echo "turning off VGA screen..."
xrandr --auto --output LVDS --mode 1280x800 --output VGA --off
rm /var/lock/subsys/gerbaudo/dualOn
else
echo "turning on VGA screen..."
xrandr --auto --output VGA --mode 1280x1024 --above LVDS
touch /var/lock/subsys/gerbaudo/dualOn
fi


As root create the dir where the lockfile is stored


# mkdir /var/lock/subsys/gerbaudo
# chown gerbaudo:gerbaudo /var/lock/subsys/gerbaudo


and add an icon for it on the desktop


$ cat ~/Desktop/startDual.desktop
[Desktop Entry]
Comment=
Comment[en_US]=
Encoding=UTF-8
Exec[$e]='/home/gerbaudo/bin/switchDual'
GenericName=startDual
GenericName[en_US]=startDual
Icon=
MimeType=
Name=startDual
Name[en_US]=startDual
Path[$e]=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=


Voila

Saturday, October 25, 2008

gentoo - fuse

install the "fssh" stuff that you got from Justace--thanks man!

emerge sys-fs/sshfs-fuse

mkdir /rooms
mkdir /work

chmod /rooms --reference=/mnt/cdrom
chmod /work --reference=/mnt/cdrom

At this point--works as root--something wrong with permissions

groupadd fuse

usermod -a -G fuse gerbaudo

Try to reboot: still not working. Google around and try this:

chown gerbaudo:gerbaudo /rooms
chown gerbaudo:gerbaudo /work/


Now it works :-)

gentoo install root (disable cintex+reflex)

Something is wrong with compiling root5.20.00 on gentoo
(see this bug report)

add in /etc/portage/package.keywords

sci-physics/root ~x86

Then following this link
gerbaudo-hp ~ # ls /usr/portage/sci-physics/root/
ChangeLog files root-3.05.04.ebuild root-5.18.00d.ebuild root-5.20.00.ebuild
Manifest metadata.xml root-5.16.00.ebuild root-5.20.00-r1.ebuild
gerbaudo-hp ~ # mkdir /usr/local/portage
gerbaudo-hp ~ # mkdir /usr/local/portage/sci-physics
gerbaudo-hp ~ # mkdir /usr/local/portage/sci-physics/root
gerbaudo-hp ~ # cp /usr/portage/sci-physics/root/root-5.20.00.ebuild /usr/local/portage/sci-physics/root/
gerbaudo-hp ~ # cp -rp /usr/portage/sci-physics/root/files /usr/local/portage/sci-physics/root/

add one line in make .conf

gerbaudo-hp ~ # emacs -nw /etc/make.conf
gerbaudo-hp ~ # diff /etc/make.conf /etc/make.conf~
< PORTDIR_OVERLAY="/usr/local/portage"

gerbaudo-hp ~ # cd /usr/local/portage/sci-physics/root/

disable cintex and reflex from the ebuild

gerbaudo-hp root # emacs -nw root-5.20.00.ebuild
gerbaudo-hp root # diff root-5.20.00.ebuild root-5.20.00.ebuild~
142c142
< --disable-cintex \ --- > --enable-cintex \
148c148
< --disable-reflex \ --- > --enable-reflex \

and finally digest

gerbaudo-hp root # ebuild root-5.20.00.ebuild digest

Then

gerbaudo-hp root # emerge -av =root-5.20.00

Friday, October 24, 2008

wifi on gentoo

This is the wireless HW I have:

gerbaudo@gerbaudo-hp ~ $ /usr/sbin/lspci -v | grep Wireless
10:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

First of all you need to enable the drivers in your .config
(or use the .config you have, or create it automagically).
These are the flags I have

#
# Wireless LAN
#
CONFIG_WLAN_80211=y
CONFIG_IWL3945=m
CONFIG_IWL3945_QOS=y
...
#
# Wireless
#
CONFIG_CFG80211=y
CONFIG_NL80211=y
CONFIG_WIRELESS_EXT=y
CONFIG_MAC80211=y

then build the kernel and try some debugging

ifconfig wlan0 up

then copy your old wpa_supplicant.conf and then

add in /etc/conf.d/net

config_wlan0=("dhcp")
modules=( "wpa_supplicant" )
mode_wlan0="managed"
wpa_supplicant_wlan0="-Dwext"


cd /etc/init.d ; ln -s net.lo net.wlan0


One further thing that I did (but I don't know whether
or not it's necessary) is :

wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf

At the next reboot it tried eth0, timed-out, and connected on wlan0 :-)

Tuesday, October 14, 2008

split multiple-pages pdf in multiple files

gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=epswrite -sOutputFile=result-%02d.eps /tmp/infile.pdf

then eps2pdf

Monday, October 13, 2008

skype on SLC4

Tried to install skype on SLC4.
Can only get the latest version (2.0.0.72) from skype.com (cannot find older versions around).
Download the statically linked package from http://www.skype.com/go/getskype-linux-static
Unpack in /usr/local/share/skype; it complains about

/skype: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.4' not found

Need more recent stdc++ library (using gcc version 3.4.6 from /usr/bin/gcc);
get gcc-4.2.1 from http://gcc.gnu.org. Then configure; make; make install.
Change the symbolyc link so that it points to the new library

/usr/lib/libstdc++.so.6 -> /usr/local/lib/libstdc++.so.6.0.9

Now skype starts without much complaining. I can hear sounds, but
cannot speak. Kill artsd (don't know, might not be the problem),
change settings with alsamixer. Then from the skype settings switch
from the default audio device to the 4th one (otherwise
"Call Failed: Problem with Audio Playback" ).
Now it seems to work (can hear my voice back during test call), but I might
have to adjust the mic volume.

Note: set audio device different from the default one for input/output/ringing, not only for output