Skip to content

Instantly share code, notes, and snippets.

require 'open3'
class RunningMan
def initialize(*cmd)
@cmd = cmd
end
attr_reader :status, :output, :error
def run
input, output, err = Open3.popen3(*@cmd)
#!/usr/bin/env ruby
#
# This program encrypts and decrypts messages at the command line.
# It runs setuid root, so that it can be used by users without giving
# them access to the (root-owned) secret encryption key.
require 'openssl'
SECRET_KEY="/etc/secrypt.key"
OUTPUT_FILE="/tmp/secrypt.out"
@emerose
emerose / keyscan.rb
Created February 11, 2011 23:25
scan an authorized_keys file and print key fingerprints
#!/usr/bin/env ruby
require 'tempfile'
KEYGEN = "/usr/bin/ssh-keygen"
KEYSFILE = "authorized_keys"
keys = []
File.open(KEYSFILE).each_line do |l|
next if (l =~ /\A\s*\Z/) # blank line
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICqdotjoqQesY9TuSLKBak7pmT83yxcfKTmzun/DalZv [email protected]