Skip to content

Instantly share code, notes, and snippets.

View hutchic's full-sized avatar
💭
Open for work

Colin Hutchinson hutchic

💭
Open for work
View GitHub Profile
from flask import Flask
from flask.ext.restful import reqparse, abort, Api, Resource
from flask_restful_swagger import swagger
app = Flask(__name__)
class Api(Api):
def __init__(self, *args, **kwargs):
super(Api, self).__init__(*args, **kwargs)
self.prefix = '/api'
33.33.33.1 - - [18/Mar/2014 20:20:21] "GET /todos/todo1 HTTP/1.1" 500 -
Traceback (most recent call last):
File "/share/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/share/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/share/env/lib/python2.7/site-packages/Flask_RESTful-0.2.12-py2.7.egg/flask_restful/__init__.py", line 257, in error_router
return self.handle_error(e)
File "/share/env/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
@hutchic
hutchic / gist:f9bb3786ddab563e6ce0
Created June 4, 2014 01:57
sudo pip3 install ocdev
vagrant@precise64:~$ sudo pip3 install ocdev
Downloading/unpacking ocdev
Downloading ocdev-0.0.10.tar.gz
Running setup.py (path:/tmp/pip_build_root/ocdev/setup.py) egg_info for package ocdev
Downloading/unpacking jinja2 (from ocdev)
Downloading Jinja2-2.7.2.tar.gz (378kB): 378kB downloaded
Running setup.py (path:/tmp/pip_build_root/jinja2/setup.py) egg_info for package jinja2
warning: no files found matching '*' under directory 'custom_fixers'
Client version: 1.3.3
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): 3ea0e03
OS/Arch (client): linux/amd64
Server version: 1.3.3
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): 3ea0e03
Step 0 : FROM centos:6
2012-08-14 21:14:25,267 [Atomikos:1] [] WARN c.a.icatch.imp.CoordinatorImp - Local heuristic termination of coordinator SsoAtomikos0010025000004 with state HEUR_HAZARD
2012-08-14 21:14:25,270 [Atomikos:1] [adminuser@syncapse.com] WARN c.a.icatch.imp.CoordinatorImp - Local heuristic termination of coordinator ThriftAtomikos0010050700001 with state HEUR_HAZARD
2012-08-14 21:14:25,421 [Atomikos:1] [] WARN c.a.icatch.imp.CoordinatorImp - Local heuristic termination of coordinator SsoAtomikos0010025000004 with state HEUR_HAZARD
2012-08-14 21:14:25,422 [Atomikos:1] [adminuser@syncapse.com] WARN c.a.icatch.imp.CoordinatorImp - Local heuristic termination of coordinator ThriftAtomikos0010050700001 with state HEUR_HAZARD
@hutchic
hutchic / keybase.md
Created November 19, 2015 15:57
keybase.md

Keybase proof

I hereby claim:

  • I am hutchic on github.
  • I am hutchic (https://keybase.io/hutchic) on keybase.
  • I have a public key whose fingerprint is 8783 61CD 8173 1296 6EA3 15B8 D339 9218 3D79 E262

To claim this, I am signing this object:

@hutchic
hutchic / gist:4566559
Created January 18, 2013 17:50
Ansible vagrant povision stack trace
[web] Running provisioner: Vagrant::Provisioners::Ansible...
ansible-playbook
--user=vagrant
--inventory-file=/tmp/inventory20130118-30833-t2bz5p
--private-key=/home/colin/.vagrant.d/insecure_private_key
devops/webserver.yml
[web] Forcing shutdown of VM...
[web] Destroying VM and associated drives...
/home/colin/.rvm/gems/ruby-1.9.3-p362/gems/vagrant-1.0.5/lib/vagrant/util/safe_exec.rb:23:in `exec': No such file or directory - ansible-playbook (Errno::ENOENT)
from /home/colin/.rvm/gems/ruby-1.9.3-p362/gems/vagrant-1.0.5/lib/vagrant/util/safe_exec.rb:23:in `safe_exec'
@hutchic
hutchic / gist:99fe5a935dfab829c13b
Last active January 1, 2016 16:42
consul external service
curl -X PUT -d '{
"Datacenter": "default", "Node": "google",
"Address": "www.google.com",
"Service": {
"Service": "search",
"Port": 80
}
}
' http://127.0.0.1:8500/v1/catalog/register
----system---- ------memory-usage----- -net/total- ----total-cpu-usage----
time | used buff cach free| recv send|usr sys idl wai hiq siq
20-01 05:31:49|80.3M 34.3M 406M 472M| 0 0 | 1 0 99 0 0 0
20-01 05:31:59|80.3M 34.3M 406M 472M| 44B 27B| 0 0 100 0 0 0
20-01 05:32:09|80.3M 34.3M 406M 472M| 30B 27B| 0 0 100 0 0 0
20-01 05:32:19|80.2M 34.3M 406M 472M| 20B 20B| 0 0 100 0 0 0
20-01 05:32:29|80.1M 34.3M 406M 472M| 292B 834B| 0 0 100 0 0 0
20-01 05:32:39|80.2M 34.4M 406M 472M| 725B 2184B| 0 0 99 0 0 0
20-01 05:32:49|80.2M 34.4M 406M 472M| 342B 327B| 0 0 100 0 0 0
20-01 05:32:59|80.1M 34.4M 406M 472M| 5B 5B| 0 0 100 0 0 0
"total cpu usage",,,,,,"dsk/total",,"net/total",,"paging",,"system",
"usr","sys","idl","wai","hiq","siq","read","writ","recv","send","in","out","int","csw"
0.758,0.170,98.788,0.282,0.0,0.001,78581.632,261931.459,0.0,0.0,0.0,0.0,22.553,50.236
0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,504.0,1312.0,0.0,0.0,23.0,30.0
0.990,0.0,99.010,0.0,0.0,0.0,0.0,0.0,104.0,460.0,0.0,0.0,11.0,10.0
0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,1200.0,622.0,0.0,0.0,15.0,10.0
0.990,0.0,99.010,0.0,0.0,0.0,0.0,0.0,156.0,514.0,0.0,0.0,12.0,10.0
0.0,0.0,100.0,0.0,0.0,0.0,0.0,0.0,104.0,460.0,0.0,0.0,14.0,19.0