Skip to content

Instantly share code, notes, and snippets.

@jbbarth
jbbarth / shameful-bugfix.md
Created March 24, 2013 18:36
Riak CS Fast Track - Vagrant doesn't find "berkshelf/vagrant"

It might be because berkshelf is not installed with other Vagrant gems, which is my case since I use RVM to manage multiple ruby environments. The stacktrace looks like this:

% RIAK_CS_CREATE_ADMIN_USER=1 vagrant up
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- berkshelf/vagrant (LoadError)
  from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /Users/jbbarth/dev/riak-cs/vagrant-riak-cs-cluster/Vagrantfile:7:in `<top (required)>'
  [...]

I'm not sure I have a precise idea on how to fix that in a generic manner, but fortunately it can

@jbbarth
jbbarth / redmine_scn_hide_issues_1.png
Created April 15, 2013 11:26
Redmine SCN hide issues table
redmine_scn_hide_issues_1.png
@jbbarth
jbbarth / check_redmine_unassigned_tickets.sh
Created April 18, 2013 15:30
Check unassigned tickets in redmine
#!/bin/bash
set -e
key="cle-d-api-a-modifier"
url="https://url-complete-de-redmine.fr/"
tmpfile=/tmp/$(basename $0 | sed 's/.sh$/.txt/')
#for simplicity... sourcing the utils.sh file need to know its path
STATE_OK=0
STATE_WARNING=1
@jbbarth
jbbarth / less_mail_patch.rn
Created May 9, 2013 21:45
Less mail in redmine (has to be adapted)
require_dependency 'journal_observer'
class JournalObserver
def after_create(journal)
if !journal.notes.blank? || journal.details.detect{|d| d.prop_key == "priority_id" && d.value == 6}
Mailer.issue_edit(journal).deliver if Setting.notified_events.include?('issue_updated')
end
end
end
@jbbarth
jbbarth / import_from_csv.rake
Created May 9, 2013 23:31
Import redmine data from CSV
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@jbbarth
jbbarth / bundle_error
Created June 10, 2013 20:57
redmine_git_server with redmine 2.3.1
% bundle install
Fetching gem metadata from https://rubygems.org/.........Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "thor":
In Gemfile:
git_wit (~> 0.0.5) ruby depends on
thor (~> 0.17.0) ruby
jquery-rails (~> 2.0.2) ruby depends on
thor (0.18.1)
@jbbarth
jbbarth / heroku.log
Created June 26, 2013 14:01
Heroku deployment log
% git push heroku master
X11 forwarding request failed on channel 1
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 332 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.2
@jbbarth
jbbarth / index.html
Created June 30, 2013 23:26
Puppet docs, logstash style
<!DOCTYPE html>
<html>
<head>
<style>
body { background-color:#fcfcf5; font-family:monospace; font-size:16px; line-height:1.3em; color:#555; }
.container { width:800px; margin:0 auto; }
h1, h2, h3, h4 { color:#600060; }
pre { border:2px solid #e0e0e0; background-color:#f5f5f0; color:#666; line-height:1.5em;
margin:10px 0 10px 20px; padding:8px 12px; }
pre a { color:#800080; text-decoration:none; }
@jbbarth
jbbarth / commands.sh
Last active December 27, 2015 01:49
Fix nokogiri warnings about varying libxml2 versions and related deface defects on MacOSX
cd /path/to/your/project
#install libxml2 v2.8.0 instead of 2.9+ and libxslt 1.1.26 instead of 1.1.28
brew unlink libxml2
brew unlink libxslt
cd $(brew --prefix)
git checkout $(brew versions libxml2 | grep 2.8.0 | sed -e 's/.*checkout//')
git checkout $(brew versions libxslt | grep 1.1.26 | sed -e 's/.*checkout//')
brew install libxml2
brew install libxslt
@jbbarth
jbbarth / redmine-mirror.sh
Created November 20, 2013 14:20
Redmine github<->github sync
#!/bin/bash
# This script synchronizes "redmine/redmine" with "edavis10/redmine" which
# is the reference on github, itself kept in sync by Eric Davis thanks to
# git-svn magic against the subversion reference
set -e
cd $(dirname $0)
if ! test -d redmine; then
git clone --bare https://github.com/edavis10/redmine redmine
cd redmine