Skip to content

Instantly share code, notes, and snippets.

View meineerde's full-sized avatar

Holger Just meineerde

View GitHub Profile
@meineerde
meineerde / mysql_backup.sh
Created January 31, 2011 21:24
MySQL backup
#!/bin/bash
umask 022
# paranoia settings
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
TARGET="/backup/database"
@meineerde
meineerde / install_chef_server.sh
Created February 19, 2011 20:24
Bootstrapping of a Chef Server on Debian Squeeze
#!/bin/bash
aptitude -y install ruby1.8 rubygems1.8 ruby1.8-dev build-essential wget ssl-cert
gem install chef --no-ri --no-rdoc
mkdir -p /etc/chef
cat > /etc/chef/solo.rb <<EOF
file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
EOF
# chiliproject.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
actionmailer -v2.3.5
actionpack -v2.3.5
activerecord -v2.3.5
activeresource -v2.3.5
activesupport -v2.3.5
cgi_multipart_eof_fix -v2.5.0
daemons -v1.1.0
edavis10-object_daddy -v0.4.3
fastthread -v1.0.7
@meineerde
meineerde / configuration.yml
Created February 28, 2011 22:23
initializer.rb
foo_path: <%= RAILS_ROOT %>/tmp/foo
def initialize(*args)
super
@action = :my_default
end
#!/usr/bin/env python
import re
import sys
from BeautifulSoup import BeautifulStoneSoup, SoupStrainer
# Documentation is here:
# http://www.crummy.com/software/BeautifulSoup/documentation.html
@meineerde
meineerde / delete_all_repos.rb
Created April 15, 2011 21:09
Delete and recreate repositories for all projects in Redmine.
#!/path/to/redmine/script/runner
Repository.all.each(&:"destroy!")
@meineerde
meineerde / log-chiliproject-user.diff
Created April 18, 2011 16:30
Log ChiliProject user
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 10c7b65..04ab78b 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -65,26 +65,32 @@ class ApplicationController < ActionController::Base
def find_current_user
if session[:user_id]
# existing session
- (User.active.find(session[:user_id]) rescue nil)
+ user = (User.active.find(session[:user_id]) rescue nil)
@meineerde
meineerde / svn_vhost.conf
Created April 19, 2011 22:39
Apache SVN config for ChiliProject
PerlSwitches -T
PerlLoadModule Apache::Redmine
<VirtualHost *:80>
ServerName redmine.server
<Location /svn>
DAV svn
SVNParentPath "/path/to/svn-root"
DirectorySlash Off
@meineerde
meineerde / update_issues.rb
Created April 27, 2011 12:52
Update ChiliProject issues
issue = Issue.find(123)
user_who_performs_the_update = User.find(1)
# Initialize the journal entry
note = "I did some updates..." #can also be left blank, i.e. nil
issue.init_journal(user_who_performs_the_update, note)
# Update your stuff here
issue.ac_id = 123 # or whatever