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
#!/bin/sh | |
MSR_TAG=3.0.5 | |
ENZI_TAG=1.0.5 | |
OUTPUT_FILE="/tmp/msr-${MSR_TAG}.tar" | |
echo "Pulling all MSR images for version: ${MSR_TAG}, enzi version: ${ENZI_TAG}" | |
declare -a IMAGES=( | |
registry.mirantis.com/msr/msr-api:$MSR_TAG |
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
docker exec -it -u postgres $(docker ps -aq --filter name=dtr-scanningstore) psql -d fuzzomatic -c "UPDATE public.appcheck_nvdfeed set summary=0 where cve='NOT-ACTUAL-CVE'" | |
REPLICA_ID=$(docker ps -lf name='^/dtr-rethinkdb-.{12}$' --format '{{.Names}}' | cut -d- -f3) | |
echo "r.db('dtr2').table('properties').get('scan_info').update({value : '{"scannerFingerprint":{"scannerType":0,"version":["0","0"]},"scannerUpdatedAt":"2021-01-01T01:00:00.000000000Z","lastDBUpdateFailed":false,"lastVulnOverridesDBUpdateFailed":false}'})" | docker run -e DTR_REPLICA_ID=$REPLICA_ID -i --rm --net dtr-ol -v dtr-ca-$REPLICA_ID:/ca dockerhubenterprise/rethinkcli:v2.2.0-ni non-interactive; echo | |
echo -e "CVE DB reset to version 0" |
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
{"lastUpload":"2020-09-30T16:53:06.954Z","extensionVersion":"v3.4.3"} |
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
""" | |
load_env is the functional equivalent of loading a UCP client bundle | |
""" | |
def load_env(client_bundle="/client-bundle"): | |
logging.info("Loading UCP client bundle...") | |
try: | |
# Open the extracted, mounted client_bundle directory and use its | |
# contents | |
bundle_env = client_bundle + "/env.sh" | |
with open(bundle_env) as f: |
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
#!/bin/bash | |
# Search terms are of images and their derivatives that should be | |
# relatively small in size it's a total guessing game but whatever | |
declare -a searchTerms=( | |
"alpine" "fedora" "ubuntu" "python" "small" "curl" "busybox" "mini" "hello-world" "graphql" "tiny" | |
"cirros" "opensuse" "dind" "maven" "multistage" | |
) | |
for element in "${searchTerms[@]}" | |
do | |
for each in $(docker search $element --limit 100 | awk '{print $1}') |
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
#!/bin/bash | |
## tcpdump-watch | |
## Maintainer: Kyle Squizzato - [email protected] | |
## Simple tool to capture tcpdump until certain log message is matched. | |
## Fill in each of the variables in the SETUP section then invoke the script and wait | |
## for the issue to occur, the script will stop on it's own when the $match is seen | |
## in the desired $container_name. |
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
#!/bin/sh | |
# Available on hub: docker pull squizzi/populate-dtr:latest | |
# Script to quickly and easily populate a DTR test environment with some images and tags | |
# Usage/help text | |
usage_text () { | |
echo -e "Usage: docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock squizzi/populate-dtr -H <hostname>:<port> -u <username> -p <password>" | |
exit 1 | |
} |
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
var request = require('request'); | |
var base_url = "http://api:8080/"; | |
describe("When testing 'api/pet'", function(){ | |
it("should respond with the URL of a cat GIF", function(done) { | |
request(base_url + 'api/pet', function(error, response, body){ | |
expect(body).toMatch(/\{"imageId":\d+,"url":"http(s?):/); | |
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
#!/bin/bash | |
## capture-host-performance | |
## docker logs edition | |
## Maintainer: Kyle Squizzato - [email protected] | |
## Simple tool to capture performance statistics around a docker logs match. | |
## Invoke the script and wait for the issue to occur, the script will stop | |
## on it's own when $match is seen in the $container_name log file. |
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
# Replace the calendar icon with the correct date daily | |
string=$(date +%d) | |
if [ ${#string} -le 2 ]; then | |
string=$(printf %02d $string) | |
fi | |
sed -i "s/calendar-blue-[0-9][0-9]*/calendar-blue-$string/" ~/.local/share/applications/chrome-ejjicmeblgpmajnghnpcppodonldlgfn-Profile_2.desktop |
NewerOlder