Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
aptdaemon /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
worker
[ DIR ]
drwxr-xr-x
client.py
73.34
KB
-rw-r--r--
config.py
9
KB
-rw-r--r--
console.py
29.89
KB
-rw-r--r--
core.py
90.84
KB
-rw-r--r--
crash.py
2.74
KB
-rw-r--r--
debconf.py
6.24
KB
-rw-r--r--
enums.py
32.34
KB
-rw-r--r--
errors.py
7.29
KB
-rw-r--r--
gtk3widgets.py
47.25
KB
-rw-r--r--
__init__.py
1.14
KB
-rw-r--r--
lock.py
5.9
KB
-rw-r--r--
logger.py
2.3
KB
-rw-r--r--
loop.py
1.07
KB
-rw-r--r--
networking.py
9.7
KB
-rw-r--r--
policykit1.py
6.98
KB
-rw-r--r--
progress.py
33.4
KB
-rw-r--r--
utils.py
3.79
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : logger.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Logging facilities for aptdaemon """ # Copyright (C) 2013 Sebastian Heinlein <devel@glatzor.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. __author__ = "Sebastian Heinlein <devel@glatzor.de>" __all__ = ("ColoredFormatter") import logging import os # Define some foreground colors BLACK = 30 RED = 31 GREEN = 32 YELLOW = 33 BLUE = 34 MAGENTA = 35 CYAN = 36 WHITE = 37 # Terminal control sequences to format output RESET_SEQ = "\033[0m" COLOR_SEQ = "\033[1;%dm" BOLD_SEQ = "\033[1m" COLORS = { logging.WARN: YELLOW, logging.INFO: BLUE, logging.DEBUG: CYAN, logging.CRITICAL: RED, logging.ERROR: RED } class ColoredFormatter(logging.Formatter): """Adds some color to the log messages. http://stackoverflow.com/questions/384076/\ how-can-i-color-python-logging-output """ def __init__(self, fmt=None, datefmt=None, use_color=True): logging.Formatter.__init__(self, fmt, datefmt) if os.getenv("TERM") in ["xterm", "xterm-colored", "linux"]: self.use_color = use_color else: self.use_color = False def format(self, record): """Return the formated output string.""" if self.use_color and record.levelno in COLORS: record.levelname = (COLOR_SEQ % COLORS[record.levelno] + record.levelname + RESET_SEQ) record.name = COLOR_SEQ % GREEN + record.name + RESET_SEQ if record.levelno in [logging.CRITICAL, logging.ERROR]: record.msg = COLOR_SEQ % RED + record.msg + RESET_SEQ return logging.Formatter.format(self, record)
Close