Skip to main content

eisenmp multiprocess(or) example collection for server

Project description

https://github.com/44xtc44/eisenmp_examples/actions/workflows/tests.yml/badge.svg

Python 3.7 Multiprocess Framework for single Server

Examples:

  • simple style prime number calculation to see the basic use

  • simple http server on one cpu gets content via queue

  • one flask orm server on each cpu - share a user db

  • multiple flask orm server on each cpu, port groups - share a user db

  • web download csv large list, calculate average over a column

  • brute_force_attack with itertools generator and dictionary

  • example with two, double fed queues

  • All scenarios follow the Template style and have descriptions

## How to run the examples?

  1. Clone the repo and run an eisenmp_exa_... or

  2. Install PyPi package

  • in terminal run: eisenmp_url and open the local Python SimpleHTTP URL

  • in terminal run: eisenmp_menu and choose from Menu

Brute force cracks strings of an online-game alphabet salad quest.

.. read wordlist .\lang_dictionaries\ger\german.dic
.. read wordlist .\lang_dictionaries\eng\words.txt
[BRUTE_FORCE]
cfhhilorrs
Create processes. Default: proc/CPU core
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

... proc Process-7 ... rohrschilf
... proc Process-14 ... rohrschilf
... proc Process-16 ... rohrschilf
... proc Process-7 ... rohrschilf
... proc Process-13 ... schilfrohr
... proc Process-13 ... schilfrohr
... proc Process-11 ... schilfrohr
... proc Process-11 ... schilfrohr

generator empty, run time iterator 5 seconds

exit WORKER 15
exit WORKER 16
exit WORKER 2
exit WORKER 10
exit WORKER 11
exit WORKER 12
exit WORKER 8
exit WORKER 3
exit WORKER 4
exit WORKER 6
exit WORKER 14
exit WORKER 5
exit WORKER 7
exit WORKER 13
exit WORKER 1
exit WORKER 9

--- Result for [CFHHILORRS]---

 rohrschilf

 schilfrohr

--- END ---

Processes are down.
BF Time in sec: 12

Process finished with exit code 0
Brute Force

We use an english (.6M) plus a german (2M) wordlist and make a dictionary of it. To gain more read speed.

len(str) <= 11, combined brute force dictionary attack with a permutation generator. itertool prod. duplicates Permutation lists grow very fast, reaching Terabyte size.

len(str) >= 12, pre reduce a len(str) list. Kick out words which are not matching char type and count.

Web download a large list

Calculates the average for one column. Python CSV extracts the column and we calculate the average with the assigned number of Porcesses/CPU cores. It can be more processes than CPU cores, if it makes sense.

large lists

https://www.stats.govt.nz/large-datasets/csv-files-for-download/ Crown copyright ©. All material Stats NZ produces is protected by Crown copyright. Creative Commons Attribution 4.0 International licence.

German dict

https://sourceforge.net/projects/germandict/. License Public Domain

English dict

Copyright (c) J Ross Beresford 1993-1999. All Rights Reserved.

ORM Flask-SQLAlchemy

https://pypi.org/project/Flask-SQLAlchemy-Project-Template/ License MIT 44xtc44

Cheers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eisenmp_examples-0.5.1.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eisenmp_examples-0.5.1-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

Details for the file eisenmp_examples-0.5.1.tar.gz.

File metadata

  • Download URL: eisenmp_examples-0.5.1.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for eisenmp_examples-0.5.1.tar.gz
Algorithm Hash digest
SHA256 4fc9eca3c52b67d67ae422b0feb73ed817b89e815f747a8c4ce1efbca1bb3d90
MD5 686c13045cd61ba435b442dcef0c409f
BLAKE2b-256 f068a00b1d44f3c35041032963a22aa297983debac47ce804c5402f130fbb93e

See more details on using hashes here.

File details

Details for the file eisenmp_examples-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: eisenmp_examples-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 89.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for eisenmp_examples-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54cd17be4f97a3589c760fd868a8df2df104ff11465cf1d310d338b4d570ee48
MD5 5b756c68aad22d349563560a873ec151
BLAKE2b-256 4c29616ce6625eeb7c6091e3b4206555c1964d5b49f595a11c329b7a4ae626ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page