Linux premium71.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
Server IP : 198.187.29.8 & Your IP : 3.133.145.211
Domains :
Cant Read [ /etc/named.conf ]
User : cleahvkv
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3.6 /
site-packages /
tuned /
ppd /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2025-03-13 10:42
config.py
2.33
KB
-rw-r--r--
2024-02-22 12:23
controller.py
6.94
KB
-rw-r--r--
2024-02-22 12:23
dbus.conf
747
B
-rw-r--r--
2024-02-22 12:23
ppd.conf
151
B
-rw-r--r--
2024-02-22 12:23
tuned-ppd.dbus.service
105
B
-rw-r--r--
2024-02-22 12:23
tuned-ppd.policy
992
B
-rw-r--r--
2024-02-22 12:23
tuned-ppd.service
300
B
-rw-r--r--
2024-02-22 12:23
Save
Rename
from tuned.utils.config_parser import ConfigParser, Error from tuned.exceptions import TunedException import os PPD_POWER_SAVER = "power-saver" PPD_PERFORMANCE = "performance" MAIN_SECTION = "main" PROFILES_SECTION = "profiles" DEFAULT_PROFILE_OPTION = "default" class PPDConfig: def __init__(self, config_file): self.load_from_file(config_file) @property def default_profile(self): return self._default_profile @property def ppd_to_tuned(self): return self._ppd_to_tuned @property def tuned_to_ppd(self): return self._tuned_to_ppd def load_from_file(self, config_file): cfg = ConfigParser() if not os.path.isfile(config_file): raise TunedException("Configuration file '%s' does not exist" % config_file) try: cfg.read(config_file) except Error: raise TunedException("Error parsing the configuration file '%s'" % config_file) if PROFILES_SECTION not in cfg: raise TunedException("Missing profiles section in the configuration file '%s'" % config_file) self._ppd_to_tuned = dict(cfg[PROFILES_SECTION]) if not all(isinstance(mapped_profile, str) for mapped_profile in self._ppd_to_tuned.values()): raise TunedException("Invalid profile mapping in the configuration file '%s'" % config_file) if len(set(self._ppd_to_tuned.values())) != len(self._ppd_to_tuned): raise TunedException("Duplicate profile mapping in the configuration file '%s'" % config_file) self._tuned_to_ppd = {v: k for k, v in self._ppd_to_tuned.items()} if PPD_POWER_SAVER not in self._ppd_to_tuned: raise TunedException("Missing power-saver profile in the configuration file '%s'" % config_file) if PPD_PERFORMANCE not in self._ppd_to_tuned: raise TunedException("Missing performance profile in the configuration file '%s'" % config_file) if MAIN_SECTION not in cfg or DEFAULT_PROFILE_OPTION not in cfg[MAIN_SECTION]: raise TunedException("Missing default profile in the configuration file '%s'" % config_file) self._default_profile = cfg[MAIN_SECTION][DEFAULT_PROFILE_OPTION] if self._default_profile not in self._ppd_to_tuned: raise TunedException("Unknown default profile '%s'" % self._default_profile)