So my problem is that Ubuntu logs me out after an idle while. It is 'by accident' similar or the same amount of time as execution of my screensaver. The session is totally lost. All programs are shut down, all work is lost.
I googled and it looks as people have problems occasionally with it. And they blame different guys such as Eclipse, Firefox, movie players, KDE, etc. Maybe it is true. However, I have also have found out that the problem may arise from the screensaver that uses OpenGL or whatever. So I told Ubuntu not to run screensaver any more. I will check if it works.
Friday, April 4, 2008
Wednesday, January 2, 2008
92. Grub Error 15: File not found
This error occurs when something is messed up with the grub files.
Googling I found something like this:
http://forum.notebookreview.com/archive/index.php/t-162896.html
1. I press 'c' for command line in grub
2. Then I tried to find the menu.lst file. I used the command in the grub shell:
find /boot/grub/menu.lst
You can use 'TAB' to display directories.
I got the output
(hd0,6)
I remember that number.
3. Then I exited the grub with the reboot command
4. Then I press 'e' to edit the boot sequence.
My first line was:
root (hd0,7)
I changed this line to (hd0,6) with the 'e' key.
5. And now grub Ubuntu 7.10 rebooted.
6. Now I want to make this change permanent. Then after successful rebooting first I made a copy of the menu.lst file and then changed the
root (hd0,7) to root (hd0,6)
in each booting configuration.
7. I rebooted it and ... it works!
Googling I found something like this:
http://forum.notebookreview.com/archive/index.php/t-162896.html
1. I press 'c' for command line in grub
2. Then I tried to find the menu.lst file. I used the command in the grub shell:
find /boot/grub/menu.lst
You can use 'TAB' to display directories.
I got the output
(hd0,6)
I remember that number.
3. Then I exited the grub with the reboot command
4. Then I press 'e' to edit the boot sequence.
My first line was:
root (hd0,7)
I changed this line to (hd0,6) with the 'e' key.
5. And now grub Ubuntu 7.10 rebooted.
6. Now I want to make this change permanent. Then after successful rebooting first I made a copy of the menu.lst file and then changed the
root (hd0,7) to root (hd0,6)
in each booting configuration.
7. I rebooted it and ... it works!
Sunday, December 9, 2007
93. slowing down the cd speed
http://ubuntuforums.org/showthread.php?t=26864
Three different approaches.
speed can probably be one of 1 2 4 8 16
cdrom device can probably be /dev/cdrom or /dev/dvd
Source:
http://web.njit.edu/all_topics/Prog_...er/cd-dvd.html
EDIT: You need to be root to do that (prefix commands with sudo)
Three different approaches.
Code:
hdparm -E [speed] [cdrom device]
setcd -x [speed] [cdrom device]
echo current_speed:4 > /proc/ide/[cdrom device]/settings
cdrom device can probably be /dev/cdrom or /dev/dvd
Source:
http://web.njit.edu/all_topics/Prog_...er/cd-dvd.html
EDIT: You need to be root to do that (prefix commands with sudo)
94. making web links work in skype in ubuntu
94. making links work in skype
it works!
problem:
I have a skype 2.0.0beta installed on linux-ubuntu 7.10 and when I got the web link,
when I clicked it nothing happens.
solution:
http://ubuntuforums.org/showthread.php?t=214224
1. Check: system -> preferences -> preferred applications
2. I've got: /opt/firefox/firefox "%s"
3. However, I have got Firefox in /usr/bin/firefox
4. I changed from 'custom' web browser to firefox, and choose open link in new tab
5. As a result: I have: firefox -new-tab "%s"
6. And it works!
it works!
problem:
I have a skype 2.0.0beta installed on linux-ubuntu 7.10 and when I got the web link,
when I clicked it nothing happens.
solution:
http://ubuntuforums.org/showthread.php?t=214224
1. Check: system -> preferences -> preferred applications
2. I've got: /opt/firefox/firefox "%s"
3. However, I have got Firefox in /usr/bin/firefox
4. I changed from 'custom' web browser to firefox, and choose open link in new tab
5. As a result: I have: firefox -new-tab "%s"
6. And it works!
95. switching monitors
2007-12-01
95. It works!
Web page:
http://www.thinkwiki.org/wiki/Sample_Fn-F7_script
a. configure virtual screen size
Add a "Virtual" statement to your /etc/X11/xorg.conf, the total resolution should be large enough to fit all your screens
in the configuration you want, for example if you have 1600x1200 monitor to the left of your internal 1024x768 monitor,
your total max resolution is 2624x1200
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Virtual 2624 1200
EndSubSection
EndSection
b. configure acpi
Modify:
/etc/acpi/events/ibm-videobtn
# /etc/acpi/events/ibm-videobtn
# This is called when the user presses the video button. It is currently
# a placeholder.
event=ibm/hotkey HKEY 00000080 00001007
action=/usr/local/sbin/thinkpad-fn-f7
# action=/bin/true
c. You may need to enable ibm-hotkeys
/etc/rc.local
#!/bin/bash
# enable ibm-hotkeys (specifically Fn2, Fn7)
# 12 bit mask, little end is F1 default 0x080c = F12+F4+F3
echo enable,0x084e > /proc/acpi/ibm/hotkey
and after suspending to disk RAM
/etc/acpi/resume.d/91-ibm-hotkey-enable.sh
#!/bin/bash
# enable ibm-hotkeys (specifically Fn2, Fn7)
# 12 bit mask, little end is F1 default 0x080c = F12+F4+F3
echo enable,0x084e > /proc/acpi/ibm/hotkey
chmod 755 91-ibm-hotkey-enable.sh
d. identify output devices
Note the names of your output devices as you will have to change EXTERNAL_OUTPUT and INTERNAL_OUTPUT
to what xrandr shows, for example VGA and LVDS in this case:
$ xrandr -q
VGA connected 1600x1200+0+0 (normal left inverted right x axis y axis) 432mm x 324mm
...
LVDS connected (normal left inverted right x axis y axis)
e. create the bash script
Create /usr/local/sbin/thinkpad-fn-f7, you can set EXTERNAL_LOCATION to one of: left, right, above, or below.
#!/bin/bash
# External output may be "VGA" or "VGA-0" or "DVI-0"
EXTERNAL_OUTPUT="VGA"
INTERNAL_OUTPUT="LVDS"
EXTERNAL_LOCATION="left"
# Figure out which user and X11 display to work on
# TODO there has to be a better way to do this?
X_USER=$(w -h -s | grep ":[0-9]" | head -1 | awk '{print $1}')
export DISPLAY=$(w -h -s | grep ":[0-9]" | head -1 | awk '{print $3}')
# Switch to X user if necessary
if [ "$X_USER" != "$USER" ]; then
SU="su $X_USER -c"
fi
case "$EXTERNAL_LOCATION" in
left|LEFT)
EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
;;
right|RIGHT)
EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
;;
top|TOP|above|ABOVE)
EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
;;
bottom|BOTTOM|below|BELOW)
EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
;;
*)
EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
;;
esac
# Figure out current state
INTERNAL_STATE=$($SU xrandr | grep ^$INTERNAL_OUTPUT | grep con | sed "s/.*connected //" | sed "s/(.*//")
EXTERNAL_STATE=$($SU xrandr | grep ^$EXTERNAL_OUTPUT | grep con | sed "s/.*connected //" | sed "s/(.*//")
if [ -z "$INTERNAL_STATE" ]; then
STATE="external"
elif [ -z "$EXTERNAL_STATE" ]; then
STATE="internal"
else
INTERNAL_STATE=$(echo $INTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
EXTERNAL_STATE=$(echo $EXTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
if [ "$INTERNAL_STATE" = "$EXTERNAL_STATE" ]; then
STATE="mirror"
else
STATE="both"
fi
fi
function screen_external(){
$SU "xrandr --output $INTERNAL_OUTPUT --off"
$SU "xrandr --output $EXTERNAL_OUTPUT --auto"
}
function screen_internal(){
$SU "xrandr --output $EXTERNAL_OUTPUT --off"
$SU "xrandr --output $INTERNAL_OUTPUT --auto"
}
function screen_mirror(){
$SU "xrandr --output $INTERNAL_OUTPUT --auto"
$SU "xrandr --output $EXTERNAL_OUTPUT --auto --same-as $INTERNAL_OUTPUT"
}
function screen_both(){
$SU "xrandr --output $INTERNAL_OUTPUT --auto"
$SU "xrandr --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION"
}
function screen_toggle(){
case "$STATE" in
internal)
screen_mirror
;;
mirror)
screen_external
;;
external)
screen_both
;;
both)
screen_internal
;;
*)
screen_internal
;;
esac
}
# What should we do?
DO="$1"
if [ -z "$DO" ]; then
if [ $(basename $0) = "thinkpad-fn-f7" ]; then
DO="toggle"
fi
fi
case "$DO" in
toggle)
screen_toggle
;;
internal)
screen_internal
;;
external)
screen_external
;;
mirror)
screen_mirror
;;
both)
screen_both
;;
status)
echo "Current Fn-F7 state is: $STATE"
echo
echo "Attached monitors:"
$SU xrandr | grep "\Wconnected" | sed "s/^/ /"
;;
*)
echo "usage: $0" >&2
echo >&2
echo " commands:" >&2
echo " status" >&2
echo " internal" >&2
echo " external" >&2
echo " mirror" >&2
echo " both" >&2
echo " toggle" >&2
echo >&2
;;
esac
chmod 755 thinkpad-fn-f7
$ sudo chmod 755 /usr/local/sbin/thinkpad-fn-f7
$ sudo service acpid restart
OR
$ sudo /etc/init.d/acpid restart
95. It works!
Web page:
http://www.thinkwiki.org/wiki/Sample_Fn-F7_script
a. configure virtual screen size
Add a "Virtual" statement to your /etc/X11/xorg.conf, the total resolution should be large enough to fit all your screens
in the configuration you want, for example if you have 1600x1200 monitor to the left of your internal 1024x768 monitor,
your total max resolution is 2624x1200
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Virtual 2624 1200
EndSubSection
EndSection
b. configure acpi
Modify:
/etc/acpi/events/ibm-videobtn
# /etc/acpi/events/ibm-videobtn
# This is called when the user presses the video button. It is currently
# a placeholder.
event=ibm/hotkey HKEY 00000080 00001007
action=/usr/local/sbin/thinkpad-fn-f7
# action=/bin/true
c. You may need to enable ibm-hotkeys
/etc/rc.local
#!/bin/bash
# enable ibm-hotkeys (specifically Fn2, Fn7)
# 12 bit mask, little end is F1 default 0x080c = F12+F4+F3
echo enable,0x084e > /proc/acpi/ibm/hotkey
and after suspending to disk RAM
/etc/acpi/resume.d/91-ibm-hotkey-enable.sh
#!/bin/bash
# enable ibm-hotkeys (specifically Fn2, Fn7)
# 12 bit mask, little end is F1 default 0x080c = F12+F4+F3
echo enable,0x084e > /proc/acpi/ibm/hotkey
chmod 755 91-ibm-hotkey-enable.sh
d. identify output devices
Note the names of your output devices as you will have to change EXTERNAL_OUTPUT and INTERNAL_OUTPUT
to what xrandr shows, for example VGA and LVDS in this case:
$ xrandr -q
VGA connected 1600x1200+0+0 (normal left inverted right x axis y axis) 432mm x 324mm
...
LVDS connected (normal left inverted right x axis y axis)
e. create the bash script
Create /usr/local/sbin/thinkpad-fn-f7, you can set EXTERNAL_LOCATION to one of: left, right, above, or below.
#!/bin/bash
# External output may be "VGA" or "VGA-0" or "DVI-0"
EXTERNAL_OUTPUT="VGA"
INTERNAL_OUTPUT="LVDS"
EXTERNAL_LOCATION="left"
# Figure out which user and X11 display to work on
# TODO there has to be a better way to do this?
X_USER=$(w -h -s | grep ":[0-9]" | head -1 | awk '{print $1}')
export DISPLAY=$(w -h -s | grep ":[0-9]" | head -1 | awk '{print $3}')
# Switch to X user if necessary
if [ "$X_USER" != "$USER" ]; then
SU="su $X_USER -c"
fi
case "$EXTERNAL_LOCATION" in
left|LEFT)
EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
;;
right|RIGHT)
EXTERNAL_LOCATION="--right-of $INTERNAL_OUTPUT"
;;
top|TOP|above|ABOVE)
EXTERNAL_LOCATION="--above $INTERNAL_OUTPUT"
;;
bottom|BOTTOM|below|BELOW)
EXTERNAL_LOCATION="--below $INTERNAL_OUTPUT"
;;
*)
EXTERNAL_LOCATION="--left-of $INTERNAL_OUTPUT"
;;
esac
# Figure out current state
INTERNAL_STATE=$($SU xrandr | grep ^$INTERNAL_OUTPUT | grep con | sed "s/.*connected //" | sed "s/(.*//")
EXTERNAL_STATE=$($SU xrandr | grep ^$EXTERNAL_OUTPUT | grep con | sed "s/.*connected //" | sed "s/(.*//")
if [ -z "$INTERNAL_STATE" ]; then
STATE="external"
elif [ -z "$EXTERNAL_STATE" ]; then
STATE="internal"
else
INTERNAL_STATE=$(echo $INTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
EXTERNAL_STATE=$(echo $EXTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
if [ "$INTERNAL_STATE" = "$EXTERNAL_STATE" ]; then
STATE="mirror"
else
STATE="both"
fi
fi
function screen_external(){
$SU "xrandr --output $INTERNAL_OUTPUT --off"
$SU "xrandr --output $EXTERNAL_OUTPUT --auto"
}
function screen_internal(){
$SU "xrandr --output $EXTERNAL_OUTPUT --off"
$SU "xrandr --output $INTERNAL_OUTPUT --auto"
}
function screen_mirror(){
$SU "xrandr --output $INTERNAL_OUTPUT --auto"
$SU "xrandr --output $EXTERNAL_OUTPUT --auto --same-as $INTERNAL_OUTPUT"
}
function screen_both(){
$SU "xrandr --output $INTERNAL_OUTPUT --auto"
$SU "xrandr --output $EXTERNAL_OUTPUT --auto $EXTERNAL_LOCATION"
}
function screen_toggle(){
case "$STATE" in
internal)
screen_mirror
;;
mirror)
screen_external
;;
external)
screen_both
;;
both)
screen_internal
;;
*)
screen_internal
;;
esac
}
# What should we do?
DO="$1"
if [ -z "$DO" ]; then
if [ $(basename $0) = "thinkpad-fn-f7" ]; then
DO="toggle"
fi
fi
case "$DO" in
toggle)
screen_toggle
;;
internal)
screen_internal
;;
external)
screen_external
;;
mirror)
screen_mirror
;;
both)
screen_both
;;
status)
echo "Current Fn-F7 state is: $STATE"
echo
echo "Attached monitors:"
$SU xrandr | grep "\Wconnected" | sed "s/^/ /"
;;
*)
echo "usage: $0
echo >&2
echo " commands:" >&2
echo " status" >&2
echo " internal" >&2
echo " external" >&2
echo " mirror" >&2
echo " both" >&2
echo " toggle" >&2
echo >&2
;;
esac
chmod 755 thinkpad-fn-f7
$ sudo chmod 755 /usr/local/sbin/thinkpad-fn-f7
$ sudo service acpid restart
OR
$ sudo /etc/init.d/acpid restart
96. VNC
2007-12-01-02-06
96. If VNC server responds connection refused 10006 it may mean that on the host
where is the server, the firewall is set.
There is a workaround you have to use a REVERSE mode: vncserver -connect host_ip
with the host ip on the host where viewer has to be run and vncviewer -listen on the
viewer computer. When you are connected you can change firewall settings to allow
vncserver
96. If VNC server responds connection refused 10006 it may mean that on the host
where is the server, the firewall is set.
There is a workaround you have to use a REVERSE mode: vncserver -connect host_ip
with the host ip on the host where viewer has to be run and vncviewer -listen on the
viewer computer. When you are connected you can change firewall settings to allow
vncserver
Subscribe to:
Posts (Atom)