Skip to content

Instantly share code, notes, and snippets.

View petrblaho's full-sized avatar

Petr Blaho petrblaho

  • Brno, Czech Republic
View GitHub Profile
@petrblaho
petrblaho / muni-ruby-testing.html
Last active November 4, 2015 10:46
MUNI Ruby testing
<section data-markdown>
# Proč testovat
* ověření funkčnosti
* automatizace
* ochrana před regresemi
* druh dokumentace
</section>
<section data-markdown>
@petrblaho
petrblaho / index.html
Last active November 4, 2015 10:04
test of gist-reveal.it
<section data-markdown>
# Test of gist-reveal.it
Will it grab changes?
*Yes!* It will.
```ruby
require 'wits'
@petrblaho
petrblaho / vmips.sh
Last active August 29, 2015 14:18
one liner to get IPs of VMs using virsh
#!/usr/bin/sh
# usage:
# sh <(curl -s https://gist.githubusercontent.com/petrblaho/cae39aaa90e4ec0b7b76/raw/vmips.sh)
virsh list --name | grep -v '^$' | xargs -n1 -I{} sh -c "echo {}:; virsh domiflist {} | grep -v '^$' | tail -n +2 | awk '{print \$5}' | xargs -n1 -I{} sh -c \"cat /var/lib/libvirt/dnsmasq/default.leases | grep {}\" | awk '{print \$3}'; echo"
#!/usr/bin/sh
## UNDERCLOUD
# from lab
ROUTE_DEV=virbr0
VIRT_IP=`cat /var/lib/libvirt/dnsmasq/default.leases | awk '{print $3}' | head -n1` #undercloud VM IP - get first one
BM_NETWORK_CIDR=192.0.2.1/32
ip route replace $BM_NETWORK_CIDR dev $ROUTE_DEV via $VIRT_IP
require 'rubygems'
require 'cinch'
require 'ruby_cowsay'
cow = Cow.new
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.eng.brq.redhat.com"
c.channels = ["#gabelstaplerfahrer"]
lib/workers/event_catcher_openstack.rb
- monitor_events method
- adds events into @queue
- then event is processed
- process_event method
- called EmsEvent.add_queue
app/models/ems_event.rb
- add_queue method
- call MiqQueue.put
Spell Snare - 119
Teferi, Temporal Archmage - 109
Strip Mine - 99
Grand Arbiter Augustin IV - 99
Nimbus Maze - 99
Absorb - 89
Skycloud Expanse - 79
City of Brass - 75
Blinding Angel - 69
Adarkar Wastes - 69
@petrblaho
petrblaho / rdio-next.sh
Last active August 29, 2015 14:11 — forked from jistr/rdio-next.sh
#!/bin/bash
set -eo pipefail
xdotool key --window $(xdotool search --name 'Rdio \- Mozilla Firefox') bracketright
@petrblaho
petrblaho / rabbitmq.log
Last active August 29, 2015 14:11
debugging of bad validation process
=INFO REPORT==== 12-Dec-2014::17:22:19 ===
accepting AMQP connection <0.27682.4> (192.168.122.1:54899 -> 192.168.122.160:5672)
=ERROR REPORT==== 12-Dec-2014::17:22:22 ===
closing AMQP connection <0.27682.4> (192.168.122.1:54899 -> 192.168.122.160:5672):
{handshake_error,starting,0,
{amqp_error,access_refused,
"PLAIN login refused: user 'guest' - invalid credentials",
'connection.start_ok'}}
@petrblaho
petrblaho / find-tabs.sh
Created May 28, 2014 11:07
this just finds all tabs
grep -P '\t' -r . | grep -v './.git'