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 python | |
| import re | |
| totals = {'packets': 0, 'traffic': 0} | |
| with open('traffic.log', 'r') as fp: | |
| content = fp.read() | |
| lines = content.split('\n') |
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
| {"version":"2.0","host":"api0","timestamp":1354831900.538,"short_message":"1.1.1.1:9160 error during connect.","full_message":"Error: This socket is closed.\n at Socket._write (net.js:518:19)\n at Socket.write (net.js:510:15)\n at Connection.write (/tmp/foo-bundle-63399cb1058ef40ecbe2a99c63963bd0d5a6e785/node_modules/cassandra-client/node_modules/thrift/lib/thrift/connection.js:106:19)\n at Object.onFlush (/tmp/foo-bundle-63399cb1058ef40ecbe2a99c63963bd0d5a6e785/node_modules/cassandra-client/node_modules/thrift/lib/thrift/connection.js:123:16)\n at Object.TFramedTransport.flush (/tmp/foo-bundle-63399cb1058ef40ecbe2a99c63963bd0d5a6e785/node_modules/cassandra-client/node_modules/thrift/lib/thrift/transport.js:128:12)\n at Object.CassandraClient.send_execute_cql_query (/tmp/foo-bundle-63399cb1058ef40ecbe2a99c63963bd0d5a6e785/node_modules/cassandra-client/lib/gen-nodejs/Cassandra.js:7097:22)\n at Object.CassandraClient.execute_cql_query (/tmp/foo-bundle-63399cb1058ef40ecbe2a99c63963bd0d5a6e78 |
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 python | |
| # Licensed to Tomaz Muraus under one or more | |
| # contributor license agreements. See the NOTICE file distributed with | |
| # this work for additional information regarding copyright ownership. | |
| # Tomaz muraus licenses this file to You under the Apache License, Version 2.0 | |
| # (the "License"); you may not use this file except in compliance with | |
| # the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # |
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
| # -------- begin 39934792 request ---------- | |
| curl -i -X GET -H 'Host: dns.api.rackspacecloud.com' -H 'X-LC-Request-ID: 39934792' -H 'Accept-Encoding: gzip,deflate' -H 'X-Auth-Token: abcdef' -H 'Content-Length: 0' -H 'Accept: application/json' -H 'User-Agent: libcloud/0.12.0-dev (Rackspace DNS (US))' --compress 'https://dns.api.rackspacecloud.com:443/v1.0/546514/domains?cache-busting=4e1a1b74b95976fa' | |
| # -------- begin 39934792:40416536 response ---------- | |
| HTTP/1.1 200 OK | |
| Date: Fri, 19 Oct 2012 05:45:55 GMT | |
| X-Api-Version: 1.0.19 | |
| Content-Length: 1316 | |
| Content-Type: application/json | |
| Server: Jetty(8.0.y.z-SNAPSHOT) |
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
| <?xml version='1.0' encoding='utf-8'?> | |
| <chapter version="5.0" xml:id="Service API Operations" xmlns="http://docbook.org/ns/docbook" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
| <title>Service API Operations</title> | |
| <section xml:id="account"> | |
| <title>Account</title> | |
| <section xml:id="summary"> | |
| <title>Summary</title> | |
| <para>An account contains attributes describing a customer's account. This description contains mostly read only data; however, a few properties can be modified with the API.

</para> | |
| </section> | |
| <section xml:id="get-account"> |
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
| kami ~/ $ sudo apt-get install maven2 | |
| [sudo] password for kami: | |
| Reading package lists... Done | |
| Building dependency tree | |
| Reading state information... Done | |
| The following extra packages will be installed: | |
| ant ant-optional bsh bsh-gcj fop gcj-4.6-base gcj-4.6-jre-lib java-wrappers junit junit4 libapache-pom-java | |
| libasm3-java libavalon-framework-java libbackport-util-concurrent-java libbatik-java libbsf-java | |
| libclassworlds-java libcommons-beanutils-java libcommons-cli-java libcommons-codec-java | |
| libcommons-collections3-java libcommons-configuration-java libcommons-digester-java libcommons-httpclient-java |
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
| *destroy*, *delete* -> DELETE | |
| *get*, *list*, *describe* -> GET | |
| *create* -> POST | |
| *edit*, *set*, *change* -> PUT |
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 | |
| basedir=`readlink -f $0` | |
| basedir=`dirname $basedir` | |
| versions=( "0.2.0" "0.3.0" "0.3.1" "0.4.0" "0.4.1" "0.4.2" "0.5.2" "0.6.0-beta1" "0.6.1" "0.6.2" "0.7.1" "0.8.0" "0.9.1" ) | |
| for version in ${versions[@]} | |
| do | |
| echo "Processing: $version" |
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
| GET /<api version>/compute/providers/<provider> | |
| { | |
| "name": "Rackspace", | |
| "website": "http://www.rackspacecloud.com", | |
| "supported_methods": { | |
| "list_nodes": { | |
| "name": "list_nodes", | |
| "description": "Return a list of available nodes", | |
| "arguments": [] |
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
| if (metric['code'] == '500') { | |
| return CRITICAL, 'Internal server error' | |
| } | |
| if (metric['body_match'] == '') { | |
| return WARNING, 'Copyright not found, returning WARNING.' | |
| } | |
| return OK |