Skip to content

Instantly share code, notes, and snippets.

View bookshelfdave's full-sized avatar

Dave Parfitt bookshelfdave

  • Buffalo NY
View GitHub Profile
public IRubyObject stat(ThreadContext context) {
openFile.checkClosed(context.getRuntime());
try {
if(this.popenSpecial == true) {
/*
This seems to work in OSX, but not Windows. I'm not sure how the impl of
file descriptors differs in Win32. Any ideas?
*/
int fd = (int)this.fileno(context).getLongValue();
// ends up calling POSIX.fstat(int)
@bookshelfdave
bookshelfdave / mirrormanager install
Created January 25, 2012 20:45
Installing MirrorManager
sudo yum install zlib-devel.i686
wget http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz
tar xvzf Python-2.4.6.tgz
cd Python-2.4.6
./configure --with-zlib=/usr/include
make
sudo make install
virtualenv -p /usr/local/bin/python2.4 --no-site-packages ~/virtualenv/mm
@bookshelfdave
bookshelfdave / gist:1717967
Created February 1, 2012 16:47
Error building Mongrel2 manual
dparfitt@brawl:~/src/mongrel2$ make manual
dexy
batch id is 5
sorting 104 documents into run order, there are 1023 total dependencies
ratio of dependencies to documents is 9.8
running Output
running LongOutput
running Run
running Source
source files saved in logs/batch-source-00005
require 'parslet'
class Butter < Parslet::Parser
rule(:op_equals) { str('=') >> space? }
rule(:let) { str("let") >> space? }
rule(:space) { match('\s').repeat(1) }
rule(:space?) { space.maybe }
@bookshelfdave
bookshelfdave / gist:1847649
Created February 16, 2012 20:35
Whalesong changes
(define watch
(lambda (watch-file (lastmod 0))
(let
([currentmod (file-or-directory-modify-seconds watch-file)])
(begin
(if (not (equal? lastmod currentmod))
(begin
(print "Compiling file\n")
(sleep 1)
(watch watch-file (file-or-directory-modify-seconds watch-file)))
@bookshelfdave
bookshelfdave / gist:2919248
Created June 12, 2012 18:32
Diff to get erlang_js to build on FreeBSD 9 i386 w/ gmake
diff --git a/package/freebsd/Makefile b/package/freebsd/Makefile
index 652d199..f31687f 100644
--- a/package/freebsd/Makefile
+++ b/package/freebsd/Makefile
@@ -57,6 +57,7 @@ buildrel: $(BUILD_RIAK_PATH)
sed -e "s/^RIAK_VERSION.*$$/RIAK_VERSION=\"${VERSIONSTRING}\"/" < \
$(BUILD_RIAK_PATH)/rel/files/riak.tmp > $(BUILD_RIAK_PATH)/rel/files/riak
cp -f $(PKGERDIR)/vars.config $(BUILD_RIAK_PATH)/rel/vars.config
+ sed -I .old s/make/gmake/ $(BUILD_RIAK_PATH)/deps/erlang_js/rebar.config
$(MAKE) -C $(BUILD_RIAK_PATH) deps rel
@bookshelfdave
bookshelfdave / gist:2996683
Created June 26, 2012 16:00
Ranch ranch_conns_sup children
get_child_pids() ->
[Pid2 ||
{{ranch_listener_sup, _}, Pid, _Type, _Modules} <- supervisor:which_children(ranch_sup), is_pid(Pid),
{ranch_conns_sup,Pid1,_,_} <- supervisor:which_children(Pid),
{_,Pid2,_,_} <- supervisor:which_children(Pid1)].
@bookshelfdave
bookshelfdave / gist:3137278
Created July 18, 2012 16:23
D Curl compile error
OSX 10.7.4
[3]R15B01:prime:~/src/kerl2$ uname -a
Darwin prime.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
[3]R15B01:prime:~/src/kerl2$ dmd
DMD64 D Compiler v2.059
Copyright (c) 1999-2012 by Digital Mars written by Walter Bright
Documentation: http://www.dlang.org/index.html
git clone git@github.com:basho/riak_pb.git
cd src
rm -f *.proto
rm -f *.piqi
rm -f *.cm*
cp ../riak_pb/src/*.proto ./
piqi of-proto riak.proto
piqi of-proto riak_kv.proto
@bookshelfdave
bookshelfdave / gist:3277563
Created August 6, 2012 18:59
dip_1.2 Dialyzer warnings
[1]R15B01:[dip_1.2]prime:~/basho/riak-erlang-client$ dialyzer -Wno_return --plt ~/.riak_combo_dialyzer_plt ebin | fgrep -v -f ./dialyzer.ignore-warnings
Checking whether the PLT /Users/dparfitt/.riak_combo_dialyzer_plt is up-to-date... no
Rebuilding the information in /Users/dparfitt/.riak_combo_dialyzer_plt...
Unknown functions:
riak_pb_codec:decode/2
riak_pb_codec:decode_pair/1
riak_pb_codec:encode/1
riak_pb_kv_codec:decode_bucket_props/1
riak_pb_kv_codec:decode_contents/1
riak_pb_kv_codec:encode_bucket_props/1