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 / ceph-osd.service
Created March 1, 2015 11:07
ceph-osd.service
[Unit]
Description=Ceph OSD
After=docker.service
After=ceph-mon.service
RequiresMountsFor=/var/lib/ceph/osd
[Service]
EnvironmentFile=/etc/environment
Environment=HOSTNAME=%H
ExecStartPre=/usr/bin/docker run --rm -v /opt/bin:/opt/bin ibuildthecloud/systemd-docker
@BugRoger
BugRoger / gist:af71c9531e17bbc7f147
Created February 27, 2015 07:54
Ceph Mon Orchestration
#!/bin/bash
if [ ! -n "$MON_NAME" ]; then
echo "ERROR- MON_NAME must be defined as the name of the monitor"
exit 1
fi
if [ ! -n "$MON_IP" ]; then
echo "ERROR- MON_IP must be defined as the IP address of the monitor"
exit 1
#cloud-config
users:
- name: core
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvFapuevZeHFpFn438XMjvEQYd0wt7+tzUdAkMiSd007Tx1h79Xm9ZziDDUe4W6meinVOq93MAS/ER27hoVWGo2H/vn/Cz5M8xr2j5rQODnrF3RmfrJTbZAWaDN0JTq2lFjmCHhZJNhr+VQP1uw4z2ofMBP6MLybnLmm9ukzxFYZqCCyfEEUTCMA9SWywtTpGQp8VLM4INCxzBSCuyt3SO6PBvJSo4HoKg/sLvmRwpCVZth48PI0EUbJ72wp88Cw3bv8CLce2TOkLMwkE6NRN55w2aOyqP1G3vixHa6YcVaLlkQhJoJsBwE3rX5603y2KjOhMomqHfXxXn/3GKTWlsQ== michael.j.schmidt@gmail.com
- name: michi
groups:
- sudo
- docker
@BugRoger
BugRoger / gist:67fe14e34f08f7b39ee6
Last active August 29, 2015 14:15
EdgeRouter Reinstall
EMRK>emrk-reinstall
WARNING: This script will reinstall EdgeOS from scratch
If you have any usable data on your router storage,
it will be irrecoverably destroyed!
Do you want to continue?
yes or no: yes
Unmounting boot partition
Unmounting root partition
Re-creating partition table
Creating boot partition
@BugRoger
BugRoger / highmaul.md
Last active August 29, 2015 14:10
Phalanx Highmaul Tactics

Highmaul

Kargath Bladefist is a fairly straightforward fight that requires moderate coordination. Throughout the encounter, Kargath will use the Chain Hurl ability to pick up the five nearest players and fling them into the stands of the Coliseum where they can engage the enemies in the audience. The most dangerous mechanic in the encounter is Berserker Rush. It can only be stopped by the target's death or by kiting Kargath through an active Flame Pillar

Recap

  • 2 tanks, 3 healers
  • Spread out 7y for Blade Dance
  • Move the fuck out of his way for Berserker Rush
  • Pull into the flaming pillars
  • Chain Hurl will throw closest 5 on the stands. Kill stuff. Alertnate tanks with debuff.
@BugRoger
BugRoger / http_client.rb
Created December 4, 2014 09:58
HTTPClient
class HTTPClient
VERB_MAP = {
get: Net::HTTP::Get,
post: Net::HTTP::Post,
put: Net::HTTP::Put,
delete: Net::HTTP::Delete
}
def initialize(endpoint, options = {})
uri = URI.parse(endpoint)
@BugRoger
BugRoger / inventory.rb
Created August 6, 2014 07:43
ActiveRecord Playground in a Single File
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end

Gem(spec|file(.lock)?) and You

A Howto on development of Gems and their interaction with Bundler, Continious Integration and Deployment in complex applications.

Introduction

#!/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 &
@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