start new:
tmux
start new with session name:
tmux new -s myname
| """ | |
| Determine IPv4 addresses on a Linux machine via the socket interface. | |
| Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful | |
| code comments: https://gist.github.com/pklaus/289646#gistcomment-2396272 | |
| This version has all comments removed for brevity. | |
| """ | |
| import socket | |
| import array | |
| import struct |
| /* | |
| Copyright 2011 Martin Hawksey | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |
| def encrypt_RSA(public_key_loc, message): | |
| ''' | |
| param: public_key_loc Path to public key | |
| param: message String to be encrypted | |
| return base64 encoded encrypted string | |
| ''' | |
| from Crypto.PublicKey import RSA | |
| from Crypto.Cipher import PKCS1_OAEP | |
| key = open(public_key_loc, "r").read() | |
| rsakey = RSA.importKey(key) |
| #!/usr/bin/env python | |
| import cv2 | |
| import numpy as np | |
| def main(): | |
| cap = cv2.VideoCapture(0) | |
| while(cap.isOpened()): | |
| ret, img = cap.read() | |
| skinMask = HSVBin(img) |
| # This is inspired by the fantastic guide https://github.com/saiprashanths/dl-setup | |
| # I have just updated the python-related commands so that everything works in Python 3. | |
| # Tested on Xubuntu 16.04. | |
| # First of all let's update the repos: | |
| sudo apt-get update | |
| # Only if you have a CUDA-compatible Nvidia card, install CUDA. | |
| # Check on the Nvidia website what is the latest driver version which supports your card. | |
| # At the time of this writing it was 367. |
| ''' | |
| nc.py - simple python3 wrapper to netcat (nc) | |
| ============================================= | |
| Introducton | |
| ----------- | |
| Netcat (http://nc110.sourceforge.net/) is a simple Unix utility which reads and | |
| writes data across network connections. If you are running Linux, you probably | |
| have a version of netcat installed already. |
Procedure Summary: Details