To creae a header like this:
Use hashtags:
#### A header
To display mono font in-line like this:
Here is a sample of mono font: hello
/** | |
* Return a string that represents an exception. | |
* @param {*} exc the exception object | |
* @returns String view of the exception, including stack trace dump | |
*/ | |
function excAsStr(exc) { | |
const errString = `${exc.toString()}\n${exc.stack}`; | |
return errString; | |
} |
mkdir /srv/gitlab | |
export GITLAB_HOME=$(pwd)/gitlab | |
cd gitlab | |
vi docker-compose.yml | |
######################## | |
# docker-compose.yml | |
version: '3.7' | |
services: | |
web: | |
image: 'gitlab/gitlab-ce:latest' |
# Handy (sorta) git commands | |
# | |
# | |
# DISCARD ALL LOCAL CHANGES | |
# | |
git reset --hard | |
git clean -fxd | |
# |
# | |
# Image, Export/save docker image for eventual loading onto another system that does not have access to a docker hub | |
# | |
docker image ls # to get actual image_name and tag_name | |
# option 1: | |
docker save image_name:tag_name > myimage.tar | |
# option 2 (to compress): | |
docker save image_name:tag_name | gzip > myimage.tar.gz |
#!/bin/bash | |
# remove docker containers and images | |
read -p "This script will remove all docker containers and images, continue (y/n)? " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then | |
exit 1 | |
fi |
# uncomment these for debugging | |
# set -e | |
# set -x | |
# save current dir | |
myOldPwd=$(pwd) | |
# Provides a common script exit point handler | |
# The function "finis" is called when the script containing this | |
# text files exits |
# | |
# ALIAS, create | |
# | |
vi ~/.bash_profile | |
alias cdg='cd mygitprojects' | |
# close vi, then | |
source ~/.bash_profile | |
# |
# Get absolute file name from a relative file name (RFN), where the RFN is | |
# relative to the caller of this function. | |
# @param relTargetPathFromCallersFile Relative path to the file you are interested | |
# in, relative to where you are calling this function from | |
# @returns Absolute file name of | |
# Example | |
# src/ | |
# dir1 | |
# textfile.txt | |
# dir2 |
# use this function snippet of code to allow importing of relative, local modules | |
import os | |
import importlib.util | |
def get_as_module_from_file(module_name, relFile): | |
spec = importlib.util.spec_from_file_location(module_name, | |
os.path.realpath(os.path.join(os.path.dirname(__file__), | |
relFile))) | |
module = importlib.util.module_from_spec(spec) | |
spec.loader.exec_module(module) | |
return module |