my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
5.3 KiB

3 years ago
  1. # Systemadmin plugin
  2. This plugin adds a series of aliases and functions which make a System Administrator's life easier.
  3. To use it, add `systemadmin` to the plugins array in your zshrc file:
  4. ```zsh
  5. plugins=(... systemadmin)
  6. ```
  7. ## Aliases
  8. | Alias | Command | Description |
  9. |---------|----------------------------------------------------------------------------|--------------------------------------------------------------------|
  10. | ping | `ping -c 5` | Sends only 5 ICMP Messages |
  11. | clr | `clear; echo Currently logged in on $TTY, as $USERNAME in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory |
  12. | path | `print -l $path` | Displays PATH with each entry on a separate line |
  13. | mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output |
  14. | psmem | `ps -e -orss=,args= \| sort -b -k1 -nr` | Display the processes using the most memory |
  15. | psmem10 | `ps -e -orss=,args= \| sort -b -k1 -nr \| head -n 10` | Display the top 10 processes using the most memory |
  16. | pscpu | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr` | Display the top processes using the most CPU |
  17. | pscpu10 | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr \| head -n 10` | Display the top 10 processes using the most CPU |
  18. | hist10 | `print -l ${(o)history%% *} \| uniq -c \| sort -nr \| head -n 10` | Display the top 10 most used commands in the history |
  19. ## Functions
  20. | Function | Description |
  21. |-------------|-----------------------------------------------------------------------------------------------------------------------|
  22. | dls | List only directories in the current directory |
  23. | psgrep | List all processes that match the pattern input after the command |
  24. | killit | Kills any process that matches a regular expression passed to it |
  25. | tree | List contents of directories in a tree-like format (if tree isn't installed) |
  26. | sortcons | Sort connections by state |
  27. | con80 | View all 80 Port Connections |
  28. | sortconip | On the connected IP sorted by the number of connections |
  29. | req20 | List the top 20 requests on port 80 |
  30. | http20 | List the top 20 connections to port 80 based on tcpdump data |
  31. | timewait20 | List the top 20 time_wait connections |
  32. | syn20 | List the top 20 SYN connections |
  33. | port_pro | Output all processes according to the port number |
  34. | accessip10 | List the top 10 accesses to the ip address in the nginx/access.log file or another log file if specified |
  35. | visitpage20 | List the top 20 most visited files or pages in the nginx/access.log file or another log file if specified |
  36. | consume100 | List the 100 most time-consuming Page lists (more than 60 seconds) as well as the corresponding number of occurrences |
  37. | webtraffic | List website traffic statistics in GB from tne nginx/access.log file or another log file if specified |
  38. | c404 | List statistics on 404 connections in the nginx/access.log file or another log file if specified |
  39. | httpstatus | List statistics based on http status in the nginx/access.log file or another log file if specified |
  40. | d0 | Delete 0 byte files recursively in the current directory or another if specified |
  41. | geteip | Gather information regarding an external IP address using [icanhazip.com](https://icanhazip.com) |
  42. | getip | Determine the local IP Address with `ip addr` or `ifconfig` |
  43. | clrz | Clear zombie processes |
  44. | conssec | Show number of concurrent connections per second based on ngnix/access.log file or another log file if specified |