Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
fit_kit
is a small ruby gem wraps Rust's crate fitparse-rs to provide effecient and fast Garmin fit files parsing.
Install the gem and add to the application's Gemfile by executing:
$ bundle add fit_kit
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install fit_kit
test_fit_file = File.join(Dir.pwd, "example.fit")
fit_data_records = ::FitKit.parse_fit_file(test_fit_file)
# { record: [{...}, {...}], session: [{...}], lap: [..], activity: [...] }
Here is the performance parsing 4090 fit files on my M1 Mac Mini (16G, 8 Cores) took 6 seconds (in parallel):
❯ ruby app.rb
Parsing 4090 fit files...
user system total real
0.129862 0.102642 45.192900 ( 6.121117)
Code to parse a given folder (contains 4090 fit files) in parallel:
require 'fit_kit'
require 'benchmark'
require 'parallel'
def parse_concurrently
puts "Parsing all fit files here"
fit_files = Dir.glob("/Users/mikeli/docs/HealthFit/*.{fit,FIT}")
puts "Parsing #{fit_files.size} fit files..."
# Determine the number of processors
num_processors = Parallel.processor_count
# Parse files concurrently
Parallel.each(fit_files, in_processes: num_processors) do |file|
begin
FitKit.parse_fit_file(file)
rescue => e
puts "Error parsing #{file}: #{e.message}"
end
end
end
Benchmark.bm do |x|
x.report do
parse_concurrently
end
end
Bug reports and pull requests are welcome on GitHub at https://github.com/29decibel/fit_kit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the FitKit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that fit_kit 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.