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
| package main | |
| import ( | |
| "io" | |
| "time" | |
| "strconv" | |
| "net/http" | |
| "fmt" | |
| "encoding/json" | |
| "github.com/kr/pretty" |
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
| #user www-data; | |
| worker_processes 4; | |
| #pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 19000; | |
| multi_accept on; | |
| } | |
| worker_rlimit_nofile 20000; |
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
| $ nova show load-tank | |
| +--------------------------------------+----------------------------------------------------------+ | |
| | Property | Value | | |
| +--------------------------------------+----------------------------------------------------------+ | |
| | OS-DCF:diskConfig | MANUAL | | |
| | OS-EXT-AZ:availability_zone | lxc | | |
| | OS-EXT-STS:power_state | 1 | | |
| | OS-EXT-STS:task_state | - | | |
| | OS-EXT-STS:vm_state | active | | |
| | OS-SRV-USG:launched_at | 2014-03-18T10:25:43.000000 | |
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 /some/path/resource/1 HTTP/1.1 | |
| User-Agent:Phantom_0.14.0 | |
| Host:test.area | |
| Connection:close | |
| HTTP/1.1 200 Ok | |
| Content-Type: text/xml; charset=utf-8 | |
| Connection: Close |
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 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Phantom.ammo.gen.demo | |
| ~~~~~~~~~~~~~~~~~~~~~ | |
| for educational purposes only | |
| """ | |
| import sys |
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
| >>> SRC_URL = 'http://log.firebat.yandex-team.ru/messages? | |
| utf8=%E2%9C%93&filters%5Bmessage%5D=&filters%5Bfull_message%5D=&filters%5Bdate%5D=&filters%5Bfacility%5D=&filters%5Bfile%5D=&filters%5Bline%5D=&filters%5Bseverity%5D=&filters%5Bhost%5D=&fil | |
| ters%5Badditional%5D%5Bkeys%5D%5B%5D=test_id&filters%5Badditional%5D%5Bvalues%5D%5B%5D=31&filters%5Badditional%5D%5Bkeys%5D%5B%5D=env&filters%5Badditional%5D%5Bvalues%5D%5B%5D=%27lunaport-dev%2 | |
| 7' | |
| >>> from urlparse import urlparse | |
| >>> import urlparse | |
| >>> urlparse.parse_qs(SRC_URL) | |
| {'http://log.firebat.yandex-team.ru/messages? utf8': [' | |
| \xe2\x9c\x93'], 'filters[additional][keys][]': ['test_id', 'env'], 'filters[additional][values][]': ['31', "'lunaport-dev'"]} | |
| >>> |
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
| >>> hc.build_phantom('/api/v1.0/resource', method='POST', body='{"a": "b"}', | |
| ... headers={'Host': 'httpbin.org', 'Content-type': 'application/json'}) | |
| '148\nPOST /api/v1.0/resource HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 10\r\nHost: httpbin.org\r\nContent-type: application/json\r\n\r\n{"a": "b"}\r\n\r\n\n' | |
| >>> hc.build_phantom('/api/v1.0/resource', method='POST', body='{"a": "b"}', tag='thi_is_API', headers={'Host': 'httpbin.org', 'Content-type': 'application/json'}) | |
| '148 thi_is_API\nPOST /api/v1.0/resource HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 10\r\nHost: httpbin.org\r\nContent-type: application/json\r\n\r\n{"a": "b"}\r\n\r\n\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
| setup_sshd_user() { | |
| if ! getent passwd sshd >/dev/null; then | |
| adduser --quiet --system --no-create-home --home /var/run/sshd --shell /usr/sbin/nologin sshd | |
| fi | |
| } |
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
| /* JSHint strict mode tweak */ | |
| /*jshint globalstrict: true*/ | |
| /*jshint browser: true*/ | |
| /*global $, _, angular, ya, app */ | |
| 'use strict'; | |
| var APITestMixIn = { | |
| get_tests: function (url, per_page) { | |
| /* Retrieve test entries from REST API, infinit data pagination aka | |
| * GitHUb api. | |
| */ |
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
| /* JSHint strict mode tweak */ | |
| /*jshint globalstrict: true*/ | |
| /*jshint browser: true*/ | |
| /*global $, _, angular, ya, app */ | |
| 'use strict'; | |
| app.factory('data_factory', ['$http', 'AlertService', function($http, AlertService) { | |
| var url_base = '/api/latest/'; | |
| var data_factory = {}; |