Results 1 to 5 of 5

Thread: Kernel checking utility

  1. #1
    Guest

    Kernel checking utility

    This will check the current kernel status. Enjoy.

    Code:
    #!/usr/bin/env python
    
    import telnetlib
    
    connexion = telnetlib.Telnet("kernel.org", 79)
    connexion.write("\n")
    
    print " "
    print connexion.read_all()

  2. #2

    Re: Kernel checking utility

    good script, would be nice to put into rc.local .. just for fun ;D

  3. #3
    Guest

    Re: Kernel checking utility

    Here's something pretty complicated to do something simple:
    Code:
    import string
    a = string.join(map(lambda x: chr(x), range(ord('a'), ord('z')+1)),"")
    It's the equivalent of:
    Code:
    a = 'abcdefghijklmnopqrstuvwxyz'
    But you gotta admit it's pretty leet!


    And for those of you who like Sexylosers and Penny-Arcade, here's a script to check whether there's a new strip or not:

    Code:
    #!/usr/bin/env python
    
    import httplib
    import time
    import sys
    import string
    import os
    
    
    def pennyarcade():
     *year = time.strftime("%Y")
     *today = time.strftime("%Y%m%d") + "l.gif"
     *strip = "/images/" + year + "/" + today
    
     *h = httplib.HTTPConnection("www.penny-arcade.com", 80)
     *h.request("GET", strip)
     *response = h.getresponse()
     *h.close()
    
     *if response.status == 200:
     * *print "THERE'S A NEW Penny-Arcade!!"
     *else:
     * *print "No new Penny-Arcade... :-("
    
     *config = os.environ["HOME"] + "/.sexylosers"
    
    
    def sexylosers():
     *config = os.environ["HOME"] + "/.sexylosers"
    
     *try:
     * *f = open(config, "r")
     *except IOError:
     * *print "Config file not found!"
     * *print "Create it with the following command: echo 134 > ~/.sexylosers"
     * *sys.exit(1)
    
     *current_strip = f.readline()
     *current_strip = string.join(current_strip.splitlines())
     *f.close()
    
     *next_strip = int(current_strip)
     *next_strip += 1
     *next_strip = str(next_strip)
    
    
     *h = httplib.HTTPConnection("sexylosers.com", 80)
     *h.request("GET", "/?%s" % next_strip)
     *response = h.getresponse()
     *out = response.read()
     *h.close()
    
     *if out != "ERROR! Don't play with the URL, please.\n":
     * *print "THERE'S A NEW SEXYLOSER!!! *Episode %s is out!" % next_strip
     * *f = open(config, "w")
     * *f.writelines(next_strip + "\n")
     * *f.close()
     *else:
     * *print "No new sexylosers... :-("
     * *f = open(config, "w")
     * *f.writelines(current_strip + "\n")
     * *f.close()
    
    
    
    pennyarcade()
    sexylosers()

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    419

    Re: Kernel checking utility

    GnuVince: Is there a way I can display the current stable kernel on my website using PHP?

  5. #5
    Guest

    Re: Kernel checking utility

    I don't know PHP.

Similar Threads

  1. What this utility is for?
    By Meek in forum Windows - General Topics
    Replies: 3
    Last Post: 01-12-2007, 03:25 PM
  2. Safe to Delete Dell Utility Partition
    By cheetahman in forum Linux - General Topics
    Replies: 4
    Last Post: 10-17-2006, 11:47 PM
  3. Linux and Unix recommended partition utility
    By zillah in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 11-28-2005, 01:35 PM
  4. Need Utility Program
    By GhostDawg in forum Linux - Software, Applications & Programming
    Replies: 8
    Last Post: 10-14-2004, 09:01 PM
  5. KDE Installation Utility
    By in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 07-15-2002, 04:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •