This file contains 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 rpm | |
for pkg in rpm.TransactionSet().dbMatch('provides', 'java'): | |
print '%s:%s:%s:%s' % (pkg['name'], pkg['version'], pkg['release'], pkg['epoch']) |
This file contains 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 crypt | |
crypt.crypt('my-secret-word', '$1$someSalt$') |
This file contains 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
sum(increase(kafka_producer_topic_metrics_record_send_total{topic = "$my_topic_name"}[1d])) |
This file contains 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
TOPIC_NAME_REGEX='(CI|TST|IT)[0-9]' | |
ZOOKEEPER_ADDR=127.0.0.1:2181 | |
for topic in $(kafka-topics --zookeeper $ZOOKEEPER_ADDR --list | egrep $TOPIC_NAME_REGEX) | |
do | |
kafka-topics --zookeeper $ZOOKEEPER_ADDR --delete --topic $topic | |
done |
This file contains 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
pipeline { | |
agent { | |
label 'Linux' | |
} | |
stages { | |
stage('ask') { | |
steps { | |
script { | |
def askpass = input( | |
message: 'Please enter the password', |
This file contains 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 python | |
# Cleanup old schemas from schema registry | |
import httplib | |
import json | |
import re | |
DELETE_REGEX = 'IT6[0-6][0-9]-' | |
con = httplib.HTTPConnection('127.0.0.1', 8081) |
This file contains 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 python | |
# Get compressed URL content | |
import gzip | |
import StringIO | |
import urllib2 | |
req = urllib2.Request('http://my.lenses.url/api/alerts', | |
headers = { | |
'Accept-encoding': 'gzip', |
This file contains 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 python | |
# Check service availability | |
# Usage: $0 hostname port | |
import socket | |
import sys | |
if len(sys.argv) != 3: | |
sys.stderr.write("Usage: %s hostname port\n" % sys.argv[0]) | |
sys.exit(2) |
This file contains 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 python | |
CONNECT_ENDPOINT = 'http://10.0.0.24:8083' | |
import httplib | |
import json | |
import os | |
import sys | |
action = 'pause' if os.path.basename(sys.argv[0]).startswith('pause') else 'resume' |
This file contains 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
curl --cacert /path/to/ca-root.crt \ | |
--cert /path/to/client.crt \ | |
--key /path/to/client.key \ | |
https://service.with.client.auth |