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.
Timer, a simple plugin that calculates the time between a "start time" and a "end time". Currently Timer has the ability to take a Time object or a timestamp for the start and end times and will calculate the time between these values in days, hours (and days in hours), minutes and seconds! There is also the option to force it to display 2 digits at all times when you are creating a 'non-words' timer, though would display for example "09:34:02" instead of "9:34:2". However, when you aren't forcing the two digits to be displayed you could create a string such as: "7 days, 5 hours, 11 minutes and 56 seconds remaining..".
The output it quite limited, but it also enables you to either extend the class to create your own custom outputs. You can of course choose not to create a whole new class to do this and just generate the strings inside of a specific helper/module, whatever you think is best!
t = Timer.new
t.start_time = Time.now
t.end_time = Time.parse('2010-01-01 00:00:00')
<%= "#{t.days} days, #{t.hours} hours, #{t.minutes} minutes, #{t.seconds} seconds" %>
313 days, 0 hours, 12 minutes, 29 seconds
t = Timer.new
t.start_time = Time.now
t.end_time = Time.parse('2010-01-01 00:00:00')
t.force_two_digits = true
<%= "#{t.days_in_hours}:#{t.minutes}:#{t.seconds}" %>
#Outputs (Hours:Minutes:Seconds) 7512:09:43
OR
<%= "#{t.hours}:#{t.minutes}:#{t.seconds} in #{t.days} days" %>
#Outputs (Hours:Minutes:Seconds) 00:06:51 in 313 days
Copyright (c) 2009 [Michael van Rooijen], released under the MIT license
FAQs
Unknown package
We found that meskyanichi-timer demonstrated a not healthy version release cadence and project activity because the last version was released 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.