Skip to content

Instantly share code, notes, and snippets.

View ivar's full-sized avatar

Ivar Vasara ivar

  • Misc / Consultant
  • Vancouver
View GitHub Profile
@ivar
ivar / install.sh
Created June 17, 2011 16:39 — forked from mrrooijen/install.sh
Ruby 1.9.2 c.load patch with RVM
#!/bin/sh
#install me via:
#curl https://raw.github.com/gist/1031770/8d8400cbca40faa18bccc29d2f4d4b66371f5d7f/install.sh | sh
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > /tmp/load.patch
rvm get head # always good to make sure you're up to date with RVM
rvm reload
rvm cleanup all
rvm install ruby-1.9.2-p180 --patch /tmp/load.patch -n patched
@ivar
ivar / load.patch
Created June 17, 2011 16:42 — forked from taf2/load.patch
Ruby 1.9.2-p180 require performance patch
--- a/load.c 2010-10-23 05:36:38.000000000 -0400
+++ b/patchload.c 2011-06-05 08:58:00.000000000 -0400
@@ -40,14 +40,6 @@
VALUE ary;
long i;
- for (i = 0; i < RARRAY_LEN(load_path); ++i) {
- VALUE str = rb_check_string_type(RARRAY_PTR(load_path)[i]);
- if (NIL_P(str) || !rb_is_absolute_path(RSTRING_PTR(str)))
- goto relative_path_found;
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
# autotest: --color --format Cucumber::Formatter::Timed --strict
# autotest-all: --color --format Cucumber::Formatter::Timed --strict
@ivar
ivar / nginx.error.log
Created November 3, 2011 22:17
weird rack / omniauth issue -
2011/11/03 15:03:07 [error] 51057#0: *324 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost,, request: "GET /auth/developer HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "localhost"
2011/11/03 15:03:07 [error] 51057#0: *326 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost,, request: "GET /auth/images/layout/background/error.png HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "localhost", referrer: "https://localhost/auth/developer"
2011/11/03 15:03:07 [error] 51057#0: *327 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost,, request: "GET /auth/images/layout/logo/project_logo.png HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "localhost", referrer: "https://localhost/auth/developer"
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
use OmniAuth::Builder do
Rails.logger.debug "In config.ru - initializating OmniAuth::Builder".colour(:red)
provider :developer
end
run SecretProject::Application
➜ ~ brew doctor
Your system is raring to brew.
➜ ~ cc --version
Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix
➜ ~ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@ivar
ivar / gist:3842196
Created October 5, 2012 20:30
stack smashing detected ! unicorn_rails(4.3.1) on ubuntu (12.04)
~/webapps/rewportal$ unicorn_rails
I, [2012-10-05T12:38:15.897478 #1432] INFO -- : listening on addr=0.0.0.0:8080 fd=5
I, [2012-10-05T12:38:15.897959 #1432] INFO -- : worker=0 spawning...
I, [2012-10-05T12:38:15.898757 #1432] INFO -- : master process ready
I, [2012-10-05T12:38:15.899551 #1446] INFO -- : worker=0 spawned pid=1446
I, [2012-10-05T12:38:15.899789 #1446] INFO -- : Refreshing Gem list
I, [2012-10-05T12:38:40.252669 #1446] INFO -- : worker=0 ready
*** stack smashing detected ***: unicorn_rails worker[0] -l0.0.0.0:8080 terminated
*** stack smashing detected ***: unicorn_rails worker[0] -l0.0.0.0:8080 terminated
@ivar
ivar / gist:3875900
Created October 11, 2012 22:20
wtf ?
rewdev@rewportal:/media/sf_rewportal/app/uploaders/development$ ls -la
ls: cannot access development_image_uploader.rb: No such file or directory
total 8
drwxrwx--- 1 root vboxsf 170 Oct 11 15:11 .
drwxrwx--- 1 root vboxsf 272 Oct 11 15:15 ..
-rwxrwx--- 1 root vboxsf 537 Oct 10 23:02 developer_logo_uploader.rb
?????????? ? ? ? ? ? development_image_uploader.rb
-rwxrwx--- 1 root vboxsf 850 Oct 11 13:41 floor_plan_uploader.rb
rewdev@rewportal:/media/sf_rewportal/app/uploaders/development$
@ivar
ivar / install log
Created November 28, 2012 18:05
brew vim breaks
==> Upgrading vim
==> Cloning https://vim.googlecode.com/hg/
Updating /Library/Caches/Homebrew/vim--hg
warning: vim.googlecode.com certificate with fingerprint 8b:0c:39:9b:22:04:51:9e:0c:1e:ac:83:3b:fe:4a:0a:a9:34:e6:b4 not verified (check hostfingerprints or web.cacerts config setting)
pulling from https://vim.googlecode.com/hg/
searching for changes
adding changesets
adding manifests
adding file changes
added 53 changesets with 136 changes to 79 files
; EditorConfig is awesome: http://EditorConfig.org
; top-most EditorConfig file
root = true
[*]
indent_style = tab
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true