Skip to content

Instantly share code, notes, and snippets.

#!/ usr/bin/env python
# By: Kelcey Damage, 2012 & Kraig Amador, 2012
api_url = 'http://ianduffy.ie:8080/client/api'
apiKey = 'ZoTQxJc2XDUGQ6Id4va5MVQA-IUvvmsNnOE0wx5e1dU5ZCPOWdx4olk_RRvoXrovOc8EzK0UEEI48BeJKmZe4w'
secret = 'k8a69yCteAQKX2lWV4EKBk4VPXv9irFoAqoLS1SsNf9dg0PDtClYdBfxZk_awGrg5s82W1WoY7ZW2r04WVJXmw'
import hashlib, hmac, string, base64, urllib
import json, urllib
#!/bin/bash
IFS="\n"
lines=`cat urls.txt`
count=0
for line in $lines
do
qrencode -d 1024 -s 15 -l L -o $count.png $line
def validate_client_secret(self, username, password):
response = requester.cloud_login(app.config['HOST'], username, password)
if response:
#print response.cookies
print response.text
else:
print "empty"
return False
#!/usr/bin/env python
import httplib2
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
from apiclient.discovery import build
CLIENT_SECRETS = 'client_secrets.json'
#!/usr/bin/env python
import httplib2
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
from apiclient.discovery import build
CLIENT_SECRETS = 'client_secrets.json'
{
"kind": "compute#zoneList",
"selfLink": "https://www.googleapis.com/compute/v1beta15/projects/silent-wind-0001/zones",
"id": "projects/silent-wind-0001/zones",
"items": [
{
"kind": "compute#zone",
"selfLink": "https://www.googleapis.com/compute/v1beta15/projects/silent-wind-0001/zones/europe-west1-a",
"id": "166957277265100431",
"creationTimestamp": "2013-09-04T17:28:00.443-07:00",
def required(f):
@wraps(f)
def decorated(*args, **kwargs):
authorization = resource_provider.get_authorization()
if not authorization.is_valid:
return abort(401)
else:
""" Pass variables from authorization back to the calling function"""
return f(*args, **kwargs)
return decorated
@imduffy15
imduffy15 / getmachinetype.json
Created September 7, 2013 20:58
GCE Responses
{
"creationTimestamp": "2013-04-25T13:32:49.088-07:00",
"description": "1 vCPU (shared physical core) and 0.6 GB RAM",
"guestCpus": 1,
"id": "4618642685664990776",
"imageSpaceGb": 0,
"kind": "compute#machineType",
"maximumPersistentDisks": 4,
"maximumPersistentDisksSizeGb": "3072",
"memoryMb": 614,
{
"listprojectsresponse": {
"count": 1,
"project": [
{
"id": "0d108f3b-e8c7-4ecc-9c36-1d9fd095db1f",
"name": "ExampleProject",
"displaytext": "ExampleProject",
"domainid": "edcc4bc3-0f74-11e3-88a4-c6d2cc863c97",
"domain": "ROOT",
INFO: --request-start--
INFO: -headers-start-
INFO: accept-encoding: gzip, deflate
INFO: accept: application/json
INFO: user-agent: google-api-python-client/1.0
INFO: -headers-end-
INFO: -path-parameters-start-
INFO: project: some-project-name
INFO: -path-parameters-end-
INFO: body: None