Skip to content

Instantly share code, notes, and snippets.

@cometaj2
cometaj2 / cnc.py
Last active April 26, 2024 03:28
Interfacing with a cnc using huckle and hcli_hc in python
import io
import traceback
from huckle import cli, stdin
try:
print(cli("huckle --version"))
cli("huckle cli install http://127.0.0.1:8000")
cli("huckle cli run hc connect")
cli("huckle cli run hc home")
@cometaj2
cometaj2 / index.py
Last active September 19, 2023 18:00
HCLI hosted on AWS Lambda (standalone lambda WSGI handler (no AWS API Gateway))
#!/usr/bin/env python3
import json
import os
import errno
import sys
from apig_wsgi import make_lambda_handler
from hcli_core import hcli_core
app = hcli_core.connector(os.getcwd() + "/cli")
@cometaj2
cometaj2 / Dockerfile
Created September 19, 2023 02:00
jsonf hcli example in docker container
FROM python:3.11-alpine3.16
EXPOSE 80
RUN pip install --upgrade pip
RUN pip install hcli_core
RUN pip install gunicorn
CMD gunicorn --workers=5 --threads=2 --chdir `hcli_core path` -b 0.0.0.0:80 "hcli_core:connector()"
@cometaj2
cometaj2 / hcli-alps.xml
Last active February 11, 2018 00:12
hcli-alps profile
<alps version="1.0">
<doc>Hypertext Command Line Interface (HCLI) semantics.</doc>
<descriptor id="hcli-document" name="cli">
<doc>A resource for providing HCLI argument choices</doc>
<descriptor rt="#command" type="safe" name="cli"/>
<descriptor rt="#option" type="safe" name="cli"/>
<descriptor rt="#parameter" type="safe" name="cli"/>
<descriptor rt="#execution" type="safe" name="cli"/>