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.
This is an add-on to the dino
gem. It adds support for the GPIO interface on Raspberry Pi single board computers. Unlike the main dino
gem, which connects a computer running Ruby to an external microcontroller, this requires only a Pi.
Dino::PiBoard
gives access to the Pi's own GPIO, and is a drop-in replacement for Dino::Board
, which would represent an external microcontroller.
Note: This is not for the Raspberry Pi Pico (W) / RPP2040. That microcontroller is covered by the main gem.
Note: This gem is very new. It WILL NOT work with the version of dino
(0.11.3) currently available on rubygems.org. Before installing dino-piboard
, make sure to install the latest dino version (future 0.13.0) from the master branch source.
Install dino from source:
sudo gem uninstall dino
git clone https://github.com/austinbv/dino.git
cd dino
gem build
sudo gem install dino-0.13.0.gem
Install the pigpo C library:
sudo apt-get install pigpio
Install this gem:
sudo gem install dino-piboard
Create a script, led_button.rb
:
require 'dino/piboard'
# Create a board instance for the Raspberry Pi.
board = Dino::PiBoard.new
# LED connected to GPIO4.
led = Dino::LED.new(board: board, pin: 4)
# Momentary button connected to GPIO17, using internal pullup.
button = Dino::DigitalIO::Button.new(board: board, pin: 17, pullup: true)
# Led on when button is down (0)
button.down do
puts "Button down"
led.on
end
# Led is off when button is up (1)
button.up do
puts "Button up"
led.off
end
# Sleep main thread. Ctrl+C to quit.
sleep
Run the script as root (pigpio can only be used as root):
sudo ruby led_button.rb
See examples
in the main gem for more. Remove any Dino::Board::Connection
and Dino::Board
objects that the script sets up, and do board = Dino::PiBoard.new
instead. Not all features are implemented yet though, nor can be implemented. See Feautres below.
This gem uses the pigpio_ffi
gem, which in turn uses ffi
to map the functions of the pigpio
C library. pigpio
provides low-level access to the Raspberry Pi's GPIO interface.
Building on that, Dino::PiBoard
plugs in as a (mostly) seamless replacement for Dino::Board
. This allows dino
features and component classes to be used directly on a Raspberry Pi, without an external microcontroller.
rubyserial
instance. Use that directly instead.FAQs
Unknown package
We found that dino-piboard 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.
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.