
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
github.com/meinside/scrollphat-go
Go library for controlling Pimoroni's Scroll pHat.
Most of the codes were inspired by scroll-phat and Dave Cheney's i2c.
$ go get -u github.com/meinside/scrollphat-go
You need to enable I2C first:
$ sudo raspi-config
Also, your account should be in 'i2c' group:
$ sudo usermod -G i2c USERNAME
// sample.go - sample application for Scroll pHat, 2016.01.07.
package main
import (
"time"
scroll "github.com/meinside/scrollphat-go"
)
func main() {
//scroll.TrimRedundantSpaces = false // don't trim redundant spaces
if phat := scroll.New(); phat != nil {
// set brightneess
phat.SetBrightness(5)
time.Sleep(1 * time.Second)
// turn on all LEDs
phat.Fill()
time.Sleep(1 * time.Second)
// turn off all LEDs
phat.Clear()
time.Sleep(1 * time.Second)
// draw a string (not scrolling)
phat.DrawBytes(scroll.BytesForString(":-)"))
time.Sleep(1 * time.Second)
// draw a string (scrolling)
phat.Scroll(" 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz `~!@#$%^&*()-=_+[]{};:\"'<>,.?/\\|", 50)
time.Sleep(1 * time.Second)
// draw points (heart-shaped...)
phat.DrawBytes(scroll.ArraysToBytes([][]uint8{
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}))
time.Sleep(1 * time.Second)
// invert LEDs
phat.Invert()
time.Sleep(1 * time.Second)
// turn off all LEDs
phat.Clear()
phat.Close()
} else {
panic("could not initialize ScrollPHat")
}
}
Compile it and run like this:
$ go build sample.go
$ ./sample
Then you'll see:
MIT
FAQs
Unknown package
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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.