Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am cwimmer on github.
  • I am cwimmer (https://keybase.io/cwimmer) on keybase.
  • I have a public key whose fingerprint is 6F51 9836 3C55 7971 7E97 0113 FF15 9AAD 74F0 E839

To claim this, I am signing this object:

@cwimmer
cwimmer / gist:04d292635026cb008d7d
Created March 16, 2015 22:27
Emulate log4j with Ruby Logger
#!/usr/bin/env ruby
require 'logger'
hostname = `hostname`.chop
file = File.open("/var/log/test-#{hostname}.log", File::WRONLY | File::APPEND | File::CREAT)
log = Logger.new(file)
log.level = Logger::INFO
log.formatter = proc do |severity, datetime, progname, msg|
"#{datetime.strftime('%Y-%m-%d %H:%M:%S,%3N')} #{severity} myproc: #{msg}\n"
end
log.info("Testing")
@cwimmer
cwimmer / ipmitool-fails-to-build
Created September 11, 2012 17:55
ipmitool fails to build
OUTPUT OF FAILED BUILD:
athos:~ cwimmer$ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install ipmitool
Warning: Using Clang, but this formula is reported to fail with Clang.
error: non-void functions should return a value
We are continuing anyway so if the build succeeds, please open a ticket with
the subject
ipmitool-1.8.11: builds with Clang-421-10.8
@cwimmer
cwimmer / perl-lwp-useragent-with-socks
Created February 3, 2012 19:36
Make LWP::UserAgent behave with SOCKS
cpanm LWP::UserAgent
cpanm LWP::Protocol::socks
use LWP::UserAgent;
$ua = new LWP::UserAgent();
$ua->proxy([qw(http https)] => 'socks://my.socks.proxy:1080');
. . .