bbe4d89c258bab32977acd19c2c55de952184649

Author
Jeffrey Chandler <36927673+jeff-chandler@users.noreply.github.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Added a README file for the systemadmin plugin (#7279)

* Added a README file for the systemadmin plugin

* Updated formatting of Functions table and split it into
"named" and "unnamed" functions for clarity

* Fixed issue with '|' characters in table by adding them in
<code> stateuents </code>

* Added \ escape characters in front of | characters

Diff

 1diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..5b32470a002cebc22063f3546a7ea5d2a9026842
 4--- /dev/null
 5+++ b/plugins/systemadmin/README.md
 6@@ -0,0 +1,61 @@
 7+# Systemadmin plugin
 8+
 9+This plugin adds a series of aliases and functions which make a System Administrator's life easier.
10+ 
11+To use it, add `systemadmin` to the plugins array in your zshrc file:
12+
13+```zsh
14+plugins=(... systemadmin)
15+```
16+
17+## Aliases
18+
19+| Alias  | Command                                                                           | Description                                                        |
20+|--------|-----------------------------------------------------------------------------------|--------------------------------------------------------------------|
21+| ping   | `ping -c 5`                                                                       | Sends only 5 ICMP Messages                                         |
22+| clr    | `clear;echo "Currently logged in on $(tty), as $USER in directory $PWD."`         | Clears the screen and prings the current user, TTY, and directory  |
23+| path   | `echo -e ${PATH//:/\\n}`                                                          | Displays PATH with each entry on a separate line                   |
24+| mkdir  | `mkdir -pv`                                                                       | Automatically create parent directories and display verbose output |
25+| psmem  | <code>ps -e -orss=,args= \| sort -b -k1,1n</code>                                 | Display the processes using the most memory                        |
26+| psmem10| <code>ps -e -orss=,args= \| sort -b -k1,1n\| head -10</code>                      | Display the top 10 processes using the most memory                 |
27+| pscpu  | <code>ps -e -o pcpu,cpu,nice,state,cputime,args\|sort -k1 -nr</code>              | Display the top processes using the most CPU                       |
28+| pscpu10| <code>ps -e -o pcpu,cpu,nice,state,cputime,args\|sort -k1 -nr \| head -10</code>  | Display the top 10 processes using the most CPU                    |
29+| hist10 | <code>print -l ${(o)history%% *} \| uniq -c \| sort -nr \| head -n 10</code>      | Display the top 10 most used commands in the history               |
30+
31+
32+## Named Functions
33+These are used by some of the other functions to provide flexibility
34+
35+| Function    |  Description                                                                                                                          |
36+|-------------|---------------------------------------------------------------------------------------------------------------------------------------|
37+| retval      | Returns the first argument or a '.' if no arguments are specified                                                                     |
38+| retlog      | Returns the first argument or /var/log/nginx/access.log if no arguments are specified                                                 |
39+
40+## Unamed Functions
41+These functions are closer to aliases with complex arguments simplified (in most cases) into one line
42+
43+| Function    |  Description                                                                                                                          |
44+|-------------|---------------------------------------------------------------------------------------------------------------------------------------|
45+| dls         | List only directories in the current directory                                                                                        |
46+| psgrep      | List all processes that match the pattern input after the command                                                                     |
47+| killit      | xargs sudo kill | Kills any process that matches a regulr expression passed to it                                                     |
48+| tree        | List contents of directories in a tree-like format (if tree is installed)                                                             |
49+| sortcons    | Sort connections by state                                                                                                             |
50+| con80       | View all 80 Port Connections                                                                                                          |
51+| sortconip   | On the connected IP sorted by the number of connections                                                                               |
52+| req20       | List the top 20 requests on port 80                                                                                                   |
53+| http20      | List the top 20 connections to port 80 based on tcpdump data                                                                          |
54+| timewait20  | List the top 20 time_wait connections                                                                                                 |
55+| syn20       | List the top 20 SYN connections                                                                                                       |
56+| port_pro    | Output all processes according to the port number                                                                                     |
57+| accessip10  | List the top 10 accesses to the ip address in the nginx/access.log file or another log file if specified as an argument               |
58+| visitpage20 | List the top 20 most visited files or pages in the nginx/access.log file or another log file if specified as an argument              |
59+| consume100  | List the top 100 of Page lists the most time-consuming (more than 60 seconds) as well as the corresponding page number of occurrences |
60+| webtraffic  | List website traffic statistics in GB from tne nginx/access.log file or another log file if specified as an argument                  |
61+| c404        | List statistics on 404 connections in the nginx/access.log file or another log file if specified as an argument                       |
62+| httpstatus  | List statistics based on http status in the nginx/access.log file or another log file if specified as an argument                     |
63+| d0          | Delete 0 byte files recursively in the directory specified (or current directory if none is specificied)                              |
64+| geteip      | Gather information regarding an external IP address                                                                                   |
65+| getip       | Determine the local IP Address with `ip addr` or `ifconfig`                                                                           |
66+| clrz        | Clear zombie processes                                                                                                                |
67+| conssec     | Display the number of concurrent connections per second in the nginix/access.log file or another log file if specified as an argument |