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
git -c http.sslVerify=false clone https://example.com/path/to/git |
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
git branch -d `git branch --list '$1'` |
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
# Use an official CentOS image | |
FROM centos:6 | |
# Set the working directory to /home/hill119 | |
WORKDIR /home/hill119 | |
USER root | |
# Copy the current directory contents into the container at /home/hill119 | |
ADD . /home/hill119 |
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
pylint --generate-rcfile > .pylintrc |
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
def create_self_signed_cert(cert_dir): | |
""" | |
If datacard.crt and datacard.key don't exist in cert_dir, create a new | |
self-signed cert and keypair and write them into that directory. | |
Source: https://skippylovesmalorie.wordpress.com/2010/02/12/how-to-generate-a-self-signed-certificate-using-pyopenssl/ | |
""" | |
CERT_FILE = "hostcert.pem" | |
KEY_FILE = "hostkey.pem" |
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
def insert_between_nodes(current_node, new_node): | |
new_node.next = current_node.next | |
new_node.prev = current_node | |
current_node.next.prev = new_node | |
current_node.next = new_node | |
def SortedInsert(head, data): | |
new_node = Node(data) | |
current_node = head | |
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 OpenSSL | |
def get_x509_subject_string(cert_name): | |
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, open(cert_name).read()) | |
subject_components = x509.get_subject().get_components() | |
subject_string = "" | |
for component in subject_components: | |
subject_string = subject_string + "/" + component[0] + "=" + component[1] | |
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
html{ | |
width: 100vw; height: 100vh; | |
} | |
body { | |
width: 100vw; | |
height: 100vh; | |
/*Replace with some_image with image url/path*/ | |
background: url("some_image.png"); | |
background-repeat: no-repeat; |
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
/* source: https://stackoverflow.com/a/45275695/2154867 */ | |
#text_container { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
width: 100%; | |
height: 100vh; } | |
#text_container p { | |
margin: 0; | |
color: white; |
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
'''My preferred logging setup to log the filename, line number, function name, and time in messages''' | |
import logging | |
logger = logging.getLogger('metrics_logger') | |
logger.setLevel(logging.DEBUG) | |
# create formatter | |
formatter = logging.Formatter("%(levelname)s - %(filename)s - %(lineno)s - %(funcName)s - %(asctime)s - %(message)s", datefmt='%m/%d/%Y %I:%M:%S %p') | |
# create console handler with a higher log level | |
console_handler = logging.StreamHandler() | |
console_handler.setFormatter(formatter) |
NewerOlder