Skip to content

Instantly share code, notes, and snippets.

View BugRoger's full-sized avatar
😎
Dealing with it

Michael Schmidt BugRoger

😎
Dealing with it
  • SAP SE
  • Berlin
View GitHub Profile
@BugRoger
BugRoger / ssh-background
Created January 21, 2011 16:02
Changes iTerm2's background color based on host configuration
#!/bin/bash
# Installation:
# 1. Save this script to /some/bin/ssh-background
# 2. chmod 755 /some/bin/ssh-background
# 3. alias ssh=/some/bin/ssh-background
# 4. Configure your host colors below.
set_color() {
local HEX_FG=$1
local HEX_BG=$2
@BugRoger
BugRoger / .vimrc
Created February 9, 2011 09:23
Michael's .vimrc
"setup pathogen
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on
compiler ruby
"gets rid of all the crap that Vim does to be vi compatible
set nocompatible
@BugRoger
BugRoger / .autotest
Created June 28, 2011 08:27
.autotest
require "autotest/growl"
require "autotest/fsevent"
require "autotest/bundler"
Autotest::Growl::image_dir = File.join(ENV['HOME'], '.autotest_images')
Autotest::Growl::show_modified_files = true
Autotest.add_hook :initialize do |autotest|
%w(.git .DS_Store db log tmp).each do |exception|
autotest.add_exception(exception)
@BugRoger
BugRoger / .irbrc
Created July 10, 2012 15:59
How to load global gems not defined in a Gemfile...
begin
# Blerg. Mess global gems into the load path. This doesn't work for all gems.
# But it's good enough for basic irb gems.
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
@BugRoger
BugRoger / gist:4213918
Created December 5, 2012 08:44
Nice Headline
font-family: "museo-sans-rounded-n5","museo-sans-rounded",sans-serif;
font-weight: 500;
font-size: 24px;
line-height: 1.1em;

ruby-1.9.3-p362 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p362 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@BugRoger
BugRoger / .vimrc-clipboard
Created March 3, 2013 19:34
Make console Vim play nice with iTerm2
set nocompatible
set clipboard=unnamed
if has('mouse')
set mouse=a
if exists('$ITERM_PROFILE')
autocmd VimEnter * set ttymouse=xterm2
autocmd FocusGained * set ttymouse=xterm2
autocmd BufEnter * set ttymouse=xterm2
endif
@BugRoger
BugRoger / service_gateway.conf
Created April 16, 2013 22:13
Service Gateway in nginx
upstream fire {
server localhost:8081;
}
upstream warehouse {
server localhost:8082;
}
upstream authority {
server localhost:8083;
@BugRoger
BugRoger / patch-edid.rb
Created May 5, 2013 10:57
Patch and Overwrite Display Settings. Let's Dell Monitors be recognized as RGB mode displays instead of TVs... -.-
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
puts edid_hex=data.match(/IODisplayEDID.*?<([a-z0-9]+)>/i)[1]
vendorid=data.match(/DisplayVendorID.*?([0-9]+)/i)[1].to_i
#!/bin/bash
rm -rf /var/log/nova/*.log
service mysql start
service rabbitmq-server start
cd /opt/stack/glance/bin
/opt/stack/glance/bin/glance-registry --config-file=/etc/glance/glance-registry.conf > /var/log/nova/glance-registry.log 2>&1 &