Skip to content

Instantly share code, notes, and snippets.

View argent-smith's full-sized avatar
🐪
OCaml & Coq while not @ work

Pavel Argentov argent-smith

🐪
OCaml & Coq while not @ work
View GitHub Profile
@argent-smith
argent-smith / directory_issue.feature
Created September 27, 2011 20:24
Thor #directory issue
Feature: Suspected #directory issue
In order to test #directory behavior
As a Thor user
I want to see whether it expands 'templated' filenames or not
NB: this feature should be run with cucumber/aruba
Background: making the test suite
Given a file named "tester" with:
"""
@argent-smith
argent-smith / fail.txt
Created September 9, 2011 06:48
rcov build failure on rbx-head
rbx-head [paul@paul rsh]$ bundle update
Fetching source index for http://rubygems.org/
Using rake (0.9.2)
Using ZenTest (4.6.2)
Using bundler (1.0.17)
Using diff-lcs (1.1.3)
Using git (1.2.5)
Using jeweler (1.6.4)
Installing rcov (0.9.10) with native extensions An exception occurred running /home/paul/.rvm/gems/rbx-head/bin/bundle
ERROR: Failed to build gem native extension.
@argent-smith
argent-smith / stopwatch.rb
Created August 25, 2011 14:35
Externap program execution stopwatch
#!/usr/bin/env ruby
EXTERNAL=ARGV.join " "
puts "Running #{EXTERNAL}"
t1 = Time.now
system EXTERNAL
t2 = Time.now
@argent-smith
argent-smith / libmap.conf
Created August 23, 2011 17:42
`kse_create() failed` fix (when upgrading FreeBSD < 8.0 to 8.x)
libpthread.so.1 libthr.so.1
libpthread.so.2 libthr.so.2
libkse.so.3 libthr.so.3
@argent-smith
argent-smith / how-to.markdown
Created August 17, 2011 10:21
ruby 1.9.2 installation WITH ICONV under rvm and FreeBSD

Ruby 1.9.2 RVM w/iconv FreeBSD installation HOWTO

The Problem

Recently, trying to run some of my crutches (the Ruby thingies I use to help me sysadmining) under RVM, I've found that require 'iconv' doesn't work. Since I knew it's working in standard lang/ruby18 and lang/ruby19 ports I started to search where is the trap and have found that. Here's how.

Prerequisites

  • rvm installed
  • system ruby installed
@argent-smith
argent-smith / thin-win.markdown
Created June 11, 2011 05:36
thin installation on 1.9.2/mingw32 (uname => Vista) :)))

How to Avoid an Hour of Trouble Installing Thin on Win

  1. Install RubyInstaller's 1.9.2
  2. Install devkit (https://github.com/oneclick/rubyinstaller/wiki/Development-Kit)
  3. gem install win32-events --platform=ruby (not actually necessary but this pulls up some useful libs for further dev process)
  4. gem install eventmachine --pre --platform=ruby
  5. gem install thin --platform=ruby
@argent-smith
argent-smith / fail.txt
Created June 9, 2011 09:35
new spec fails following #982
bin/mspec ci --background --agent
rubinius 1.2.4dev (1.8.7 842e37c4 yyyy-mm-dd JI) [i386-unknown-freebsd8.2]
............................................................................................................................................
1)
An exception occurred during: after :each
Socket::IPSocket#peeraddr returns an IP instead of hostname if do_not_reverse_lookup is true ERROR
Errno::ECONNRESET: Connection reset by peer
IO(TCPSocket)#close at kernel/common/io.rb:1766
{ } in Object#__script__ at spec/ruby/library/socket/ipsocket
/peeraddr_spec.rb:16
@argent-smith
argent-smith / gist:1014283
Created June 8, 2011 11:53
rubinus tests failed on FreeBSD
We couldn’t find that file to show.
@argent-smith
argent-smith / xmlto.md
Created May 10, 2011 08:29
Getting rid of the mystic FreeBSD 'xmlto bug'

Often in the last year I (and other experienced FreeBSD users) face the same problem: "Error loading external entity" messages and thus, the compilation failure.

I've found several ways to fix it and the likes:

  • You should open /usr/local/bin/xmlto script and comment out the following line:

    XSLTOPTS="$XSLTOPTS --nonet"
    

The fix works only if you've got a live Internet connection. The best way probably is to fix local dtd catalogue layout for docbook* things but I still don't know how; advise needed!

@argent-smith
argent-smith / bug'o'feature_1.md
Created April 14, 2011 17:06
What happened to a file descriptor and how to cure it

Yesterday I've encountered a sudden bug: my four years old script rafused to work. After a slight rewrite I got some kind of descriptive symptom in the syslog:

Fatal: Bad file descriptor 
/usr/local/lib/ruby/gems/1.8/gems/deprecated-2.0.1/lib/deprecated.rb:199:in `write'
/usr/local/lib/ruby/gems/1.8/gems/deprecated-2.0.1/lib/deprecated.rb:199     
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'  
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' 
/usr/local/lib/ruby/site_ruby/1.8/dbi.rb:48 
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' 
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' /usr/work/flow-tools/flow-pg_import:13