Sunday, May 10, 2009

Ubuntu How to: hibernation confirmation message(message before hibernate)


1. Open gconf-editor. Go to Apps->gnome-power-manager->lock
uncheck hibernate. This will inhibit powermanager to lock your screen right after you click the hibernate button.


2.made a copy of /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux as /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linuxa

3.Edited /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux as

#!/bin/sh
getXuser() {
user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
if [ x"$user" = x"" ]; then
user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
}

for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
pid=`pgrep -u "MY USERNAME" gnome-screensav`
DBUS=`grep -z DBUS_SESSION_BUS_ADDRESS /proc/$pid/environ | sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
###HERE RUN ANY PROGRAM WHICH WILL DISPLAY YOUR MESSAGE ###

(
echo "0" ; sleep 1
echo "# 10 Sec to Hibernate" ;
echo "10" ; sleep 1
echo "# 9 Sec to Hibernate" ;
echo "20" ; sleep 1
echo "# 8 Sec to Hibernate" ;
echo "30" ; sleep 1
echo "# 7 Sec to Hibernate" ;
echo "40" ; sleep 1
echo "# 6 Sec to Hibernate" ;
echo "50" ; sleep 1
echo "# 5 Sec to Hibernate" ;
echo "60" ; sleep 1
echo "# 4 Sec to Hibernate" ;
echo "70" ; sleep 1
echo "# 3 Sec to Hibernate" ;
echo "80" ; sleep 1
echo "# 2 Sec to Hibernate" ;
echo "90" ; sleep 1
echo "# 1 Sec to Hibernate" ;
echo "100" ; sleep 1
) |
zenity --progress \
--title="Hibernate" \
--auto-close \




if [ "$?" = 0 ] ; then
sh /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linuxa & sudo -u "MY USERNAME" gnome-screensaver-command --lock


fi



fi
done


I hope this would help anyone faces the same trouble as me.You have to replace "MY USERNAME" to your current login user name.This will give a 10sec countdown to hibernate before it does with the option of cancel button.It also locks the screen when it resumes from hibernate..

Saturday, January 10, 2009

USB ADSL modem in linux..(conexant and more...)

Thanks to these nice people it is really easy now.I used it and it works really well..
Im a newbee to Linux and it was a nightmare when I tried to get connected to internet through my access runner ADSL modem.I tried everything..Even things at sourceforge.net.& at the end I found this.. UbuDSL – configure your USB ADSL modem and connection easier than ever!

So here's the link.Have fun linux users..

http://www.ubudsl.com/en/start.php

Friday, May 2, 2008

Prefetch in windows XP

If your PC takes long time to load here's a trick to reduce that time...



XP uses prefetch to load Ur most run servises,porg..s to during Ur start up whether u want it or not ..u can disable it by this method...

  1. start menu
  2. run
  3. type regedit(starting registry editor)
  4. go to HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management\PrefetchParameters\EnablePrefetcher
  5. Values you can choose from include:
    0: Disable
    1: Application Launch Prefetch-applications eg word ,exel to be prefetched at boot time
    2: Boot Prefetch-booting files to be prefetched 3: Prefetch everything
  6. re boot
  7. If want to clear some space go to \WINDOWS\Prefetch(in windows dir) and del all the items prefetched early..(u might want to change folder settings to show hidden files and system files.)

How to change drive letters....C:\D:\ etc

If u want to change drive letter yet got stuck under conventional method
(Control panel->admin tools-> computer management-> storage-> disk management-> right click on partition ->change drive letter....) because windows won't let you do so
Here's how to,
  1. start menu
  2. run
  3. type regedit(starting registry editor)
  4. go to HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
  5. find the drive you want to change the letter
  6. right click on that (eg:\DosDevices\F:)
  7. select rename
  8. change name to what you want(eg:\DosDevices\F: as \DosDevices\D: if D: is what you want to assign)
  9. there cant be two drives in same name as you know so you will have to change rest as needed
  10. restart the machine

Be careful when u change because it might cause some programmes not to run..

if needed you can run a programme like Power Quests Drive mapper to correct this problem

Google