This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| mongo: | |
| image: mongo:7.0.9 | |
| restart: always | |
| container_name: demo_mongo | |
| ports: | |
| - '27017:27017' | |
| volumes: | |
| - mongo-data:/data/db | |
| environment: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| redis: | |
| image: redis:7.0 | |
| restart: always | |
| ports: | |
| - '6379:6379' | |
| command: redis-server --requirepass "demo" | |
| volumes: | |
| - redis-data:/data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| zookeeper: | |
| image: bitnami/zookeeper:3.8.1 | |
| hostname: zookeeper | |
| ports: | |
| - "2181:2181" | |
| environment: | |
| ZOOKEEPER_CLIENT_PORT: 2181 | |
| ZOOKEEPER_TICK_TIME: 2000 | |
| ALLOW_ANONYMOUS_LOGIN: yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Created by mvp | |
| # pip install PyJWT | |
| import datetime | |
| import jwt | |
| SECRET = "<Some key here>" | |
| def encode_auth_token(data, exp_secs=86400): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use one in these way: | |
| * ssh-keygen -t ed25519 -C "[email protected]" | |
| If you are using a legacy system that doesn't support the Ed25519 algorithm, use: | |
| * ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| db: | |
| image: postgres:17.2-bookworm | |
| environment: | |
| - POSTGRES_USER=postgres | |
| - POSTGRES_PASSWORD=postgres | |
| - POSTGRES_DB=postgres | |
| ports: | |
| - "5433:5432" | |
| restart: always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install python-whois | |
| import whois | |
| def get_domain_info(domain): | |
| try: | |
| # Query the domain information | |
| domain = whois.whois(domain) | |
| print(domain) | |
| # print(f"Domain Name: {domain.domain_name}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install pymupdf | |
| import os | |
| import fitz # PyMuPDF | |
| def pdf_to_images(pdf_path, output_folder, zoom=1.0): | |
| """ | |
| Convert PDF pages to images with a zoom scale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip install python-barcode | |
| # pip install "python-barcode[images]" | |
| from io import BytesIO | |
| from barcode import EAN13 | |
| from barcode.writer import ImageWriter | |
| # Write to a file-like object: | |
| rv = BytesIO() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Created by .ignore support plugin (hsz.mobi) | |
| ### Python template | |
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| *$py.class | |
| # C extensions | |
| *.so |
NewerOlder