Skip to content

Commit 4fcb1a3

Browse files
committed
aguia-pescadora-alpha (#17), aguia-pescadora-bravo (#16): instalado vnstat e criado adicionado 'ajuda' na Bravo; explicitado '-alpha' no hostname de Alpha
1 parent cffb652 commit 4fcb1a3

File tree

7 files changed

+291
-3
lines changed

7 files changed

+291
-3
lines changed

logbook/aguia-pescadora-alpha.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ sudo do-release-upgrade
104104

105105
#### Preparação Inicial:
106106

107-
sudo hostnamectl set-hostname aguia-pescadora.etica.ai
107+
sudo hostnamectl set-hostname aguia-pescadora-alpha.etica.ai
108108

109109
sudo vim /etc/hosts
110110
## Adicione o seguinte ao /etc/hosts

logbook/aguia-pescadora-alpha/etc/hosts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
127.0.0.1 localhost
22
127.0.1.1 ubuntu
3-
127.0.0.1 aguia-pescadora
3+
127.0.0.1 aguia-pescadora-alpha.etica.ai aguia-pescadora-alpha
44

55
# The following lines are desirable for IPv6 capable hosts
66
::1 localhost ip6-localhost ip6-loopback

logbook/aguia-pescadora-bravo.sh

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,20 @@ sudo apt install php-cli php-common
395395
# @TODO ver com mais calma versoes padroes do python. Ja se tem disponivel
396396
# nos repositorios principais a 3.7 (fititnt, 2019-05-18 21:40 BRT)
397397

398+
#------------------------------------------------------------------------------#
399+
# SEÇÃO: AJUDA AO USUARIO #
400+
# TL;DR: Lista como é documentado ao usuario final o que este servidor #
401+
# oferece. Em geral é uma forma de documentar as IDEs e todos os #
402+
# interpretadores/compiladores de linguagens de programação #
403+
#------------------------------------------------------------------------------#
404+
405+
##### Comando de ajuda do servidor _____________________________________________
406+
touch /usr/local/bin/ajuda
407+
sudo chmod +x /usr/local/bin/ajuda
408+
409+
vim /usr/local/bin/ajuda
410+
# customizar aqui... o arquivo esta commitado no repositorio
411+
398412
#------------------------------------------------------------------------------#
399413
# SEÇÃO: HTTP/HTTPS PADRÃO #
400414
# TL;DR: Documenta o uso de NGinx e afins como proxy reverso a aplicações #
@@ -430,6 +444,52 @@ sudo apt-get install python-certbot-nginx
430444
sudo certbot --nginx -d aguia-pescadora-bravo.etica.ai -d apb.etica.ai
431445

432446
#------------------------------------------------------------------------------#
433-
# temp...
447+
# SEÇÃO: ADMINISTRAÇÃO DO DIA A DIA #
448+
# TL;DR: Atalhos para algumas rotinas comuns do dia a dia de administrador de #
449+
# sistemas, como atalhos para ver logs de acesso, rotinas para #
450+
# reiniciar tarefas que tendem a dar problemas, etc. #
451+
# #
452+
# Adicionalmente documenta instalação/preparação de ferramentas que por #
453+
# serem tão extremamente especificas de administração de sistemas já #
454+
# não foram instaladas em etapas anteriores #
455+
#------------------------------------------------------------------------------#
456+
457+
##### VNstat [configuração inicial] ____________________________________________
458+
# @see https://www.howtoforge.com/tutorial/vnstat-network-monitoring-ubuntu/
459+
# Passos executados apenas para configurações iniciais
460+
461+
sudo apt install vnstat vnstati
462+
463+
# O comando a seguir deve ser usado para decidir qual a interface a monitorar
464+
ifconfig
465+
# Escolha a network para iniciar monitoramento. Neste caso é ens3
434466

467+
vnstat -u -i ens3
468+
469+
## vnstat --iflist
470+
# Available interfaces: ens3 lo
471+
472+
# Vamos iniciar vnstat para rodar imediatamente, e também iniciar com sistema
473+
sudo systemctl start vnstat
474+
sudo systemctl enable vnstat
475+
476+
# O arquivo /etc/vnstat.conf deve estar marcado para nossa interface desejada
477+
sudo vim /etc/vnstat.conf
478+
# trocar eth0 pela network especifica
479+
# default interface
480+
# Interface "ens3"
481+
# Para ver em tempo real o uso de rede
482+
483+
#------------------------------------------------------------------------------#
484+
485+
### Monitorar rede em tempo real ______________________________________________#
486+
## Vnstat
487+
# @see https://www.howtoforge.com/tutorial/vnstat-network-monitoring-ubuntu/
488+
vnstat -l
489+
490+
491+
#------------------------------------------------------------------------------#
492+
# temp...
493+
# O que estiver a partir daqui são comandos que foram realizadas e ainda não
494+
# foram propriamente documentados (fititnt, 2019-05-19 05:04 BRT)
435495
apt-get install fish
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# vnStat 1.18 config file
2+
##
3+
4+
# default interface
5+
Interface "ens3"
6+
7+
# location of the database directory
8+
DatabaseDir "/var/lib/vnstat"
9+
10+
# locale (LC_ALL) ("-" = use system locale)
11+
Locale "-"
12+
13+
# on which day should months change
14+
MonthRotate 1
15+
16+
# date output formats for -d, -m, -t and -w
17+
# see 'man date' for control codes
18+
DayFormat "%x"
19+
MonthFormat "%b '%y"
20+
TopFormat "%x"
21+
22+
# characters used for visuals
23+
RXCharacter "%"
24+
TXCharacter ":"
25+
RXHourCharacter "r"
26+
TXHourCharacter "t"
27+
28+
# how units are prefixed when traffic is shown
29+
# 0 = IEC standard prefixes (KiB/MiB/GiB/TiB)
30+
# 1 = old style binary prefixes (KB/MB/GB/TB)
31+
UnitMode 0
32+
33+
# how units are prefixed when traffic rate is shown
34+
# 0 = IEC binary prefixes (Kibit/s...)
35+
# 1 = SI decimal prefixes (kbit/s...)
36+
RateUnitMode 1
37+
38+
# output style
39+
# 0 = minimal & narrow, 1 = bar column visible
40+
# 2 = same as 1 except rate in summary and weekly
41+
# 3 = rate column visible
42+
OutputStyle 3
43+
44+
# used rate unit (0 = bytes, 1 = bits)
45+
RateUnit 1
46+
47+
# number of decimals to use in outputs
48+
DefaultDecimals 2
49+
HourlyDecimals 1
50+
51+
# spacer for separating hourly sections (0 = none, 1 = '|', 2 = '][', 3 = '[ ]')
52+
HourlySectionStyle 2
53+
54+
# try to detect interface maximum bandwidth, 0 = disable feature
55+
# MaxBandwidth will be used as fallback value when enabled
56+
BandwidthDetection 1
57+
58+
# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
59+
# (unless interface specific limit is given)
60+
MaxBandwidth 1000
61+
62+
# interface specific limits
63+
# example 8Mbit limit for eth0 (remove # to activate):
64+
#MaxBWeth0 8
65+
66+
# how many seconds should sampling for -tr take by default
67+
Sampletime 5
68+
69+
# default query mode
70+
# 0 = normal, 1 = days, 2 = months, 3 = top10
71+
# 4 = exportdb, 5 = short, 6 = weeks, 7 = hours
72+
QueryMode 0
73+
74+
# filesystem disk space check (1 = enabled, 0 = disabled)
75+
CheckDiskSpace 1
76+
77+
# database file locking (1 = enabled, 0 = disabled)
78+
UseFileLocking 1
79+
80+
# how much the boot time can variate between updates (seconds)
81+
BootVariation 15
82+
83+
# log days without traffic to daily list (1 = enabled, 0 = disabled)
84+
TrafficlessDays 1
85+
86+
87+
# vnstatd
88+
##
89+
90+
# switch to given user when started as root (leave empty to disable)
91+
DaemonUser ""
92+
93+
# switch to given user when started as root (leave empty to disable)
94+
DaemonGroup ""
95+
96+
# how many minutes to wait during daemon startup for system clock to
97+
# sync time if most recent database update appears to be in the future
98+
TimeSyncWait 5
99+
100+
# how often (in seconds) interface data is updated
101+
UpdateInterval 30
102+
103+
# how often (in seconds) interface status changes are checked
104+
PollInterval 5
105+
106+
# how often (in minutes) data is saved to file
107+
SaveInterval 5
108+
109+
# how often (in minutes) data is saved when all interface are offline
110+
OfflineSaveInterval 30
111+
112+
# how often (in minutes) bandwidth detection is redone when
113+
# BandwidthDetection is enabled (0 = disabled)
114+
BandwidthDetectionInterval 5
115+
116+
# force data save when interface status changes (1 = enabled, 0 = disabled)
117+
SaveOnStatusChange 1
118+
119+
# enable / disable logging (0 = disabled, 1 = logfile, 2 = syslog)
120+
UseLogging 2
121+
122+
# create dirs if needed (1 = enabled, 0 = disabled)
123+
CreateDirs 1
124+
125+
# update ownership of files if needed (1 = enabled, 0 = disabled)
126+
UpdateFileOwner 1
127+
128+
# file used for logging if UseLogging is set to 1
129+
LogFile "/var/log/vnstat/vnstat.log"
130+
131+
# file used as daemon pid / lock file
132+
PidFile "/var/run/vnstat/vnstat.pid"
133+
134+
135+
# vnstati
136+
##
137+
138+
# title timestamp format
139+
HeaderFormat "%x %H:%M"
140+
141+
# show hours with rate (1 = enabled, 0 = disabled)
142+
HourlyRate 1
143+
144+
# show rate in summary (1 = enabled, 0 = disabled)
145+
SummaryRate 1
146+
147+
# layout of summary (1 = with monthly, 0 = without monthly)
148+
SummaryLayout 1
149+
150+
# transparent background (1 = enabled, 0 = disabled)
151+
TransparentBg 0
152+
153+
# image colors
154+
CBackground "FFFFFF"
155+
CEdge "AEAEAE"
156+
CHeader "606060"
157+
CHeaderTitle "FFFFFF"
158+
CHeaderDate "FFFFFF"
159+
CText "000000"
160+
CLine "B0B0B0"
161+
CLineL "-"
162+
CRx "92CF00"
163+
CTx "606060"
164+
CRxD "-"
165+
CTxD "-"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/sh
2+
export TERM=xterm-256color
3+
blue=$( tput setaf 51 );
4+
green=$( tput setaf 10 );
5+
yellow=$( tput setaf 11 );
6+
normal=$( tput sgr 0 );
7+
echo "${green}
8+
Comando 'ajuda' de aguia-pescadora-bravo.etica.ai
9+
10+
Discussão no GitHub: https://github.com/fititnt/cplp-aiops/issues?q=is%3Aissue+is%3Aopen+label%3Aserver-aguia-pescadora
11+
Configuração de aguia-pescadora: https://raw.githubusercontent.com/fititnt/cplp-aiops/master/logbook/aguia-pescadora-bravo.sh
12+
13+
PACOTES PARA DESENVOLVIMENTO DE SOFTWARE
14+
----------------------------------------
15+
C/C++
16+
CCC padrão: [$(gcc --version | head -n1)]
17+
${yellow}gcc${green}
18+
G++ padrão: [$(g++ --version | head -n1)]
19+
${yellow}g++${green}
20+
21+
JAVASCRIPT (NODEJS)
22+
NodeJS padrão (**): [$(nodejs -v | head -n1)]
23+
${yellow}nodejs${green} [$(nodejs -v | head -n1)]
24+
${yellow}node${green} [$(node -v | head -n1)]
25+
${yellow}js${green} [$(js -v | head -n1)]
26+
Node Package Manager, NPM padrão (**), o gerenciador de pacotes do NodeJS
27+
${yellow}npm${green} [$(npm -v | head -n1)]
28+
29+
PERL
30+
Perl padrão: [$(perl -v | head -n2 | tail -n1)]
31+
${yellow}perl${green}
32+
33+
SHELL SCRIPT
34+
Bash padrão:
35+
${yellow}bash${green} [$(bash --version | head -n1 | tail -n1)]
36+
37+
PHP
38+
PHP padrão (*): [$(php --version | head -n1)]
39+
${yellow}php${green}
40+
PHP 7.2:
41+
${yellow}php7.2${green}
42+
43+
PYTHON
44+
Python padrão (*): []
45+
${yellow}python${green}
46+
Python 2.6:
47+
${yellow}python2${green}
48+
Python 3.6
49+
${yellow}python3${green}
50+
51+
*: recomendado você customizar um alias para versão explicita que quer usar.
52+
Esta versão padrão poderá ser alterada sem previo aviso para uma versão mais atual
53+
54+
**: considere usar gerenciador de pacote da própria linguagem (NVM do NodeJS,
55+
RVM do Ruby, etc)
56+
57+
EDITORES DE CÓDIGO / IDEs
58+
--------------
59+
${yellow}emacs${green} [$(emacs --version | head -n1)]
60+
${yellow}nano${green} [$(nano --version | head -n1)]
61+
${yellow}vim${green} [$(vim --version | head -n1)]
62+
63+
${normal}"

0 commit comments

Comments
 (0)