Skip to main content

Send IP

Python software to configure machines for sending their IP through ssh.

Installation

You are advised to create a virtual environment for this program:

conda create -n "send_ip_env" 
conda activate send_ip_end

Run the following to install:

pip3 install send_ip

Running from a virtual environment will affect the python path that you supply to config.yaml. See information in Usage section.

Usage

  1. Edit the config.yaml file to match your destination. These fields will be used to scp into the target machine (user@ip:port using password pass to login).
user: target-user
ip: ip-address
pass: target-password
port: target-port #default port is usually 22 
remote-path: target-folder # this folder will be created under /home/user might create errors for not linux users
refresh-freq: 15 # minutes for cron-job
python_path: /path/to/virtualenv/bin/python3 # the python path you supply here will affect where the code runs (e.g., /usr/bin/python3), see docs! 
  1. Use the pacakge functions, for example:
from send_ip.send_ip import *

info_file = create_info()
send_info(info_file)

You can save this into a send_ip_script.py and schedule this task to run automatically (see below)

Schedule task

Cron

You can setup send_ip_script.py to run on a schedule (e.g., every 15 minutes). For example, this is the configuration for a raspberry pi (pi) sending its IP to another machine (matias) using config.yaml.

from send_ip.setup_cron import setup_cron
setup_cron("/home/pi/send_ip/send_ip_script.py",15)
Current cron tab (same as $ crontab -l)
--------------------------------------

*/15 * * * * cd python3 /home/pi/send_ip/ && /home/pi/send_ip/send_ip_script.py # send ip to matias

Windows machines

Please refer to this example and file issues if having trouble.

For developers of send_ip

To install send_ip and tools needed for tests, you can install into a virtualenvironment like so:

pip install -e .[dev]

Known issues

For a Raspberry pi installation, you might face this issue:

          =============================DEBUG ASSISTANCE=============================
          If you are seeing a compilation error please try the following steps to
          successfully install bcrypt:
          1) Upgrade to the latest pip and try again. This will fix errors for most
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) Ensure you have a recent Rust toolchain installed. bcrypt requires
             rustc >= 1.56.0.
      
          Python: 3.9.2
          platform: Linux-5.15.56-v7l+-armv7l-with-glibc2.31
          pip: n/a
          setuptools: 65.5.0
          setuptools_rust: 1.5.2
          rustc: n/a
          =============================DEBUG ASSISTANCE=============================
      

You might need:

sudo apt-get install build-essential cargo

You can also refer to this info in bcrypt.

You might also need to install or upgrade rustc

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Don't forget to restart your shell after installation of rust!!

Metadata

Release files for send-ip 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for send-ip 0.0.10
File Interpreter ABI Platform
send_ip-0.0.10-py3-none-any.whl Python 3 none any Details

Release files / send_ip-0.0.10-py3-none-any.whl

Download URL send_ip-0.0.10-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62f83ee480d15e97d3835a58bedf3da7d37bc116fdff3abb19f4f6a6e7d9eb56
BLAKE2b-256 checksum
How to use checksums
d8ad6b0059e1b0eb72e6ab30af9ac41e4e7d62ecf52c8c362cc6b428320d6f4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for send-ip 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page