Proyecto

General

Perfil

« Anterior | Siguiente » 

Revisión 8de9efe9

Añadido por Martin Cuellar hace casi 6 años

si docs and organize

Ver diferencias:

README.md
# [Super Tiny Colors Library](https://nelbren.github.io/en/terminal/2018/05/13/super-tiny-colors.bash/) [\[en Español\]](https://nelbren.github.io/es/terminal/2018/05/13/super-tiny-colors.bash/)
# Documentation:
## What is it?
It is an ultra-super small compact and minimalist **library** (*done in 7 code lines*) used for scripts of [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)).
- ## Local:
## How does it work?
This uses variables to set the colors, encapsulating in this way the direct use of the [ANSI color codes](https://misc.flogisoft.com/bash/tip_colors_and_formatting), accomplishing quickness, consolidation and independence.
- ### [Super Tiny Colors Library](lib_super-tiny-colors.bash.md)
## Wrapper of ANSI color codes:
- ### [Sytem Information Bar](bin_system_si.bash.md)
- ### Use of ANSI color codes:
<hr class="small">
```bash
echo -e "\e[40;38;5;82m Hello \e[30;48;5;82m World \e[0m"
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/tip_colors_and_formatting.png?raw=true)
- ### Use of the super-tiny-colors:
```bash
git clone git@github.com:nelbren/npres.git
source /usr/local/npres/lib/super-tiny-colors.bash
echo -e "${nG} Hello ${Iy} World $S"
echo -e "${nG} Hello ${Ig} World $S"
echo -e "${nG} Hello ${Ir} World $S"
echo -e "${nG} Hello ${Iw} World $S"
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/uso_de_super-tiny-colors.png?raw=true)
## How do I obtain it?
- ### Through [github](https://github.com/nelbren/npres.git) (recommended):
```bash
cd /usr/local/
git clone https://github.com/nelbren/npres.git
```
*Repository of utilities of support of management of [Debian GNU/Linux](https://debian.org).*
- ### Through wget:
```bash
wget https://raw.githubusercontent.com/nelbren/npres/master/lib/super-tiny-colors.bash
```
## How are the colors defined?
- ### Identification of colors:
**Letter** | **Color**
--- | ---
w | white
m | magenta
b | blue
r | red
g | green
y | yellow
a | gray
- ### Format used by the library:
Description | Background color | Front color | Example
--- | --- | --- | ---
Normal | black | letter | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/nr.png?raw=true)
Normal **bright** | black | **LETTER** | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/nG.png?raw=true)
Inverse | letter | black | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/ib.png?raw=true)
Inverse ***bright color** | letter | black | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/Iy.png?raw=true)
Inverse **bright white** | **LETTER** | **white** | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/iA.png?raw=true)
## Examples:
- ### examples1
```bash
examples1
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/examples1.png?raw=true)
- ### examples2
```bash
examples2
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/examples2.png?raw=true)
- # Blog:
- ### [Super Tiny Colors Library](https://nelbren.github.io/en/terminal/2018/05/13/super-tiny-colors.bash/) [\[en Español\]](https://nelbren.github.io/es/terminal/2018/05/13/super-tiny-colors.bash/)
- ### [Sytem Information Bar](https://nelbren.github.io/en/terminal/2018/05/23/SIB_system-information-bar/) [\[en Español\]](https://nelbren.github.io/es/terminal/2018/05/23/SIB_system-information-bar/)
bin/alias/set.bash
#!/bin/bash
base=/usr/local/npres
alias si="$base/bin/system/check_si.bash"
alias si="$base/bin/system/si.bash"
si
bin_system_si.bash.md
# System Information Bar
## <i class="fa fa-question-circle" aria-hidden="true"></i> What is this?
### <i class="fa fa-quote-left" aria-hidden="true"></i> Scientia potentia est <i class="fa fa-quote-right" aria-hidden="true"></i>
***Knowledge is power.*** Knowing before hand or previewsly the system colapses or run out of resources, it becomes a priority, due to this, and to contemplate the panorama of programs that show us the resources and performance of our systems, **SI** arrives with a super powerful, fabulous and extremely concise bar of information of the actual resources.
## <i class="fa fa-globe" aria-hidden="true"></i> Tools with more detail:
- ### <i class="fa fa-terminal" aria-hidden="true"></i> Terminal:
- #### <i class="fa fa-star" aria-hidden="true"></i> [sysstat - Performance monitoring tools for Linux](http://sebastien.godard.pagesperso-orange.fr/)
- #### <i class="fa fa-star" aria-hidden="true"></i> [top - Dynamic real-time view of running processes](https://gitlab.com/procps-ng/procps)
- #### <i class="fa fa-star" aria-hidden="true"></i> [htop - Interactive process viewer for Unix](https://hisham.hm/htop/)
- #### <i class="fa fa-star" aria-hidden="true"></i> [conky-cli - Light-weight system monitor for terminal](https://github.com/brndnmtthws/conky)
- #### <i class="fa fa-star" aria-hidden="true"></i> [glances - An Eye on your system. A top/htop alternative](https://nicolargo.github.io/glances/)
- #### <i class="fa fa-star" aria-hidden="true"></i> [The Stress Terminal UI: s-tui](https://amanusk.github.io/s-tui/)
- ##### <i class="fa fa-line-chart" aria-hidden="true"></i> pip install s-tui; apt install strees; while true; do si; done <i class="fa fa-tachometer" aria-hidden="true"></i>
- ### <i class="fa fa-desktop" aria-hidden="true"></i> Web:
- #### <i class="fa fa-star" aria-hidden="true"></i> [conky - Light-weight system monitor for X](https://github.com/brndnmtthws/conky)
- #### <i class="fa fa-star" aria-hidden="true"></i> [munin - Networked resource monitoring tool](http://munin-monitoring.org/)
- #### <i class="fa fa-star" aria-hidden="true"></i> [scout_realtime - Top for the modern developer](https://scoutapp.github.io/scout_realtime/)
- #### <i class="fa fa-star" aria-hidden="true"></i> [eZ Server Monitor - Monitoring Linux servers](https://www.ezservermonitor.com/)
## <i class="fa fa-wrench" aria-hidden="true"></i> How does it work?
It is a sequence of commands from bash which extracts the information utilizing the tools from the system or the files of the process, according to the thresholds it assigns the color, and shows everything in a single line in less than 80 characters.
## <i class="fa fa-eye" aria-hidden="true"></i> Information shown:
![](/img/custom/sib_system-information-bar.png)
## <i class="fa fa-arrow-circle-down" aria-hidden="true"></i> How do i obtain it?
- ### <i class="fa fa-github-square" aria-hidden="true"></i> Through [github](https://github.com/nelbren/npres.git):
```bash
cd /usr/local/
git clone https://github.com/nelbren/npres.git
```
## <i class="fa fa-info-circle" aria-hidden="true"></i> How do i use it?
- ### <i class="fa fa-sign-in" aria-hidden="true"></i> When logging in, , add to the file **/etc/profile**:
```bash
. /usr/local/npres/bin/alias/set.bash
```
- ### <i class="fa fa-keyboard-o" aria-hidden="true"></i> By demand:
```bash
si
```
## <i class="fa fa-eye" aria-hidden="true"></i> Examples:
- ### <i class="fa fa-sign-in" aria-hidden="true"></i> When logging in:
Example of command execution:
![](/img/custom/sib_example_etc_profile.png)
- ### <i class="fa fa-keyboard-o" aria-hidden="true"></i> By demand:
Example of command execution:
![](/img/custom/sib_example_por_demanda.png)
<hr class="small">
## <i class="fa fa-thumbs-up" aria-hidden="true"></i> Thanks to:
- #### <i class="fa fa-male" aria-hidden="true"></i> Paul Colby <i class="fa fa-smile-o" aria-hidden="true"></i> by the code of [Calculating CPU Usage from /proc/stat](http://colby.id.au/calculating-cpu-usage-from-proc-stat/)
- #### <i class="fa fa-male" aria-hidden="true"></i> Nelbren <i class="fa fa-smile-o" aria-hidden="true"></i> by the code of [si](https://github.com/nelbren/npres/blob/master/bin/system/si.bash)
lib_super-tiny-colors.bash.md
# [Super Tiny Colors Library](https://nelbren.github.io/en/terminal/2018/05/13/super-tiny-colors.bash/) [\[en Español\]](https://nelbren.github.io/es/terminal/2018/05/13/super-tiny-colors.bash/)
## What is it?
It is an ultra-super small compact and minimalist **library** (*done in 7 code lines*) used for scripts of [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)).
## How does it work?
This uses variables to set the colors, encapsulating in this way the direct use of the [ANSI color codes](https://misc.flogisoft.com/bash/tip_colors_and_formatting), accomplishing quickness, consolidation and independence.
## Wrapper of ANSI color codes:
- ### Use of ANSI color codes:
```bash
echo -e "\e[40;38;5;82m Hello \e[30;48;5;82m World \e[0m"
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/tip_colors_and_formatting.png?raw=true)
- ### Use of the super-tiny-colors:
```bash
git clone git@github.com:nelbren/npres.git
source /usr/local/npres/lib/super-tiny-colors.bash
echo -e "${nG} Hello ${Iy} World $S"
echo -e "${nG} Hello ${Ig} World $S"
echo -e "${nG} Hello ${Ir} World $S"
echo -e "${nG} Hello ${Iw} World $S"
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/uso_de_super-tiny-colors.png?raw=true)
## How do I obtain it?
- ### Through [github](https://github.com/nelbren/npres.git) (recommended):
```bash
cd /usr/local/
git clone https://github.com/nelbren/npres.git
```
*Repository of utilities of support of management of [Debian GNU/Linux](https://debian.org).*
- ### Through wget:
```bash
wget https://raw.githubusercontent.com/nelbren/npres/master/lib/super-tiny-colors.bash
```
## How are the colors defined?
- ### Identification of colors:
**Letter** | **Color**
--- | ---
w | white
m | magenta
b | blue
r | red
g | green
y | yellow
a | gray
- ### Format used by the library:
Description | Background color | Front color | Example
--- | --- | --- | ---
Normal | black | letter | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/nr.png?raw=true)
Normal **bright** | black | **LETTER** | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/nG.png?raw=true)
Inverse | letter | black | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/ib.png?raw=true)
Inverse ***bright color** | letter | black | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/Iy.png?raw=true)
Inverse **bright white** | **LETTER** | **white** | ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/iA.png?raw=true)
## Examples:
- ### examples1
```bash
examples1
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/examples1.png?raw=true)
- ### examples2
```bash
examples2
```
> Example of command execution:
> ![](https://github.com/nelbren/nelbren.github.io/blob/master/img/custom/examples2.png?raw=true)

Exportar a: Unified diff