Skip to content

Instantly share code, notes, and snippets.

View schadr's full-sized avatar

Adrian Schroeter schadr

  • - private -
  • Seattle, WA, USA
View GitHub Profile
@schadr
schadr / wetsgrid-psql.sh
Last active December 10, 2015 14:38
This is a template for using a postgresql database on a WESTGRID cluster
#!/bin/bash
#PBS -S /bin/bash
##PBS -l procs=1
#PBS -l nodes=1:ppn=1
#PBS -l walltime=48:00:00
#PBS -m bae
#PBS -M your@email.com
#PBS -l mem=6gb
#PBS -l file=5gb
@schadr
schadr / rtc_request_auth.py
Created August 30, 2012 20:41
Shows how to requests the content for a URI from a Jazz server, including authentication with the server, using the request lib for python
import requests
user= 'your jazz username'
pw = 'your jazz password'
host = 'https://jazzhost:port/something'#/ROOTSERVICES
resource_uri = 'https://jazzhost:port/some_uri.json'
r = requests.get(host + '/authenticate/identidty', headers={'Accept':'application/xml'}, allow_redirects=True, verify=False)
r = requests.post(host + '/j_security_check', allow_redirects=True, verify=False, data={'j_username':user,'j_password':pw}, cookies=r.cookies)
r = requests.get( resource_uri, allow_redirects=True, verify=False, cookies=r.cookies)