View wol.rb
#!/usr/bin/ruby
# wol.rb: sends out a magic packet to wake up your PC
#
# Copyright (c) 2004 zunda <zunda at freeshell.org>
#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms of ruby itself ---
# Ruby Distribution License or GNU General Public License.
#
View keybase.md

Keybase proof

I hereby claim:

  • I am zunda on github.
  • I am zunda (https://keybase.io/zunda) on keybase.
  • I have a public key whose fingerprint is C31D 6E88 8EEB 6DAC EA88 1A8C 7BF7 154E 0B17 0373

To claim this, I am signing this object:

View gist:b64afa2d446b47377e92e7722d71f13f
$ rbenv install 2.4.0-dev
Cloning https://github.com/ruby/ruby.git...
Installing ruby-trunk...
BUILD FAILED (OS X 10.11.6 using ruby-build 20160426)
Inspect or clean up the working tree at /var/folders/b5/rsnrc9zj3b9c32qqt6z6py51cq36q1/T/ruby-build.20161008132243.93304
Results logged to /var/folders/b5/rsnrc9zj3b9c32qqt6z6py51cq36q1/T/ruby-build.20161008132243.93304.log
Last 10 log lines:
View scratch
on run
tell application "iTerm"
activate
make new terminal
tell the last terminal
make new session
tell the last session
activate
exec command "/Users/zunda/local/bin/vim-scratch"
end tell
View 51-kensington.conf
Section "InputClass"
Identifier "Trackball with Middle Button Emulation"
MatchProduct "Primax Kensington Eagle Trackball"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "Emulate3Buttons" "True"
EndSection
View gist:2240e996a35bb5feaa07
Fetching: gobject-introspection-3.0.7.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rabbit:
ERROR: Failed to build gem native extension.
/usr/local/opt/ruby/bin/ruby -r ./siteconf20151121-1191-56d1zb.rb extconf.rb
checking for --enable-debug-build option... no
checking for -Wall option to compiler... yes
checking for -Waggregate-return option to compiler... yes
checking for -Wcast-align option to compiler... yes
View each-cert.rb
#!/usr/bin/ruby
# ruby each-cert.rb 'openssl x509 -noout -text' input-file.crt
require 'open3'
class String
def certs
self.scan(/-----BEGIN CERTIFICATE-----.*?-----END CERTIFICATE-----/m)
end
end
View scratch.sh
#!/bin/sh
path=/tmp/scratch.`date +%H%M%S`.txt
xsel -o -p > $path
/usr/bin/vim -c 'set enc=utf8 fenc=utf8' $path
cat $path | xsel -i -b
cat $path | xsel -i -p
sleep 0.5
View count-repos.rb
#!/usr/bin/ruby
require 'open-uri'
require 'json'
module GitHubApi
User = 'zunda'
Header = {
'Authorization' => 'token <repoとread:orgのトークン>',
'Accept' => 'application/vnd.github.v3+json',
View pw.rb
#/usr/bin/ruby
class Integer
def stringify(chars, min_digits = nil)
if self < 0
raise ArgumentError, "Can not stringify negative numbers"
end
i = 0
d = chars.size
x = self