Coder Social home page Coder Social logo

keygen-sh / example-python-machine-heartbeats Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 16 KB

Example of node-locked machine activation with a heartbeat monitor.

Home Page: https://keygen.sh

License: MIT License

Python 100.00%
software-licensing heartbeat-monitor license-keys node-locked saas-licensing on-premise on-prem multi-prem floating-licenses

example-python-machine-heartbeats's Introduction

Example Machine Activation Heartbeats

This is an example of a typical node-locked or floating machine activation flow written in Python, utilizing a machine hearbeat monitor to automatically deactivate the machine in the event that the normal deactivation procedure fails.

Running the example

First up, configure a few environment variables:

# A Keygen activation token for the given license. You can generate an
# activation token per-license via the API or your admin dashboard.
export KEYGEN_ACTIVATION_TOKEN="A_KEYGEN_ACTIVATION_TOKEN"

# Your Keygen account ID. Find yours at https://app.keygen.sh/settings.
export KEYGEN_ACCOUNT_ID="YOUR_KEYGEN_ACCOUNT_ID"

You can either run each line above within your terminal session before starting the app, or you can add the above contents to your ~/.bashrc file and then run source ~/.bashrc after saving the file.

Next, install dependencies with pip:

python3 -m pip install -r requirements.txt

To perform a machine activation, run the program with a license key:

python3 main.py some-license-key-here

The script will use a SHA256-HMAC of your device's machineid for the machine's fingerprint during activation. Upon activation, a heartbeat monitor will be started for the activated machine.

If you exit the process, the machine will be deactivated.

If you kill the process, the heartbeat monitor will automatically deactivate the machine after the heartbeat window has been reached.

Questions?

Reach out at [email protected] if you have any questions or concerns!

example-python-machine-heartbeats's People

Contributors

ezekg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nevergray

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.