Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A tool kit of progress bars and console logs with rich output, also has a bunch of useful functions used in work.
'tykit--Tell You kit', pronounced like 'ticket', is a toolkit to monitor your scripts' status easily, which has rich and pretty output for progress bar and console logs. The tykit may support more decent output in the future
tykit can be easily installed with pip
as below
# for python2
pip install tykit
# for python3
pip3 install tykit
for loop,range,multi-threading and multi-threading with multi-params
pb_range(*args)
This function is just like the python builtin function range()
from tykit import pb_range
from time import sleep
# use pb_range just like range()
for i in pb_range(50):
sleep(0.001)
# or use it as a generator, with some iterabel_files
from tykit import pb_iter
some_task = lambda x: x*x
iterable_file = [x for x in range(100)]
for i in pb_iter(iterable_file):
some_task(i)
pb_multi_thread(workers:int,task,iter_files)
This function intergrates the multi-threading with ProgressBar
, which could show the master task's progress in a multi-threading script. The param: workers
defined the max-worker of the multi-threading.
from tykit import pb_multi_thread as pbmt
# Firstly, define your task func
task_func = lambda x: x*x*x
# Put your jobs in a iterable data structure
jobs = [x for x in range(1000)]
# run multi-threading with pb(ProgressBar)
# and save the result in a list
max_workers = 20
result = pbmt(max_workers,task_func,jobs)
print(result[10])
pb_multi_thread_partial(workers:int,task,iter_files,**kwargs)
This function is a higher api of pb_multi_thread()
, which is suitable for the multi-threading tasks with more than one parameters.
from tykit import pb_multi_thread_partial as pbmtp
# define a task func with multi params
def task(x,a,b,c):
return x+a+b+c
# Put your jobs in a iterable data structure
jobs = [x for x in range(1000)]
# run multi-threading with partial
max_workers = 20
result = pbmtp(max_workers,task,jobs,a=10,b=100,c=-20)
print(result[:10])
rlog is a module for log printing with rich. It has some functions to print pretty logs and hints. The usage is simple and neat. The samples are shown below👇(for more details, you can find in usage_of_rlog.py in examples)
FAQs
A tool kit of progress bars and console logs with rich output, also has a bunch of useful functions used in work.
We found that tykit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.