Skip to content

Instantly share code, notes, and snippets.

Avatar

Kenneth East kheast

View GitHub Profile
@kheast
kheast / postmanNetSuiteTBA.js
Created Aug 21, 2019 — forked from michoelchaikin/postmanNetSuiteTBA.js
Postman pre-request script to generate TBA variables for NetSuite Web Services
View postmanNetSuiteTBA.js
/*
Usage:
1. Define a NetSuite environment in Postman (https://www.getpostman.com/docs/postman/environments_and_globals/manage_environments)
with the following keys set: account, consumerKey, consumerSecret, tokenId, tokenSecret
2. Add this script to your "Pre Request Script" in Postman (https://www.getpostman.com/docs/postman/scripts/pre_request_scripts)
3. Add the Token Passport in your request with variable placeholders
@kheast
kheast / cpanel_ssl_install.py
Last active Apr 12, 2018
Python script to install SSL certificate from Let's Encrypt into Cpanel for a single domain.
View cpanel_ssl_install.py
#!/usr/bin/env python2.7
'''This script will install an SSL certificate into Cpanel
for a single domain. In my case, the certificate is from
Let's Encrypt via 'acme.sh'. The script expects the certificate
to be stored in the manner described at
http://east.fm/posts/acme-cpanel-a2hosting
This script requires a single argument: the domain name.
@kheast
kheast / process_fdgg
Created Feb 9, 2017
bash script to submit credit card transaction to First Data Global Gateway
View process_fdgg
#!/bin/bash
# Code to submit a credit card transaction to First Data Global
# Gateway for processing. Shows the bare minimum necessary to process
# a transaction. Handy to verify validity of credentials and XML.
# Primarily intended to process transactions against FDGG test
# endpoint, but it will happily process live transactions against
# the FDGG secure endpoint, charging a real credit card for the
# specified amount.
@kheast
kheast / boto3-resource-profile.py
Created Feb 8, 2017
How to get boto3.resource to use a profile from credentials file
View boto3-resource-profile.py
# To get boto3.resource to use a profile name, one must first
# setup a default session. The credentials provided during the
# session setup will be subsequently used by resource().
#
# See: https://github.com/boto/boto3/issues/21
# https://github.com/boto/boto3/pull/69
boto3.setup_default_session(profile_name=self.dpkg.profile_name)
self.ec2 = boto3.resource('ec2', region_name=self.dpkg.region_name)
filters = [{'Name': 'instance-state-name', 'Values': ['running']}]
for inst in self.ec2.instances.filter(Filters=filters):
You can’t perform that action at this time.