import foobar
import foo.bar as baz
from foo import bar
from foo.bar import Baz
from foo.bar import BAZ
class HandlerRegistry(dict):
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( | |
{ |
/* | |
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 |
#!/usr/bin/env python | |
from __future__ import print_function | |
import json | |
import sys | |
from authentication import authenticate | |
from future.moves.urllib.parse import urlencode | |
if __name__ == '__main__': | |
username = sys.argv[1] |
:: | |
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and | |
:: its prerequisites. Run this as an administrator. | |
:: | |
:: Install chocolatey. | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
:: Install Python 3. | |
choco install -y python |
*update: TBC, but this new might affect how easy it is to use this technique past August 2024: Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August
This gist, based in part on a gist by Brian Hartvigsen, allows you to export from Authy your TOTP tokens you have stored there.
Those can be "standard" 6-digits / 30 secs tokens, or Authy's own version, the 7-digits / 10 secs tokens.
#!/usr/bin/env python2 | |
"Demonstrate using multiprocessing.Pool()" | |
import multiprocessing, time, logging, os, random, signal, pprint, traceback | |
logging.basicConfig(level=logging.DEBUG) | |
_L = logging.getLogger() | |
class JobTimeoutException(Exception): |
;; Usage Example: | |
;; | |
;; <!-- BEGIN RECEIVE ORGTBL ${1:YOUR_TABLE_NAME} --> | |
;; <!-- END RECEIVE ORGTBL $1 --> | |
;; | |
;; <!-- | |
;; #+ORGTBL: SEND $1 orgtbl-to-gfm | |
;; | $0 | | |
;; --> |