This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jwt | |
import requests | |
import datetime | |
from simple_salesforce import Salesforce | |
from simple_salesforce.exceptions import SalesforceAuthenticationFailed | |
def jwt_login(consumer_id, username, private_key, sandbox=False): | |
endpoint = 'https://test.salesforce.com' if sandbox is True else 'https://login.salesforce.com' | |
jwt_payload = jwt.encode( | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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): |