Skip to content

Instantly share code, notes, and snippets.

@dmcnulla
dmcnulla / update_pips.sh
Created December 15, 2022 18:46
Updates python packages for qta-tools repo (as of now)
pip install --upgrade pip
pip install -r test_requirements.txt
pip install -r monitor_viewpoint/resources/requirements.txt
pip install -r cmic_alert/resources/requirements.txt
pip install -r agent_snow_validation/resources/requirements.txt
pip install -r framework/requirements.txt
pip install -r config_viewpoint/resources/requirements.txt
pip install -r baas/resources/requirements.txt
pip install -r imc_operations/resources/requirements.txt
pip install -r verify_connectivity/resources/requirements.txt
@dmcnulla
dmcnulla / unittest.sh
Last active December 15, 2022 19:30
Runs all unit tests in qta-tools repo (ones in there now)
# Runs all if no parameter, runs unit tests for specific tool if tool name given (must match directory name)
if [ $# -eq 0 ]; then
for package in monitor_viewpoint cmic_alert verify_nodes nos_data_load agent_snow_validation tenable_scan framework config_viewpoint baas imc_operations tdc_image verify_connectivity verify_imc config_dbs_ldap snapshots_service sys_validate data_backup check_storage_space create_aliases verify_tasm_enabled nos_loader dbs_control_settings data_load; do
PYTHONPATH=. pytest $package/tests
done
else
PYTHONPATH=. pytest $1/tests
fi
@dmcnulla
dmcnulla / test_sg2u.py
Created August 17, 2022 14:52
Send many messages to sg2u and retrieve them from a queue to determine reliability of sg2u.
import requests
from time import sleep
import threading
import json
import pika
from os import path
QUEUE_NAME = "apex-durability-test"
TEMP_FILE = 'results.txt'
SERVER = 'http://10.25.148.82:31107/'
@dmcnulla
dmcnulla / test_multiple_side_effect.py
Last active September 27, 2021 21:27
Reproduce call_args_list for multiple side_effects in python unittest
from unittest import TestCase, mock
JIRA_URL = 'https://jira'
EXECUTOR = 'executedBy'
FAKE_USER = 'fake_user'
class JiraException(RuntimeError):
pass
@dmcnulla
dmcnulla / convert.py
Created May 6, 2021 00:18
converts postman export files to http files (used by IntelliJ plugin)
import json
from os import listdir
BASE_PATH = '/Users/david.mcnulla/Documents'
if __name__ == '__main__':
for file in [f"{BASE_PATH}/{file_name}" for file_name in listdir(BASE_PATH) if file_name.endswith('.json')]:
with open(file) as json_file:
data = json.load(json_file)
items = data['item']
@dmcnulla
dmcnulla / convert.py
Created May 6, 2021 00:16
Converts postman output file to http format (http service in IntelliJ)
import json
from os import listdir
BASE_PATH = '.'
if __name__ == '__main__':
for file in [f"{BASE_PATH}/{file_name}" for file_name in listdir(BASE_PATH) if file_name.endswith('.json')]:
with open(file) as json_file:
data = json.load(json_file)
items = data['item']
@dmcnulla
dmcnulla / .profile
Created May 13, 2017 05:16
bash profile
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
# aliases added by dmcnculla
alias s='subl '
alias tj='tar -xvjpf'
alias t='tar xvfz '
alias tz='tar -xvzpf'
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/dm186069/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
@dmcnulla
dmcnulla / .ackrc
Last active February 26, 2021 17:51
My ack-grep search helper file.
# only search with case sensitivity if there is mixed case
--smart-case
# Sort the files
--sort-files
--type-set=web=.css,.htm,.html,.php,.phtml,.js
--type-set=py=.py
--type-set=ruby=.rb,.rhtml,.rjs,.rxml,.erb,.rake,Rakefile
--type-set=steps=steps.rb,steps.java
MAP = {
'0' => '0000',
'1' => '0001',
'2' => '0010',
'3' => '0011',
'4' => '0100',
'5' => '0101',
'6' => '0110',
'7' => '0111',
'8' => '1000',