Tag Archives: python

ModuleNotFoundError: No module named ‘skbuild’

pip3 install “camelot-py[cv]”
ModuleNotFoundError: No module named ‘skbuild’

pip3 install scikit-build

“Problem with the CMake installation, aborting build. CMake executable is %s” % cmake_executable)
Problem with the CMake installation, aborting build. CMake executable is cmake

python3 -m pip install -U pip
pip3 install opencv-python
pip3 install “camelot-py[cv]”

SimpleHTTPServer with auth

import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64

key = ""

class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
print "send header"
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()

def do_AUTHHEAD(self):
print "send header"
self.send_response(401)
self.send_header('WWW-Authenticate', 'Basic realm=\"Test\"')
self.send_header('Content-type', 'text/html')
self.end_headers()

def do_GET(self):
global key
''' Present frontpage with user authentication. '''
if self.headers.getheader('Authorization') == None:
self.do_AUTHHEAD()
self.wfile.write('no auth header received')
pass
elif self.headers.getheader('Authorization') == 'Basic '+key:
SimpleHTTPRequestHandler.do_GET(self)
pass
else:
self.do_AUTHHEAD()
self.wfile.write(self.headers.getheader('Authorization'))
self.wfile.write('not authenticated')
pass

def test(HandlerClass = AuthHandler,
ServerClass = BaseHTTPServer.HTTPServer):
BaseHTTPServer.test(HandlerClass, ServerClass)

if __name__ == '__main__':
if len(sys.argv)<3: print "usage SimpleAuthServer.py [port] [username:password]" sys.exit() key = base64.b64encode(sys.argv[2]) test()

python scan IP range



import sh

print "Scanning..."
# ping range 8.8.8.7 - 8.8.8.9
for num in range(7,10):
    # declare ip address
    address = "8.8.8." + str(num)

    # check if host is alive using PING
    try:
        # bash equivalent: ping -c 1 > /dev/null
        sh.ping(address, "-c 1", _out="/dev/null")
        print "ping to", address, "OK"
    except sh.ErrorReturnCode_1:
        print "no response from", address