Login time quota

Discussion in 'Perl Misc' started by Koos Pol, Mar 17, 2007.

  1. Koos Pol

    Koos Pol Guest

    After unfruitful debates with my teenage daughter about not spending too
    much time on her computer, I decided to take the more eh, pragmatic
    approach. As I couldn't find any program that suites me, I've written a
    small Perl script that you can launch from your Un*x boot scripts.
    You can run it like

    login_quota -u mary -t 120 &

    This will make sure Mary does not spend more that her alloted 120 minutes.

    Some things perhaps noteworthy:
    - It pauses timing when Mary's screensaver is running
    - It can be fooled if she leaves a screensaver running on another X display
    - Configuration locations are hard coded.
    - It could use a day scheme variation. It would be nice to allow different
    quota for for instance weekends.

    But as it suits me already I'm not bothering to take it up another step.
    If anyone wants to steal or borrow it, please feel free. I would appreciate
    it though if you make your improvements public.

    http://www.xs4all.nl/~koospol/public/login_quota

    Cheers,
    Koos
    --
    43rd Law of Computing: Anything that can go wr
    fortune: Segmentation violation -- Core dumped
    Koos Pol, Mar 17, 2007
    #1
    1. Advertising

  2. On Mar 17, 8:07 am, Koos Pol <> wrote:
    > After unfruitful debates with my teenage daughter about not spending too
    > much time on her computer, I decided to take the more eh, pragmatic
    > approach. As I couldn't find any program that suites me, I've written a
    > small Perl script that you can launch from your Un*x boot scripts.
    > You can run it like
    >
    > login_quota -u mary -t 120 &
    >
    > This will make sure Mary does not spend more that her alloted 120 minutes.
    >
    > Some things perhaps noteworthy:
    > - It pauses timing when Mary's screensaver is running
    > - It can be fooled if she leaves a screensaver running on another X display
    > - Configuration locations are hard coded.
    > - It could use a day scheme variation. It would be nice to allow different
    > quota for for instance weekends.
    >
    > But as it suits me already I'm not bothering to take it up another step.
    > If anyone wants to steal or borrow it, please feel free. I would appreciate
    > it though if you make your improvements public.




    Isn't this a bit excessive? Wouldn't have just been easier to either
    install something like logoutd or configure PAM to limit her login
    time? Maybe I need to take a closer look at the script, but what
    happens say if she is on two hours and the script kicks over and then
    she decides to reboot the machine? Will the script remember this? Sir,
    I think you underestimate the power of a bored teenager.
    grocery_stocker, Mar 17, 2007
    #2
    1. Advertising

  3. Koos Pol

    Koos Pol Guest

    On zaterdag 17 maart 2007 16:40 grocery_stocker wrote:

    > Isn't this a bit excessive? Wouldn't have just been easier to either
    > install something like logoutd


    Too bad I haven't heard of that one when I initially was searching for
    someting suitable.

    > or configure PAM to limit her login
    > time?


    I never got to understand PAM really.

    > Maybe I need to take a closer look at the script, but what
    > happens say if she is on two hours and the script kicks over and then
    > she decides to reboot the machine? Will the script remember this?


    Yes. It writes to a personal timer file.

    > Sir,
    > I think you underestimate the power of a bored teenager.


    I know. I have one :)

    Koos
    --
    43rd Law of Computing: Anything that can go wr
    fortune: Segmentation violation -- Core dumped
    Koos Pol, Mar 17, 2007
    #3
  4. Koos Pol

    s. keeling Guest

    ["Followup-To:" header set to comp.os.linux.misc.]
    Koos Pol <>:
    > After unfruitful debates with my teenage daughter about not spending too
    > much time on her computer, I decided to take the more eh, pragmatic


    s/pragmatic/fascist/

    > approach. As I couldn't find any program that suites me, I've written a
    > small Perl script that you can launch from your Un*x boot scripts.
    > You can run it like
    >
    > login_quota -u mary -t 120 &
    >
    > This will make sure Mary does not spend more that her alloted 120
    > minutes.


    Why in the world would any parent do this to their kid? Because they
    can?

    > If anyone wants to steal or borrow it, please feel free. I would appreciate


    _Good_ _God_, _no_.

    Computers are many things, including mostly harmless fluff (myspace &
    youtube), babysitter (WWW), entertainment (WWW), crass commercialism
    (WWW), and educational (all of the above, perhaps excepting youtube).
    Why is it so annoying to you for your teenage daughter to spend more
    than an hour and a half doing that? Why do you consider it your right
    to interfere with that? Isn't that better than an hour and a half on
    a telephone babbling, "And I was like, ..."?

    I wonder how much time Linus T. spent each day on his machine when he
    was her age.

    You parents can be such jerks sometimes. Leave the kid alone.


    --
    Any technology distinguishable from magic is insufficiently advanced.
    (*) http://www.spots.ab.ca/~keeling Linux Counter #80292
    - - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
    Spammers! http://www.spots.ab.ca/~keeling/emails.html
    s. keeling, Mar 24, 2007
    #4
  5. Koos Pol

    s. keeling Guest

    ["Followup-To:" header set to comp.os.linux.misc.]
    Koos Pol <>:
    > On zaterdag 17 maart 2007 16:40 grocery_stocker wrote:
    > >
    > > Sir,
    > > I think you underestimate the power of a bored teenager.

    >
    > I know. I have one :)


    I sympathise with the bored teenager. I think her parent should get
    out more often.


    --
    Any technology distinguishable from magic is insufficiently advanced.
    (*) http://www.spots.ab.ca/~keeling Linux Counter #80292
    - - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
    Spammers! http://www.spots.ab.ca/~keeling/emails.html
    s. keeling, Mar 24, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bart Simpson
    Replies:
    1
    Views:
    412
    Werner Schiendl
    Oct 27, 2003
  2. Per
    Replies:
    4
    Views:
    312
    Stephen Prinster
    May 6, 2006
  3. Peter
    Replies:
    5
    Views:
    13,327
    Peter
    Jul 23, 2009
  4. Robert Stark

    A quota based lock

    Robert Stark, Aug 8, 2011, in forum: Java
    Replies:
    17
    Views:
    562
    Robert Klemme
    Aug 11, 2011
  5. 3legs

    File upload and quota problem

    3legs, Aug 23, 2004, in forum: ASP General
    Replies:
    1
    Views:
    95
    Steven Burn
    Aug 23, 2004
Loading...

Share This Page