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.
Deftimer is now alpha stage.
Throw me issues!
Python: >=3.6, <4
pip install pathlib
$ cd <parent dir of deftimer>
$ docker build -t deftimer .
$ docker run --rm deftimer
timer = Timer()
@timer.use_timer
def do_something():
...
do_something() # this prints the results
Timer(user='', description='')
timer = Timer()
@timer.use_timer
def something():
...
@timer.use_timer(detail=True)
decorator
This decorator allows the function to be inspected by a timer instance.
params
detail: It shows full results when detail is True.
timer.pause() & timer.resume()
You will sandwitch a process to omit the process from timer counting.
The process time occured between pause&resume will not be counted as a result.
@timer.use_timer
def something():
timer.pause()
time.sleep(5)
timer.resume()
The result will be 0 sec.
timer.block(name=None, exclude=True)
context managerparams
@timer.use_timer
def something():
with timer.block(name='sleep_2sec_1'):
time.sleep(2)
timer.stop()
@timer.use_timer
def something():
timer.stop()
# any process after stop() will be excluded from results.
Below is an example of full results.
-----------------------------------------
Result --> 4.0531158447265625e-06 s
Whole program ran in --> 4.0531158447265625e-06 s
Paused --> 0 s, 0times
Blocks --> 0 blocks: []
Paused + Blocked --> 0 s
-----------------------------------------
$ docker run --rm deftimer python -m unittest
Note: It might fail depending on your pc spec.
I always welcome your ideas!
Thanks for visiting my repo :)
"deftimer" is under MIT license
FAQs
A very simple Python tool for process inspection and timer. (alpha)
We found that deftimer 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.