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 requests | |
import logging | |
# These two lines enable debugging at httplib level (requests->urllib3->http.client) | |
# You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. | |
# The only thing missing will be the response.body which is not logged. | |
try: | |
import http.client as http_client | |
except ImportError: | |
# Python 2 |
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
/Users/hartsocks/.venv/pyvmomi-tools-py3/bin/python3 /Users/hartsocks/PycharmProjects/pyvmomi/sample/getallvms.py -s 192.168.2.11 -u root -p vmware | |
add to dependency map ['ManagedObject'] | |
ManagedObject | |
add to dependency map ['DataObject'] | |
DataObject | |
add to dependency map ['vmodl', 'DynamicArray'] | |
vmodl | |
DynamicArray | |
len: 1 | |
curName: vmodl.DynamicArray |
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
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/hartsocks/PycharmProjects/pyvmomi/sample/getallvms.py -s 192.168.2.11 -u root -p vmware | |
('add to dependency map', ['ManagedObject']) | |
ManagedObject | |
('add to dependency map', ['DataObject']) | |
DataObject | |
('add to dependency map', ['vmodl', 'DynamicArray']) | |
vmodl | |
('\t', 'DynamicArray') | |
('\t curName: ', 'vmodl.DynamicArray') | |
('add to dependency map', ['vmodl', 'DynamicData']) |
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
Traceback (most recent call last): | |
File "/Users/hartsocks/PycharmProjects/pyvmomi/pyVmomi/VmomiSupport.py", line 265, in __getattr__ | |
typeObj = GetWsdlType(XMLNS_VMODL_BASE, attr) | |
File "/Users/hartsocks/PycharmProjects/pyvmomi/pyVmomi/VmomiSupport.py", line 1018, in GetWsdlType | |
typ = _LoadVmodlType(_wsdlDefMap[(ns, name)][0]) | |
KeyError: ('urn:vim25', 'fault') | |
During handling of the above exception, another exception occurred: | |
Traceback (most recent call last): |
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
pyvmomi/sample/getallvms.py -s test_host -u test_user -p test_password | |
Traceback (most recent call last): | |
File "/Users/hartsocks/PycharmProjects/pyvmomi/sample/getallvms.py", line 22, in <module> | |
from pyVim.connect import SmartConnect, Disconnect | |
File "/Users/hartsocks/PycharmProjects/pyvmomi/pyVim/connect.py", line 57, in <module> | |
from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub | |
ImportError: cannot import name 'vim' |
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
//************************************** | |
// Name: OpenGL Spine drawing app | |
// Description:It's a Spline Drawing Application that uses the OpenGL Libraries. I used the GLUT event handler interface to control Mouse functions.You will Need: | |
OpenGL | |
Glut | |
and a C++ compiler | |
Found at: http://modzer0.cs.uaf.edu/~hartsock/C_Cpp/OpenGL/Splines.html | |
// By: Found on the World Wide Web | |
// | |
// |
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
/************************************************************************\ | |
| | |
| Shawn R. Hartsock Gravity.cpp | |
| CS 381 Uses STL | |
| Prof: Hartman | |
| due: 12/16/1998 | |
| | |
Simulates Gravity. See PreDefined Menu... My favorite is to set | |
collisions to absorbative and choose explode from the predef. menu | |
| Keys : z,x,i,j,k,l, |
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
/************************************************************************\ | |
| | |
| Shawn R. Hartsock Gravity.cpp | |
| CS 381 Uses STL (SGI version) | |
| Prof: Hartman Note: Win32 version is different. | |
| due: 12/16/1998 | |
| | |
| *executable* at: ../hartsock/homework/Hw09/Gravity | |
| |
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
class Link(unicode): | |
def __new__(cls, obj): | |
if isinstance(obj, basestring): | |
return unicode.__new__(cls, obj) | |
elif isinstance(obj, DataObject): | |
if obj.key: | |
return unicode.__new__(cls, obj.key) | |
raise AttributeError("DataObject does not have a key to link") | |
else: | |
raise ValueError |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'uri' | |
# usage: ruby import.rb my-blog.xml | |
# my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
data = File.read ARGV[0] |