Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@underscorephil
underscorephil / create_account.py
Created July 10, 2015 13:36
Create sub account
# Create SoftLayer End-Customer Account on Brand Account
# Use at your own risk
import SoftLayer
from pprint import pprint as pp
import json
import SoftLayer.API
# DIST MASTER ACCOUNT API INFORMATION (NOT SUB-BRAND)
username = "CHANGE_ME" #change me
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://api.service.softlayer.com/soap/v3/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<ns1:authenticate>
<username>arst</username>
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUser = '';
$key = '';
$startDate = new DateTime('2015-06-21T08:42:56-06:00');
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Ticket', 19899621, $apiUser, $key);
$filter = new stdClass();
$filter->updates = new stdClass();
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
import SoftLayer.API
from pprint import pprint as pp
api_username = ''
api_key = ''
client = SoftLayer.Client(
username=api_username,
api_key=api_key,
)
import urllib2
from pprint import pprint as pp
response = urllib2.urlopen('https://api.service.softlayer.com/rest/v3/SoftLayer_Resource_Metadata/getUserMetadata')
metadata = response.read()
f = open('my.conf', 'w')
f.write(metadata)
f.close()
import SoftLayer
import json
import SoftLayer.API
from pprint import pprint as pp
# DIST MASTER ACCOUNT API INFORMATION
username = "CHANGE_ME" #change me
apiKey = "CHANGE_ME" #change me
# New Sub-brand
import SoftLayer
from SoftLayer import utils
import sys
import pprint
import logging
apiUsername = ''
apiKey = ''
# So we can talk to the SoftLayer API:
import SoftLayer.API
# For nice debug output:
from pprint import pprint as pp
def create_user(username):
password = 'SL<3sKL!'
user_template = {
'username': username,
@underscorephil
underscorephil / tunnel.sh
Last active August 29, 2015 14:07
bash script for managing ssh tunnel and proxy settings for osx
#!/bin/bash
# Set me to your SSH server hostname or IP
host="example.com"
# Enable the Proxy location and open a tunnel if needed
if [ "$1" = "on" ]
then
# Check if there is an existing SSH connection...we don't want to go making
# unnecessary ones.