RESEARCHUT
Minds With Innovations

RESEARCHUT - minds with innovations

Search!

Archives

Next Archive Previous Archive

01 Jun - 30 Jun 2005
01 Jul - 31 Jul 2005
01 Aug - 31 Aug 2005
01 Sep - 30 Sep 2005
01 Oct - 31 Oct 2005
01 Dec - 31 Dec 2005
01 Jan - 31 Jan 2006
01 Feb - 28 Feb 2006
01 Mar - 31 Mar 2006
01 Apr - 30 Apr 2006
01 May - 31 May 2006
01 Jun - 30 Jun 2006
01 Jul - 31 Jul 2006
01 Aug - 31 Aug 2006
01 Oct - 31 Oct 2006
01 Nov - 30 Nov 2006
01 Dec - 31 Dec 2006
01 Jan - 31 Jan 2007
01 Mar - 31 Mar 2007
01 Apr - 30 Apr 2007
01 May - 31 May 2007
01 Jul - 31 Jul 2007
01 Aug - 31 Aug 2007
01 Oct - 31 Oct 2007
01 Nov - 30 Nov 2007
01 Jan - 31 Jan 2008
01 Feb - 29 Feb 2008
01 Mar - 31 Mar 2008
01 Apr - 30 Apr 2008
01 May - 31 May 2008
01 Jun - 30 Jun 2008

Categories

Fun
KDE
Sex
Rant
News
Debian
Romance
Computer
Software
Philosophy
Technology
Programming

About

A space which could be philosophic, energetic, poetic, technic, mantic, idealistic, frenetic and sarcastic at times,
I guess!


Copyright © Ritesh Raj Sarraf

Unless specifically stated otherwise, the information on this page is available under the terms of the
GNU Free Documentation License.

Calendar

« August 2008
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Links

RESEARCHUT
Technical Consultancy
Photo Gallery
About Me

Last Comments

Ashish Shukla (Boston, MA): So, are you also going to …
Ravi (Boston, MA): How did they allow you? BT…
Ritesh (Lambroghini Drink…): Stopped != Quit Blame th…
Ravi (Lambroghini Drink…): Someone said that you stop…
Ritesh Raj Sarraf… (KDE4 with KDE3): Sorry. One more important …

Powered By

Powered by Pivot - 1.40.5: 'Dreadwind'
XML: RSS Feed
XML: Atom Feed
Pivot Blacklist
Powered by Debian

Linkdump

+ 6 - 3 | § Wikimapia

My Hometown.
My Home.
My other house

+ 3 - 5 | § Bye Bye Bootsplash

Wow!

This is called freedom. Bootsplash  has been a great eye-candy application in the Linux arena but now it's time to say goodbye.

I just tried splashy and its a charm. The great thing is that it doesn't need a patched kernel. So newbies or people who don't prefer to rollout their own kernel can use splashy and have a clean boot up.

Used tags:

Keywords: Bootsplash,Splashy

+ 7 - 1 | § pypt-offline 0.6.Beta Released

I'm happy that a new release has been possible.

This new release is almost a complete re-write and has many fixes and features.

For details, visit:

http://pypt-offline.sf.net 

There's also a small HOWTO about pypt-offline

Cheers!

Ritesh

(more) Used tags: ,

Keywords: pypt-offline,Offline,Package,Manager

+ 1 - 7 | § Software Suspend 2 with root/swap on LVM

Disclaimer: YMMV

I had always had failures with Software Suspend 2 (swsusp2) on my laptop because of which I had a perception that it really wasn't ready for use for beta users also. But recently after reading the comments of many users on LWN I felt how wrong I actuall was.

Anyways, setting up swsusp2 with root/swap on LVM is a little tricky. From my past experience  I've felt that to be the major reason for me to not able to use this excellent feature.

We'll go straight.

the kernel config file I've used for my kernel (2.6.17) with swsusp2. My setup is root/swap on LVM. 

With this configuration you should have a kernel with swsusp2 working. What I did find was that none of the present UI support swsusp2.

Hence I thought of writing a small utility which would be better for Desktop users.

I also use a perl script which gets executed before swsusp2 is called. This script was downloaded from LWN. This script basically does the job of freeing up memory so that only the exact required data gets written to swap during suspend. This script works both for swsusp and swsusp2 because technically it has got nothing to do with software suspend.

rrs@learner:~ $ cat bin/swsusp.pl
#!/usr/bin/perl -w
use strict;
use Time::HiRes qw(time);


sub swapfree {
open(PROC, "/proc/meminfo") or die "open: /proc/meminfo: $!";
my ($swapfree) = grep(/^SwapFree:/, <PROC>);
close(PROC);
$swapfree =~ s/\D+//gos;
print STDERR "swapfree=$swapfree\n";
return $swapfree;
}


my $last_swapfree = swapfree;
my @blobs;


my $count = 0;
my $total = 0;


my $start_time = time;


while ($last_swapfree <= (my $new_swapfree = swapfree)) {
++$count;
push(@blobs, ('.' x (1048576 * $count)));
$total += $count;
print STDERR "${total}M allocated\n";
$last_swapfree = $new_swapfree;
}
system("ps m $$");
print STDERR time - $start_time, " seconds\n";

rrs@learner:~ $ cat bin/my_hibernate.sh
#!/bin/bash

memory_free_perl()
{
        #First let's free up the memory.
        echo -en "Executing the memory freeing perl script - swsusp.pl" | osd_cat --font '-misc-fixed-medium-r-semicondensed--*-240-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50 && ~/bin/swsusp.pl && echo -en "Execution completed - swsusp.pl" | osd_cat --font '-misc-fixed-medium-r-semicondensed--*-240-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50
}

suspend_to_disk()
{
  echo -en "Now starting Suspend2" | osd_cat --font '-misc-fixed-medium-r-semicondensed--*-280-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50 && sudo /usr/sbin/hibernate
}

suspend_to_ram()
{
  echo -en "Now starting Suspend2" | osd_cat --font '-misc-fixed-medium-r-semicondensed--*-280-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50 && sudo /usr/sbin/hibernate -F /etc/hibernate/ram.conf
}

if [ $1 == "Disk" ]; then

  # First free the memory
  memory_free_perl

  # Now Suspend to Disk
  suspend_to_disk
elif [ $1 == "RAM" ]; then
  # First free the memory
  memory_free_perl

  # Now Suspend to RAM
  suspend_to_ram
elif [ $1 == "" ]; then

  # Assume interactive invocation
  memory_free_perl

  # So suspend to disk
  suspend_to_disk
else
  echo -en "Aborting!!! Invalid Suspend Task Given.\a" | osd_cat --font '-misc-fixed-medium-r-semicondensed--*-280-*-*-c-*-*-*' --colour=Green --shadow 1 --pos bottom --align center --offset 50
fi

rrs@learner:~ $ cat bin/my_hibernate_ui.sh
#!/bin/bash

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin/:/usr/local/sbin:

DIALOG=`which dialog`;
[ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
set -vx
which_suspend()
{
  Xdialog --radiolist "Suspend To ?" 10 25 2 "Disk" "Suspend" ON "RAM " "Suspend" off 2>/tmp/susp_checklist.$$
  retval=$?
  choice=`cat /tmp/susp_checklist.$$`;
  rm -f /tmp/susp_checklist.$$;

  case $retval in
    0)
    ~/bin/my_hibernate.sh $choice;;
    1)
    echo -en "Cancel Pressed";;
    255)
    echo -en "Box Closed";;
  esac
}

$DIALOG --wrap --title "Question"\
  --help "Contact Author Ritesh Raj Sarraf\nEmail: rrs@researchut.com"\
  --yesno "Do you want to execute the Suspend2 Script ?" 0 0

case $? in
  0)
  which_suspend;;
  255)
  $DIALOG --wrap --title "Aborted" --infobox "Cancelled"
esac
 

All these scripts together allow you to have a good UI for swsusp2 (They use xosd, Xdialog et cetera)

After copying these 3 scripts to ~/bin/ you can add a shortcut on your Desktop for my_hibernate_ui.sh which itself calls my_hibernate.sh and swsusp.pl

Let me know your comments and suggestions.

Cheers!

rrs

Used tags: , ,

Keywords: swsusp2,suspend2,hibernate

+ 1 - 6 | § Creative Destructivity

Creative Destructivity by Raghavendra Buddi

- Powered by vIm && Mozilla - Best viewed with your eyes