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
| #!/bin/bash | |
| DOMAIN=$1 | |
| XML=`sudo virsh dumpxml $DOMAIN` | |
| MAC=`echo "$XML" | grep 'mac address' | awk -F\' '{print $2}'` | |
| VIRNETWORK=`echo "$XML" | grep 'source network' | awk -F\' '{print $2}'` | |
| VIRBRIDGE=`sudo virsh net-info $VIRNETWORK | grep Bridge | awk '{print $2}'` | |
| VIRNET=`ifconfig $VIRBRIDGE | grep inet | awk '{print $2}' | awk -F. '{print $1"."$2"."$3".*"}'` | |
| nmap -sn $VIRNET &> /dev/null |
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/env ruby | |
| class Reminder | |
| def initialize(bound, current = 0) | |
| @bound = bound.to_i | |
| @current = current.to_i | |
| end | |
| def +(number) | |
| @current += number |
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/env ruby | |
| require 'uri' | |
| require 'net/http' | |
| require 'nokogiri' | |
| track_id = ARGV.first | |
| form_url = URI.parse('http://www.postoffice.co.uk/track-trace') | |
| response = Net::HTTP.get_response(form_url) |
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
| ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/" | |
| <Directory "/usr/lib64/nagios/cgi-bin/"> | |
| # SSLRequireSSL | |
| Options ExecCGI | |
| AllowOverride None | |
| AuthName "Nagios Access" | |
| AuthType Basic | |
| AuthUserFile /etc/nagios/passwd |
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
| libvirt: XML-RPC error : authentication failed: polkit: polkit\56retains_authorization_after_challenge=1 | |
| Authorization requires authentication but no agent is available. | |
| Traceback (most recent call last): | |
| File "scripts/../bootstrap/configure-bootstrap-vm", line 48, in <module> | |
| main() | |
| File "scripts/../bootstrap/configure-bootstrap-vm", line 43, in main | |
| conn=libvirt.open("qemu:///system") | |
| File "/usr/lib64/python2.7/site-packages/libvirt.py", line 236, in open | |
| if ret is None:raise libvirtError('virConnectOpen() failed') | |
| libvirt.libvirtError: authentication failed: polkit: polkit\56retains_authorization_after_challenge=1 |
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
| 2013-06-07 11:15:06.058+0000: starting up | |
| LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -name bootstrap -S -machine pc-1.0,accel=kvm,usb=off -cpu qemu32 -m 1536 -smp 2,sockets=2,cores=1,threads=1 -uuid b5171d6b-0964-4700-a12c-d7defb6f5a5b -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/bootstrap.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/bootstrap.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=writeback -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=24,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:1a:ad:6d,bus=pci.0,addr=0x3 -netdev tap,fd=25,id=hostnet1 -device e1000,netdev=hostnet1,id=net1,mac=52:54:00:74:35:7e,bus=pci.0,addr=0x4 -vnc 127.0.0.1:0 -vga cirrus -device virtio-ballo |
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
| error: Failed to start domain bootstrap | |
| error: monitor socket did not show up: Connection refused |
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
| Processing triggers for man-db ... | |
| Processing triggers for install-info ... | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 00-remove-grub completed | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 Running /tmp/in_target.d/pre-install.d/00-usr-local-bin-secure-path | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 00-usr-local-bin-secure-path completed | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 Running /tmp/in_target.d/pre-install.d/01-install-bin | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 01-install-bin completed | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 Running /tmp/in_target.d/pre-install.d/01-override-yum-arch | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 01-override-yum-arch completed | |
| dib-run-parts Mon Jun 17 06:30:47 EDT 2013 Running /tmp/in_target.d/pre-install.d/02-lsb |
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
| def test_it_returns_400_when_posting_bad_data(self): | |
| json = { | |
| 'bad-data-key': 'bad-data-value', | |
| } | |
| response = self.post_json('/racks', params=json, status=400, expect_errors=True) | |
| self.assertEqual(response.status_int, 400) |
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
| import Test.HUnit (Assertion, (@=?), runTestTT, Test(..)) | |
| import Control.Monad (void) | |
| import Bob (responseFor) | |
| testCase :: String -> Assertion -> Test | |
| testCase label assertion = TestLabel label (TestCase assertion) | |
| test_respondsToSomething :: Assertion | |
| test_respondsToSomething = | |
| "Whatever." @=? responseFor "Tom-ay-to, tom-aaaah-to." |