Skip to content

Instantly share code, notes, and snippets.

@Hitokun
Hitokun / sevone_rest_metric_export.py
Last active December 30, 2024 23:04
Use the SevOne REST API (available for SevOne NMS 5.6+) to gather all the metrics (Indicators) from all devices. This is a starting point to develop more robust SevOne export solutions via REST
import requests
import json
import time
# Log into SevOne API.
address = 'http://sevone.com/api/v1/'
creds = {'name': 'user', 'password':'pass'}
r = requests.post( address + "authentication/signin",
data=json.dumps( creds ),
headers = { 'content-type': 'application/json' })
@Hitokun
Hitokun / github_import.sh
Created December 30, 2024 22:58
How to import repositories from Self-Managed GitHub Enterprise instances into GitLab
# Import Project from GitHub Enterprise Self Managed to Gitlab.
# More info: https://docs.gitlab.com/ee/user/project/import/github.html#use-the-api
#
# Usage ./github_import.sh repo_id <Repo name>
# To find repo_id and name of the repos, do something like:
# curl -L \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer <YOUR-TOKEN>" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://some.enterprise.com/api/v3/orgs/ORG/repos \