Skip to content

Instantly share code, notes, and snippets.

View dkliban's full-sized avatar

Dennis Kliban dkliban

View GitHub Profile
set -v
read -p "Download OpenAPI schema for pulpcore provided REST API."
curl -o pulpcore-api.json http://localhost/pulp/api/v3/docs/api.json?bindings&plugin=pulpcore
read -p "Check available config options for Python generator."
podman run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli config-help -g python
from pulpcore.client.pulpcore import (
ApiClient as CoreApiClient, ArtifactsApi, Configuration,
TasksApi, Upload, UploadCommit, UploadsApi
)
from pulpcore.client.pulp_file import (
ApiClient as FileApiClient, ContentFilesApi,
DistributionsFileApi, FileFileDistribution,
PublicationsFileApi, RemotesFileApi, FileFileRemote,
RepositorySyncURL, FileFilePublication,
FileFileRepository, RepositoriesFileApi,
from pulp.app.models import Task
from pulp.plugin import ProgressBar
def test(files):
mytask = Task(result='blah')
mytask.save()
progress_bar = ProgressBar(message='Publishing files', total=len(files), task_id=mytask.id)
progress_bar.save()
with progress_bar:
for file in progress_bar.iter(files):
@dkliban
dkliban / inventory.py
Last active August 29, 2015 14:20 — forked from epc/inventory.py
#! /usr/bin/env python
# vim: set fileencoding=utf-8:
""" Process URL for intersphinx targets and emit html or text """
def validuri(string):
return string
from sphinx.ext.intersphinx import read_inventory_v2
from posixpath import join
import pprint
Add the following to the end of /usr/lib/python2.7/site-packages/pulp/server/tasks/__init__.py
After you edit the file you will need make sure you have pulp_workers running. If you had the
workers running already, please restart them after editing the file.
---------------------------------------------------------------
import os, shutil
import celery
from pulp.server.async.tasks import TaskResult, Task
@dkliban
dkliban / gist:10994050
Last active August 29, 2015 13:59
Desktop notifications on a client accessing a remote Weechat server.
#Install sshnotify.py plugin
#Generate an RSA key pair without a passphrase
#Add public key to the /home/user/.ssh/authorized_keys on the client (where notifications will appear)
#/home/user/.ssh/weechat is the private key used to connect back to the client
#Run following command in weechat
/set plugins.var.python.sshnotify.addresses "localhost -p 19999 -i /home/user/.ssh/weechat"
#port 19999 can be any available port on the server running weechat