Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python3.6 /
site-packages /
salt /
executors /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
28
B
-rw-r--r--
2022-05-16 09:16
direct_call.py
185
B
-rw-r--r--
2022-05-16 09:16
docker.py
1.42
KB
-rw-r--r--
2022-05-16 09:16
splay.py
2.35
KB
-rw-r--r--
2022-05-16 09:16
sudo.py
1.81
KB
-rw-r--r--
2022-05-16 09:16
transactional_update.py
3.67
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" Splay function calls across targeted minions """ import logging import time import salt.utils.stringutils log = logging.getLogger(__name__) _DEFAULT_SPLAYTIME = 300 _HASH_SIZE = 8192 _HASH_VAL = None def __init__(opts): global _HASH_VAL _HASH_VAL = _get_hash() def _get_hash(): """ Jenkins One-At-A-Time Hash Function More Info: http://en.wikipedia.org/wiki/Jenkins_hash_function#one-at-a-time """ # Using bitmask to emulate rollover behavior of C unsigned 32 bit int bitmask = 0xFFFFFFFF h = 0 for i in bytearray(salt.utils.stringutils.to_bytes(__grains__["id"])): h = (h + i) & bitmask h = (h + (h << 10)) & bitmask h = (h ^ (h >> 6)) & bitmask h = (h + (h << 3)) & bitmask h = (h ^ (h >> 11)) & bitmask h = (h + (h << 15)) & bitmask return (h & (_HASH_SIZE - 1)) & bitmask def _calc_splay(splaytime): return int(splaytime * _HASH_VAL / float(_HASH_SIZE)) def execute(opts, data, func, args, kwargs): """ Splay a salt function call execution time across minions over a number of seconds (default: 300) .. note:: You *probably* want to use --async here and look up the job results later. If you're dead set on getting the output from the CLI command, then make sure to set the timeout (with the -t flag) to something greater than the splaytime (max splaytime + time to execute job). Otherwise, it's very likely that the cli will time out before the job returns. CLI Example: .. code-block:: bash # With default splaytime salt --async --module-executors='[splay, direct_call]' '*' pkg.install cowsay version=3.03-8.el6 .. code-block:: bash # With specified splaytime (5 minutes) and timeout with 10 second buffer salt -t 310 --module-executors='[splay, direct_call]' --executor-opts='{splaytime: 300}' '*' pkg.version cowsay """ if "executor_opts" in data and "splaytime" in data["executor_opts"]: splaytime = data["executor_opts"]["splaytime"] else: splaytime = opts.get("splaytime", _DEFAULT_SPLAYTIME) if splaytime <= 0: raise ValueError("splaytime must be a positive integer") fun_name = data.get("fun") my_delay = _calc_splay(splaytime) log.debug("Splay is sleeping %s secs on %s", my_delay, fun_name) time.sleep(my_delay) return None