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
from jira import JIRA | |
import csv | |
# Export CSV from Google Admin console | |
google_users = [] | |
with open('UserData.csv', 'r') as f: | |
reader = csv.DictReader(f) | |
for line in reader: | |
del line[''] |
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
#!/bin/bash | |
# ./delete_rundeck_jobs.sh <token> <project> | |
set -euo pipefail | |
IFS=$'\n\t' | |
JOBS=$(curl -s -X GET \ | |
-H"X-Rundeck-Auth-Token: $1" \ | |
-H"Accept: application/json" \ | |
"http://rundeck.example:4440/api/19/project/$2/jobs" | jq .[].id | tr -d '"') |
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
#!/bin/bash | |
# ./import_jobs.sh <token> <project> <file> | |
set -euo pipefail | |
IFS=$'\n\t' | |
curl -s -X POST --data-binary @$3 \ | |
-H"X-Rundeck-Auth-Token: $1" \ | |
-H"Content-Type: application/xml" \ | |
"http://rundeck.example:4440/api/19/project/$2/jobs/import?uuidOption=remove" |
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
#!/bin/bash | |
#./export-jobs.sh <token> | |
set -euo pipefail | |
IFS=$'\n\t' | |
PROJECTS=$(curl -s -X GET \ | |
-H"X-Rundeck-Auth-Token: $1" \ | |
-H"Accept: application/json" \ | |
"http://rundeck.example:4440/api/19/projects/" | jq .[].url | tr -d '"') |
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
#!/usr/bin/env sh | |
set -euo pipefail | |
IFS=$'\n\t' | |
INITIATE=$1 | |
HOSTNAME=$2 | |
IP=$3 | |
# Resources used by VMs | |
DOMIDS=$(virsh -c qemu+ssh://$IP/system list | awk -F' ' '{ print $1 }' | grep -v 'Id\|-') |
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
import requests | |
import json | |
client_id = '<id>' | |
client_secret = '<secret>' | |
print "Go to " | |
print "https://github.com/login/oauth/authorize?client_id=%s&scope=repo" % client_id | |
print "" |
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
import requests | |
import xml.etree.ElementTree as ET | |
import time | |
API_KEY='<key>' | |
RUNDECKSERVER = 'http://rundeck.example' | |
RUNDECKPORT='4440' | |
EXPIRE_DAYS = 3 | |
TODAY = int(round(time.time() * 1000)) | |
EXPIRE_MILISECONDS = EXPIRE_DAYS * 24 * 60 * 60 * 1000 |
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
import json | |
import datetime | |
import pytz | |
import dateutil.parser | |
opsgenie_api_key = 'xxx' | |
opsgenie_schedule_name = 'on_call_team_schedule' | |
sched = json.loads(requests.get('https://api.opsgenie.com/v2/schedules/%s/timeline?identifierType=name&intervalUnit=days' % opsgenie_schedule_name, headers={'Authorization': 'GenieKey %s' % opsgenie_api_key}).text) | |
next_on = {} |
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
sgrepy periodic_task -A1 | grep -v import | grep -v "^\-\-$" | grep def | wc -l | |
sgrepy \@periodic_task -A1 | grep -v "^\-\-$" | grep def | wc -l | |
echo | openssl s_client -connect site:port 2>/dev/null | openssl x509 -noout -dates | |
hostname && timeout 2 bash -c "2>/dev/null >/dev/tcp/<ip>/<port>" && echo works | |
openssl x509 -in certificates/certificate.crt -text -noout |
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
#!/usr/bin/env bash | |
$id=$1 | |
for dom in $(aws route53 list-resource-record-sets --hosted-zone-id $id --query "ResourceRecordSets[?Type == 'A']" | jq '.[]["Name"]' | sort | uniq | tr -d '"' | sed 's/\.$//');do | |
echo $dom $(openssl s_client -servername $dom -port 443 -showcerts -host $dom </dev/null 2>/dev/null | grep issuer) | |
done | |
for dom in $(aws route53 list-resource-record-sets --hosted-zone-id $id --query "ResourceRecordSets[?Type == 'CNAME']" | jq '.[]["Name"]' | sort | uniq | tr -d '"' | sed 's/\.$//');do | |
echo $dom $(openssl s_client -servername $dom -port 443 -showcerts -host $dom </dev/null 2>/dev/null | grep issuer) | |
done |