A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Violet Duck, 13 Years ago, written in Python.
Embed
  1. # Copyright (c) 2012, Aha2Y
  2. # All rights reserved.
  3.  
  4.  
  5. import subprocess
  6. import supybot.utils as utils
  7. from supybot.commands import *
  8. import supybot.plugins as plugins
  9. import supybot.ircutils as ircutils
  10. import supybot.callbacks as callbacks
  11. from supybot.i18n import PluginInternationalization, internationalizeDocstring
  12.  
  13. _ = PluginInternationalization('Stats')
  14.  
  15. @internationalizeDocstring
  16. class Stats(callbacks.Plugin):
  17.     """Add the help for "@plugin help Stats" here
  18.    This should describe *how* to use this plugin."""
  19.     threaded = True
  20.  
  21.     def ram(self, irc, msg, args):
  22.         """tells you the ram of the current machine Supybot uses."""
  23.         p = subprocess.Popen(["free", "-o"], stdout=subprocess.PIPE)
  24.         out, err = p.communicate()
  25.         out = out.split()
  26.         total = float(out[7])/1024.0/1024.0
  27.         using = float(out[8])/1024.0/1024.0
  28.         free  = float(out[9])/1024.0/1024.0
  29.         msg = "Total: {1:4.1f} GB | Used:04 {2:4.1f} GB ({3:>6.2%}) | Free:03 {4:4.1f} GB ({5:>6.2%})"
  30.         used_red_length = int(round((using/total) * 10.0))
  31.         used_green_length = 10 - used_red_length
  32.         free_red_length = int(round((free/total) * 10.0))
  33.         free_green_length = 10 - free_red_length
  34.         bar1 = "[\0034%s%s\x0f]" % ("|" * used_red_length, " " * used_green_length)
  35.         bar2 = "[\0033%s%s\x0f]" % ("|" * free_red_length, " " * free_green_length)
  36.         irc.reply(msg.format("", total, using, using/total, free, free/total), prefixNick=False)
  37.         irc.reply("Used: %s Free: %s" % (bar1, bar2), prefixNick=False)
  38.     ram = wrap(ram)
  39.    
  40.     def swap(self, irc, msg, args):
  41.         """tells you the ram of the current machine Supybot uses."""
  42.         p = subprocess.Popen(["free", "-o"], stdout=subprocess.PIPE)
  43.         out, err = p.communicate()
  44.         out = out.split()
  45.         total = float(out[14])/1024.0/1024.0
  46.         using = float(out[15])/1024.0/1024.0
  47.         free = float(out[16])/1024.0/1024.0
  48.         msg = "Total: {1:4.1f} GB | Used:04 {2:4.1f} GB ({3:>6.2%}) | Free:03 {4:4.1f} GB ({5:>6.2%})"
  49.         used_red_length = int(round((using/total) * 10.0))
  50.         used_green_length = 10 - used_red_length
  51.         free_red_length = int(round((free/total) * 10.0))
  52.         free_green_length = 10 - free_red_length
  53.         bar1 = "[\0034%s%s\x0f]" % ("|" * used_red_length, " " * used_green_length)
  54.         bar2 = "[\0033%s%s\x0f]" % ("|" * free_green_length, " " * free_red_length)
  55.         irc.reply(msg.format("", total, using, using/total, free, free/total), prefixNick=False)
  56.         irc.reply("Used: %s Free: %s" % (bar1, bar2), prefixNick=False)
  57.     swap = wrap(swap)
  58.  
  59. Class = Stats
  60.  
  61.  
  62. # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
  63.