Skip to content

Instantly share code, notes, and snippets.

View waldronj's full-sized avatar

Josh Waldron waldronj

View GitHub Profile
import sys
data = [('1', 'Lorem ipsm bla bla bla'),
('2', '1111111222255555'),
('3', 'Nm: 612312345'),
('4', 'asdasdafassda'),
PS C:\> $content = Get-Content .\test.json
PS C:\> $content[0]
PS C:\> $content[1]
PS C:\> $content[2]
StatusCode : 200
PS C:\> $content[3]
StatusDescription : OK
PS C:\> $content[4]
function get-website ($url){
(new-object system.net.webclient).downloadstring($url)
}
import pexpect
import sys
from sys import argv
script, environment = argv
command = "pyctrl-shell -e %s" % environment
child = pexpect.spawn(command, logfile=sys.stdout)
child.expect("In ", timeout=10)
child.sendline("bigip.active_partition = 'SomePartition'")
@waldronj
waldronj / gist:6345549
Created August 26, 2013 19:26
jira integration python
class PylonstestingController(BaseController):
jac = {'server': 'someSite'}
jira = JIRA(options=jac,basic_auth=('SomeUser', 'SomePassword'))
def index(self, id):
#jac = {'server': 'someSite'}
#jira = JIRA(options=jac,basic_auth=('SomeUser', 'SomePassword'))
searchString = 'project=' + id + '&status=open'
@waldronj
waldronj / gist:6076655
Last active December 20, 2015 05:18
sample json
[{"id":10071673,"name":"BabyBook","full_name":"waldronj/BabyBook","owner":{"login":"waldronj","id":1923489,"avatar_url":"https://secure.gravatar.com/avatar/81b5484ff985c464e5fdaf0222693e54?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"81b5484ff985c464e5fdaf0222693e54","url":"https://api.github.com/users/waldronj","html_url":"https://github.com/waldronj","followers_url":"https://api.github.com/users/waldronj/followers","following_url":"https://api.github.com/users/waldronj/following{/other_user}","gists_url":"https://api.github.com/users/waldronj/gists{/gist_id}","starred_url":"https://api.github.com/users/waldronj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waldronj/subscriptions","organizations_url":"https://api.github.com/users/waldronj/orgs","repos_url":"https://api.github.com/users/waldronj/repos","events_url":"https://api.github.com/users/waldronj/events{/privacy}","received_events_url":"https://api.github.com/user
@waldronj
waldronj / gist:5689374
Created June 1, 2013 05:29
Unzip file to current directory using powershell
param(
[Parameter(Mandatory=$true, Position=1)][string]$fileName
)
$currentDirectory = Get-Location
$shell_app=new-object -com shell.application
$zip_file = $shell_app.namespace((get-item $fileName).FullName)
$destination = $shell_app.namespace($currentDirectory.Path)
$destination.Copyhere($zip_file.items())
@waldronj
waldronj / gist:5507157
Created May 3, 2013 04:08
Using Powershell to post a message to campfire
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$username,
[Parameter(Mandatory=$True,Position=1)]
[string]$baseurl,
[Parameter(Mandatory=$True,Position=1)]
[string]$MessageType,
[Parameter(Mandatory=$True,Position=1)]
[string]$body
)