Skip to content

Instantly share code, notes, and snippets.

View adgayle's full-sized avatar

Alquin Gayle adgayle

View GitHub Profile
@adgayle
adgayle / bash-basic-git-prompt.sh
Last active June 11, 2022 00:11
Simple command prompt with git status and command return code
#!/bin/bash
COLOR_GIT_CLEAN='\[\033[1;30m\]'
COLOR_GIT_MODIFIED='\[\033[0;33m\]'
COLOR_GIT_STAGED='\[\033[0;36m\]'
COLOR_RESET='\[\033[0m\]'
RED='\[\e[0;31m\]'
function git_prompt() {
@adgayle
adgayle / get_cs_id.py
Last active July 14, 2017 12:20
Getting the cs_id from CA Unified Infrastructure Management via web services
import logging
import socket
import json
from requests.auth import HTTPBasicAuth
import requests
def get_ip(device):
"""
get_ip: Obtains the IP address of device
@adgayle
adgayle / uimws.py
Created May 15, 2017 21:31
CA Unified Infrastructure Management REST API calls to check QOS
"""
uimws: Calls CA UIM REST API to retrieve QOS values for monitoring
validation
"""
import logging
from requests.auth import HTTPBasicAuth
import requests
def chk_qos(ws_info, qos, device, target):