
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Copies stdout (or any other IO stream) contents to a file or another stream. Works with subprocesses too.
# io-tee-demo.rb
require 'io/tee'
$stdout.tee('output.log')
puts "Hello, world!"
$stdout
is effectively copied into file output.log
while still being streamed as a standard output.
$ ruby io-tee-demo.rb
Hello, world!
$ cat output.log
Hello, world!
Obviously it works with more than one stream copied into the same file
# io-tee-demo.rb
require 'io/tee'
$stdout.tee('full-output.log')
$stderr.tee('full-output.log')
puts 'Hello, world'
$stderr.puts '[DEBUG] Debug info'
One can suppress stderr during execution but still get it logged into a file alongside stdout
$ ruby io-tee-demo.rb 2> /dev/null
Hello, world
$ cat full-output.log
Hello, world
[DEBUG] Debug info
A keyword argument of append: false
can be passed to the IO#tee
method in order to overwrite the given file upon start of writing.
Sponsored by Veeqo
FAQs
Unknown package
We found that io-tee 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
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.