This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marvin:voltron oogali$ irb -rapp | |
>> vm = Voltron::VirtualMachine.new 'oo-test', 1, 1024 | |
=> #<Voltron::VirtualMachine:0x1026033c8 @nics=[], @memory=1024, @actions={:on_poweroff=>:destroy, :on_reboot=>:restart, :on_crash=>:restart}, @disks=[], @name="oo-test", @clock_offset="utc", @emulator="/usr/libexec/qemu-kvm", @cpu={:set=>[], :count=>1}, @uuid="3352397d-52a8-4377-8af2-43027592d34b", @features=["acpi", "apic", "pae"]> | |
>> vm.disks << Voltron::Disk.new('oo-test_disk0', 10240, 'vg_nutmeg_vms') | |
=> [#<Voltron::Disk:0x1025fa480 @size=10240, @name="oo-test_disk0", @device="disk", @uuid="060aba12-d8c2-4452-8699-a01f1fe37386", @volume_group="vg_nutmeg_vms">] | |
>> vm.nics << Voltron::NetworkInterface.new | |
=> [#<Voltron::NetworkInterface:0x1025f4d00 @vlan="default", @mac="54:52:00:9c:44:bd", @model="e1000">] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
$rc = 0; | |
while(<STDIN>) { | |
chomp; | |
## Grab severity, CentOS version, architecture, and package name | |
## | |
## Sometimes, whitespace is missing between package name and "Update" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2006 Omachonu Ogali <[email protected]> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat test.html | |
<html> | |
<style type="text/css"></style> | |
<body> | |
<div id="header"></div> | |
<div id="content"></div> | |
<div id="footer"></div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Message from VCC-compiler: | |
Expected CSTR got 'server.ip' | |
(program line 300), at | |
(/etc/varnish/routing/02-xforwardedfor.vcl Line 3 Pos 22) | |
if (client.ip != server.ip) { | |
---------------------#########--- | |
Running VCC-compiler failed, exit 1VCL compilation failed | |
Command failed with error code 106 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ipaddr' | |
module Monitoring | |
module Middleware | |
class Ip | |
def initialize(app, options = {}) | |
trusted = options[:trusted] || [ '127.0.0.1/32' ] | |
@trusted = trusted.map { |network| IPAddr.new network } | |
@app = app | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/all' | |
def is_midnight?(time) | |
time == time.beginning_of_day | |
end | |
def datetime_range(starting, ending, seconds = false) | |
if (starting > ending) | |
starting, ending = ending, starting | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar MozillaCKA | |
rule document | |
( comment / newline / cvsid / beginning / root / certificates / trusts )* | |
end | |
# LOL! | |
rule cvsid | |
'CVS_ID' text newline | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# append this to your .bash_profile | |
start_agent() { eval `ssh-agent` >/dev/null; echo "${SSH_AGENT_PID}:${SSH_AUTH_SOCK}" > "${HOME}/.ssh/agent"; } | |
use_existing_agent() { export SSH_AGENT_PID=`head -1 ${HOME}/.ssh/agent | awk -F ':' '{ print $1 }'`; export SSH_AUTH_SOCK=`head -1 ${HOME}/.ssh/agent | awk -F ':' '{ print $2 }'`; } | |
if [ ! -f "${HOME}/.ssh/agent" ]; then | |
start_agent | |
else | |
use_existing_agent | |
if [ -z "${SSH_AUTH_SOCK}" ] || [ ! -S "${SSH_AUTH_SOCK}" ]; then | |
start_agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Gemfile b/Gemfile | |
index ae735c6..0c19644 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -2,10 +2,11 @@ source :rubygems | |
gem 'SystemTimer', :platforms => :ruby_18 | |
gem 'eventmachine' | |
gem 'thin' | |
+gem 'puma', :git => 'git://github.com/puma/puma.git' | |
gem 'hiredis' |