Example
The Book of Knowledge
Example.md
Markdown Examples - core syntax and extensions.
A markdown example shows how to write a markdown file. This document integrates core syntax and extensions (GMF).
- The Book of Knowledge
- This is an H1
- This is an H1 # ### This is an H2 ## #### This is an H3 ###### *** - Blockquotes - Lists - Unordered - Ordered - Indented - Blockquote - Code Block - Nested List - Code Blocks - Fenced Code Blocks - Syntax Highlighting - Horizontal Rules - Table
Block Elements
Paragraphs and Line Breaks
Paragraphs
HTML Tag: <p>
One or more blank lines. (A blank line is a line containing nothing but spaces or tabs is considered blank.)
Code:
This will be
inline.
This is second paragraph.
Preview:
Fc Troubleshooting
The Book of Knowledge
- FC_Troubleshooting.md
- Fibre Channel Troubleshooting
- Check the existence and status of the fibre cards: lspci | grep -i qlogic
- Three Ways to Check the status of the fibre cards
- Check the existence of the LUN devices
- Check if the number of LUNs is the same in all fibre card links
- To identify and to locate the WWPN numbers of the installed fibre cards
- Check if the SCLI (SANsurfer FC HBA CLI) package is installed in the o/s
- Check the status of the fibre cards
- Check the modprobe configuration for qla2xxx module
- Check the existence and status of the fibre cards: lspci | grep -i qlogic
FC_Troubleshooting.md
Fibre Channel Troubleshooting
Check the existence and status of the fibre cards: lspci | grep -i qlogic
Three Ways to Check the status of the fibre cards
systool -c scsi_host -v |egrep -i 'fw_state|link'
/opt/hp/hp_fibreutils/adapter_info
egrep -i "link|run" /sys/class/scsi_host/host?/state
Check the existence of the LUN devices
/usr/sbin/inq -btl -no_dots
Check if the number of LUNs is the same in all fibre card links
lsscsi -g # (Optional by installing the lsscsi rpm package)
To identify and to locate the WWPN numbers of the installed fibre cards
for n in `ls -lrt /sys/class/fc_host/host[0-9]*/port_name|awk '{print $9}'|cut -d/ -f5`;
do
p=`cat /sys/class/fc_host/$n/port_name`; printf "$n - $p\n";
done
Check if the SCLI (SANsurfer FC HBA CLI) package is installed in the o/s
yum list scli*
Check the status of the fibre cards
systool -c scsi_host -v |egrep -i 'fw_state|link'
Check the modprobe configuration for qla2xxx module
/etc/modprobe.conf or /etc/modprobe.d/qla2xxx.conf
should contain this line
Gitcommitmessage
The Book of Knowledge
GitCommitMessage.md
How to Write A Git Commit Message
The seven rules of a great Git commit message
Keep in mind: This has all been said before.
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Example
Summarize changes in around 50 characters or less More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of the commit and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); various tools like
log,shortlogandrebasecan get confused if you run the two together. Explain the problem that this commit is solving. Focus on why you are making this change as opposed to how (the code explains that). Are there side effects or other unintuitive consequences of this change? Here’s the place to explain them. Further paragraphs come after blank lines.
Gitcreaterepo
The Book of Knowledge
GitCreateRepo.md
How to Create a Repo from a Directory
- Create Repository in github.com
- Go into the directory containing the project.
git init
git add . # to add all of the relevant files.
git commit
git remote add origin git@git.dhl.com:pjoslin/<repo-name>
git config --global push.default simple
git push --set-upstream origin master
git push
Proxy and Certificates
If you’re using a proxy and get an SSL warning, try:
Glow
The Book of Knowledge
Glow.md
Installing Glow and frogmouth
- glow (charmbracelet/glow)
- frogmouth (Textualize/frogmouth)
Glow: TUI Markdown Reader and Directory Navigator
Glow can be downloaded from the Releases page, or built if Go 1.13+ is installed:
$ git clone https://github.com/charmbracelet/glow.git
$ cd glow
$ go build
Frogmouth: Textualize-Based Markdown Reader and Directory Navigator
Frogmouth is available through
pypi.org or pip.
Json
The Book of Knowledge
JSON.md
Working with JSON
Converting json to yaml
# jq -f toYaml < Data.json
or
# cmd | jq -f toYaml > Data.yaml
Where toYaml is:
# From: https://stackoverflow.com/questions/53315791/how-to-convert-a-json-response-into-yaml-in-bash#53330236
# purpose: converts Json to Yaml
# remarks:
# You can use 'yq -y' to convert json to yaml, but ...
# * this function can be used several times within a single jq program
# * this function may be faster than using yq
# * maybe yq is not available in your environment
# # input: any Json
# output: json converted to yaml
def toYaml:
def handleMultilineString($level):
reduce ([match("\n+"; "g")] # find groups of '\n'
| sort_by(-.offset))[] as $match
(.; .[0:$match.offset + $match.length] +
"\n\(" " * $level)" + # add one extra '\n' for every group of '\n's. Add indention for each new line
.[$match.offset + $match.length:]);
def toYamlString($level):
if type == "string"
then handleMultilineString($level)
| sub("'"; "''"; "g") # escape single quotes
| "'\(.)'" # wrap in single quotes
else .
end;
def _toYaml($level):
(objects | to_entries[] |
if (.value | type) == "array" then
"\(.key):", (.value | _toYaml($level))
elif (.value | type) == "object" then
"\(.key):", "\(" ")\(.value | _toYaml($level))"
else
"\(.key): \(.value | toYamlString($level))"
end
)
// (arrays | select(length > 0)[] | [_toYaml($level)] |
" - \(.[0])", "\(" ")\(.[1:][])"
)
// .;
_toYaml(1);
Kindlemagic
Magic Kindle Search Options
How To Use The Codes
- Open Up A Search Box By Tapping On The Magnifying Glass
- Enter “;711” (without The Quotes) As The Search String.
- Tap The Right Arrow Or Return Key To Search. Extensive Info About The WiFi Link Will Appear.
Other Codes
-
Reading Progress Calculation Displayed In The Lower Left Corner: ;ReadingTimeOff - switches off the reading time display ;ReadingTimeOn - switches on the reading time display ;ReadingTimeReset - resets the reading time computation
License
The Book of Knowledge
LICENSE.md
The license for Paul’s Book of Knowledge
The Creative Commons License
Book Of Knowledge by Paul R. Joslin is licensed under a Creative Commons Attribution 4.0 International License. Based on a work at GitHub. [//]: # ( vim: set ai et nu sts=2 sw=2 ts=2 tw=78 filetype=markdown :)
Logformat
HAPROXY Log Format
Chart
| Field | Format | Extract from the example above |
|---|---|---|
| 1 | process_name ‘[’ pid ‘]:’ | haproxy[14389]: |
| 2 | client_ip ‘:’ client_port | 10.0.1.2:33317 |
| 3 | ‘[’ request_date ‘]’ | [06/Feb/2009:12:14:14.655] |
| 4 | frontend_name | http-in |
| 5 | backend_name ‘/’ server_name | static/srv1 |
| 6 | TR ‘/’ Tw ‘/’ Tc ‘/’ Tr ‘/’ Ta* | 10/0/30/69/109 |
| 7 | status_code | 200 |
| 8 | bytes_read* | 2750 |
| 9 | captured_request_cookie | - |
| 10 | captured_response_cookie | - |
| 11 | termination_state | —- |
| 12 | actconn ‘/’ feconn ‘/’ beconn ‘/’ srv_conn ‘/’ retries* | 1/1/1/1/0 |
| 13 | srv_queue ‘/’ backend_queue | 0/0 |
| 14 | ‘{’ captured_request_headers* ‘}’ | {haproxy.1wt.eu} |
| 15 | ‘{’ captured_response_headers* ‘}’ | {} |
| 16 | ‘"’ http_request ‘"’ | “GET /index.html HTTP/1.1” |
Detailed fields description
-
“client_ip” is the IP address of the client which initiated the TCP connection to haproxy. If the connection was accepted on a UNIX socket instead, the IP address would be replaced with the word “unix”. Note that when the connection is accepted on a socket configured with “accept-proxy” and the PROXY protocol is correctly used, or with a “accept-netscaler-cip” and the NetScaler Client IP insertion protocol is correctly used, then the logs will reflect the forwarded connection’s information.
Ocpmetrics
The Book of Knowledge
OCPMetrics
Resource Usage and Quotas in OpenShift Container Platform
Pod - Metrics
Get current usage (cpu, memory) for all running pods in the current namespace.
Use --all-namespaces and --no-headers as needed.
$ oc get PODMetrics
NAME CPU MEMORY WINDOW
api-newops-data-76b4c9dfcc-79jqc 0 424772Ki 5m0s
api-ramp-machine-sorting-7f5d79f755-8z644 1m 454840Ki 5m0s
api-ramp-machine-sorting-7f5d79f755-dk6ht 1m 491500Ki 5m0s
api-ramp-machine-sorting-7f5d79f755-mks28 1m 480784Ki 5m0s
...
Pods Not Running
Use -ns NAMESPACE if needed. .status.phase is usually “Running” or
“Succeeded”. You can filter one or both out.
File: