Skip to content

Instantly share code, notes, and snippets.

View crohr's full-sized avatar
➡️
Checkout PullPreview.com and RunsOn.com

Cyril Rohr crohr

➡️
Checkout PullPreview.com and RunsOn.com
View GitHub Profile
@crohr
crohr / install-openproject-on-centos.md
Last active August 18, 2016 21:43
How to install OpenProject on CentOS 6.x

Install

# get package from https://packager.io
sudo rpm --import https://rpm.packager.io/key
echo "[openproject]
name=Repository for crohr/openproject application.
baseurl=https://rpm.packager.io/gh/crohr/openproject/centos6/packaging-rpm
enabled=1" | sudo tee /etc/yum.repos.d/openproject.repo
sudo yum install -y openproject
@crohr
crohr / gist:25fb820c76b5c1c603d2
Last active August 29, 2015 14:04 — forked from flomotlik/gist:6212725
curl vs wget

We have changed our check_url implementation from curl to wget for three reasons

  1. It gives us the ability to retry on connection refused. Compare the command we used previously with curl:
curl -sSfL --retry 3 URL

to the current one:

@crohr
crohr / mac-install.markdown
Last active August 29, 2015 14:04
What to install on a brand new Mac

Software, from the internet

@crohr
crohr / postgres-cheatsheet.md
Last active August 29, 2015 14:03
postgres cheatsheet

Give ownership rights on database to role:

echo 'ALTER DATABASE "voice-messaging-api" OWNER TO "voicemsg"' | sudo su - postgres -c psql

Give CREATEDB rights to role:

echo 'ALTER ROLE "voicemsg" CREATEDB' | sudo su - postgres -c psql
@crohr
crohr / install-openproject-plugins.md
Last active June 8, 2018 07:03
Install openproject plugins using the debian package

Let's say you wanted to install this plugin: https://github.com/finnlabs/openproject-meeting. Here is how you would do it with the openproject version packaged at https://pkgr.io/apps/tessi/openproject:

cat >> /opt/openproject/Gemfile.plugins <<EOF
gem "openproject-plugins", :git => "https://github.com/opf/openproject-plugins.git", :branch => "stable"
gem "openproject-meeting", :git => "https://github.com/finnlabs/openproject-meeting.git", :branch => "stable"
EOF
@crohr
crohr / gitlan-install-issue.md
Last active August 29, 2015 13:58
gitlab:setup does not let the system with a valid schema

As per http://doc.gitlab.com/ce/install/installation.html#initialize-database-and-activate-advanced-features, running rake gitlab:setup should setup the database. However, it only works if I'm following it with a rake db:migrate, otherwise I get an error when trying to run a simple User.all from the console:

root@ip-10-112-47-195:/home/admin# gitlabhq run rake gitlab:setup
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? yes

gitlabhq already exists
-- enable_extension("plpgsql")
@crohr
crohr / redmine-git-tags-not-found.md
Last active August 29, 2015 13:57
Redmine git tags not found

Trying to automatically package redmine (https://deb.pkgr.io/pkgr/redmine), but it seems like it can't find the closest tag:

~/dev/redmine(master) $ git describe HEAD
fatal: No tags can describe '1d71564d6f991ba3371ced249758a1a4c824b113'.
Try --always, or create some tags.

Though there are indeed tags:

@crohr
crohr / libyaml.sh
Created January 24, 2014 10:17
anvil-ruby-buildpack-precise
#!/bin/sh
# capture root dir
root=$(pwd)
# change into subdir of archive
cd $root/yaml-*
env CFLAGS=-fPIC ./configure --enable-static --disable-shared --prefix=/app/vendor
make
class Tunnel < Thor
method_options :environment => "development", :aliases => "-e", :desc => "Config environment"
desc "start", "Start an ssh tunnel"
def start
random_hi_port = rand(30000) + 30000
identity_part = tunnel['identity_file'] ? "-i #{tunnel['identity_file']}" : ""
ssh_part = "ssh -t #{identity_part} -g -R *:#{random_hi_port}:0.0.0.0:#{tunnel['local_port']} #{tunnel['username']}@#{tunnel['public_host']}"
require 'config/environment.rb'
class GlobalizeCountry < ActiveRecord::Base
end
class GlobalizeLanguage < ActiveRecord::Base
end
class GlobalizeTranslation < ActiveRecord::Base
belongs_to :language, :class_name => "GlobalizeLanguage"