Skip to content

Instantly share code, notes, and snippets.

ALLES ALS ROOT:
---------------
apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev libxslt-dev libxml2-dev lynx telnet subversion
mkdir -p /opt/local/ruby/sources
mkdir -p /opt/local/ruby/runtimes
cd /opt/local/ruby/sources
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.7-p174.tar.bz2
tar xzf ruby-1.8.7-p174.tar.bz2
if RUBY_VERSION < "1.8.7"
require 'enumerator'
module Enumerable
alias_method :original_each_slice, :each_slice
def each_slice(count, &block)
if block_given?
# call original method when used with block
original_each_slice(count, &block)
else
# no block -> emulate
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
puts "looking for the gems to upgrade..."
gem_info = Struct.new(:name, :version)
to_reinstall = []
Dir.glob('/opt/local/ruby/runtimes/ruby-1.8.7-p174/lib/ruby/gems/**/*.bundle').map do |path|
path =~ /.*1.8\/gems\/(.*)-(.*?)\/.*/
name, version = $1, $2
bundle_info = `file path`
to_reinstall << gem_info.new(name, version) unless bundle_info =~ /bundle x86_64/
end
#!/bin/bash
echo -e "${COLOR_NC}COLOR_NC (No color)"
echo -e "${COLOR_WHITE}COLOR_WHITE\t${COLOR_BLACK}COLOR_BLACK"
echo -e "${COLOR_BLUE}COLOR_BLUE\t${COLOR_LIGHT_BLUE}COLOR_LIGHT_BLUE"
echo -e "${COLOR_GREEN}COLOR_GREEN\t${COLOR_LIGHT_GREEN}COLOR_LIGHT_GREEN"
echo -e "${COLOR_CYAN}COLOR_CYAN\t${COLOR_LIGHT_CYAN}COLOR_LIGHT_CYAN"
echo -e "${COLOR_RED}COLOR_RED\t${COLOR_LIGHT_RED}COLOR_LIGHT_RED"
echo -e "${COLOR_PURPLE}COLOR_PURPLE\t${COLOR_LIGHT_PURPLE}COLOR_LIGHT_PURPLE"
echo -e "${COLOR_BROWN}COLOR_BROWN\t${COLOR_YELLOW}COLOR_YELLOW"
echo -e "${COLOR_GRAY}COLOR_GRAY\t${COLOR_LIGHT_GRAY}COLOR_LIGHT_GRAY\n"
#!/bin/bash
#
# Simple colorize for bash by means of sed
#
# Copyright 2008 by Andreas Schamanek <[email protected]>
# GPL licensed (see end of file) * Use at your own risk!
#
# Usage examples:
# tail -f somemaillog | mycolorize white '^From: .*' bell
# tail -f somemaillog | mycolorize white '^From: \/.*' green 'Folder: .*'
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@thenoseman
thenoseman / config for metric_fu
Created November 29, 2009 20:59
metric_fu configuration
sudo gem install rmagick topfunky-gruff
MetricFu::Configuration.run do |config|
config.metrics = [:saikuro, :stats, :flog, :flay, :reek, :roodi]
config.saikuro = { :output_directory => 'tmp/metric_fu/scratch/saikuro',
:input_directory => ['app', 'lib'],
:cyclo => "",
:filter_cyclo => "0",
:warn_cyclo => "5",
:error_cyclo => "7" }
@thenoseman
thenoseman / batch_resolve_hoptoad_errors.rb
Created June 10, 2010 10:04
Batch resolve hoptoad errors
#!/Users/fschumac/.rvm/rubies/ree-1.8.7-2010.02/bin/ruby
require 'rubygems'
require 'active_resource'
require 'rest_client'
AUTH = "AUTH TOKEN ID"
APP = "NAME OF APP"
class Hoptoad < ActiveResource::Base
self.site = "http://#{APP}.airbrake.io"
diff -rupN capistrano-2.5.18-unpatched/lib/capistrano/command.rb capistrano-2.5.18/lib/capistrano/command.rb
--- capistrano-2.5.18-unpatched/lib/capistrano/command.rb 2010-06-08 10:30:11.000000000 +0200
+++ capistrano-2.5.18/lib/capistrano/command.rb 2010-05-21 10:34:31.000000000 +0200
@@ -191,7 +191,7 @@ module Capistrano
end
def open_channels
- sessions.map do |session|
+ sessions.compact.map do |session|
server = session.xserver