Skip to content

Instantly share code, notes, and snippets.

View ivar's full-sized avatar

Ivar Vasara ivar

  • Misc / Consultant
  • Vancouver
View GitHub Profile
task :check_deployment_branch, :except => {:no_release => true, :no_symlink => true} do
if rails_env == 'production'
CLI.ui.say "================================\nDeploying to PRODUCTION.\n================================\n\n"
# CLI.ui.say "Current production branch is set to: #{repository}"
set :branch, "master"
set :continue, Proc.new {CLI.ui.ask "Do you wish to continue? [yes/NO]"}
raise Error, "Failing production deploy" unless continue == 'yes' || continue == 'y'
else
CLI.ui.say "================================\nDeploying to #{deploy_type.upcase}.\n================================\n\n"
set :new_branch, Proc.new { CLI.ui.ask "Please pick your branch or press ENTER for #{branch}."}
@ivar
ivar / gist:663910
Created November 5, 2010 10:03
rvm errror when installing ree-1.8.7-2010.02
[2010-11-05 02:39:16] ./installer -a /Users/ivar/.rvm/rubies/ree-1.8.7-2010.02 --dont-install-useful-gems
./configure: line 4633: : command not found
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
configure: WARNING: Could not find the PC. Will not output failed addresses...
In file included from src/base/commandlineflags.h:55,
from src/tcmalloc.cc:114:
./src/base/basictypes.h: In constructor ‘AssignAttributeStartEnd::AssignAttributeStartEnd(const char*, char**, char**)’:
./src/base/basictypes.h:251: warning: ‘_dyld_present’ is deprecated (declared at /usr/include/mach-o/dyld.h:237)
./src/base/basictypes.h:251: warning: ‘_dyld_present’ is deprecated (declared at /usr/include/mach-o/dyld.h:237)
@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$