
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Python wrapper for obtaining the current frequency of the Swedish national power grid
Python wrapper for obtaining the current frequency of the Swedish national power grid
https://www.svk.se/drift-av-stamnatet/kontrollrummet/ (Swedish National Grid - Inspiration to this project) http://driftsdata.statnett.no/restapi/ (Norwegian National Grid - data provider)
This program only has one dependency; the requests
module. The dependency can be be installed with pip
using
pip install -r requirements.txt
Below are a few snippets of example usage. For more thorough usage, please see the source code.
pollGridFrequency()
Polls every 0.5s [default], only printing result [default]. Calls callback only if value changed [default]
pollGridFrequency(my_callback, 0.1)
Polls with custom callback function my_callback
taking ONE argument (frequency). I.e. my_callback(freq) is called. Custom refresh rate.
pollGridFrequency(None, 2, False)
No callback (prints values only), polling every 2s and returning values regardless of whether they have changed.
print("This is freq: " + str(getCurrentFrequency()[1]))
Single-capture frequency.
The data obtained in the continous polling is passed to a provided callback. The format of the callback is as follows
def my_callback(frequency):
desired_freq = 50
print("We differ by {} Hertz".format((desired_freq - frequency))
FAQs
Python wrapper for obtaining the current frequency of the Swedish national power grid
We found that gridfrequency 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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.