sexta-feira, 29 de setembro de 2017

HOW TO INSTALL GRAFANA IN UBUNTU 16.04 LTS AND INTEGRATE WITH GRAFANA

wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_4.5.2_amd64.deb
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_4.5.2_amd64.deb
sudo service grafana-server start
sudo update-rc.d grafana-server defaults
sudo systemctl enable grafana-server.service
http://<yourip>:3000/login

for access your grafana server :
http://<your.ip>:3000

default user: admin
defaul pass: admin

for integration with zabbix execute:

sudo grafana-cli plugins list-remote

sudo grafana-cli plugins install alexanderzobnin-zabbix-app




plugins granafa installed:

grafana-cli plugins install raintank-worldping-app


terça-feira, 26 de setembro de 2017

HOW TO GRANT REMOTE ACCESS ON MYSQL 14.14 AND UBUNTU 16.04 LTS

Access you mysql server by terminal :
vi /etc/mysql/mysql.conf.d/mysqld.cnf
comment the line:

from: bind-address = 127.0.0.1
for: #bind-address = 127.0.0.1

execute: service mysql restart

after that, connect on your mysql server and execute this command: 

GRANT ALL PRIVILEGES ON *.* TO '<YOURUSERNAME>'@'<YOUIPD>' IDENTIFIED BY '<YOUPASSWORD>' WITH GRANT OPTION;



SHOW GRANTS;

LINUX COMMANDS

In terminal execute vi and if you want copy past line execute: Y Y P
For include start service: update-rc.d <linux service> enable/disable
For list services for list to start automatically: ls /etc/rc*.d
For check distr:  lsb_release -a

HOW TO USE SQLCMD ON UBUNTU FOR QUERY MICROSOFT SQL

First
apt-get install  -y libgss3
After   download the mssodbc
execute download  https://mega.nz/#!zM9x3DLZ

key for download:

!jFEs2CIynSBWLDMwmctXJsMM35DeIPn24EQj1rbQzWM


tar -zxvf msodbcsql-13.0.0.0.tar.gz

access the folder msodbcsql-13.0.0.0 for check if there are some library missing for start the instalation. execute this command:

ldd /lib64/libmsodbcsql-13.0.so.0.0



If there is no missing lib execute:


Accept the terms and waiting the installation.

After installation finish eheck if there is a lib msql installed:


For execute the test follow the command syntax:

detail syntax:

sqlcmd -S <yourserver>\\<yourdatabase>,<yourportsql> -U <youruser> -P <yourpassword> -i <yourscriptsql>.sql

Normaly the script sql is your query sql





segunda-feira, 18 de setembro de 2017

HOW TO ALLOW ACCESS TO ENTERPRISE ONX SAT SYSTEM

server_onix_sat  189.113.152.153
            189.113.149.200
            189.113.149.70 8080


onix_sat 80 tcp
              5398 tcp

urls:

www.google-analytics.com
maplink.uol.com.br
www.onixsat.com.br
go.onixsat.com.br
arquivos.onixsat.com.br
enterprise.onixsat.com.br
lbs.onixsat.com.br
service.onixsat.com.br
transito.lbslocal.com

source: http://enterprise.onixsat.com.br/conn-tutorial/?linkid=80001

sábado, 16 de setembro de 2017

HOW TO FIX "I CANT DELETE ANY FILES" MY USER IS ROOT (SUDOERS) BUT ICAN'T DELETE ANY FILES

When was detect this problem "icant delete any file"
was reboted my host, after that was detect the message  busybox-built-in-shell and following this commands:
https://vi4nn4network.blogspot.com.br/2017/09/how-to-fix-error-busybox-built-in-shell.html

HOW TO FIX ERROR BUSYBOX BUILT-IN SHELL (INITRAMFS) ON EVERY BOOT

execute:
after this message put:

fsck /dev/sda1

segunda-feira, 11 de setembro de 2017

HOW TO HARDENING APACHE 2.4.18 ON UBUNTU SERVER 16.04 LTS

Fisrt check the versions:

apache2 -v    # check version apache:
my result:  apache 2.4.18
lsb_release -a # check ubuntu version
my result: ubuntu 16.04.3 lts

1: Directory list disble

vi /etc/apache2/apache2.comf

change from:

 
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>


 
for:

 
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>
2:Apache version disable:

/etc/apache2/conf-enabled/security.conf
 

change from:
 
ServerSignature On
ServerTokens OS

for:
ServerSignature Off
ServerTokens Prod

3: Default Apache page disable

rename default page for old:
mv /var/www/html/index.html  /var/www/html/index.html.old

domingo, 3 de setembro de 2017

HOW TO INSTALL ZABBIX-SERVER 3.4.1 ON UBUNTU SERVER 16.04 LTS

apt-get update
apt-get install apache2
apt-get install php (will be install php 7)
apt-get install mysql
apt-get install mysql-server
apt-get install php7.0-xml php7.0-bcmath php7.0-mbstring
apt-get install libapache2-mod-php
apt-get install  a2enmod php7.0

wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
dpkg -i zabbix-release_3.4-1+xenial_all.deb
apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php

mysql -uroot -p<your_root_password>
create user 'zabbix'@'localhost' identified by 'your_zabbix_password';
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'your_zabbix_password';
flush privileges;
quit mysql database

zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix
put the zabbix_user from mysql

vi /etc/zabbix/zabbix_server.conf
add the password of zabbix user from database zabbix
service zabbix-server start
update-rc.d zabbix-server enable /etc/apache2/conf-enabled/zabbix.conf <<some times after execute this command there is a erro about locale, than you must execute this command dpkg-reconfigure locales to fix first for run again this command>>


vi /etc/zabbix/apache.conf

<IfModule mod_php7.c>
    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value always_populate_raw_post_data -1
    # php_value date.timezone Europe/Riga  <<<change for your native region>>
      php_value date.timezone America/Sao_Paulo
</IfModule>

service apache2 restart
apt-get install zabbix-agent
service zabbix-agent start

for finish, you must fix those errors:


  1. Time zone for PHP is not set (configuration parameter "date.timezone").
  2. PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).
  3. PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).
  4. PHP xmlwriter extension missing.
  5. PHP xmlreader extension missing.

for 1: add time zone for both field <php5 and php7> tag on,  /​etc/​apache2/​conf-enabled/zabbix.conf

for 2: you must execute apt-get install php-bcmath 
for 3: you must execute apt-get install php-mbstring
for 4: you must execute apt-get install php-xmlwriter
for 5: you must execute apt-get install php-xmlreader

for finish restart apache service and php by this way:

/etc/init.d/apache2 restart

and just finish the wizard

Source: https://www.zabbix.com/documentation/3.4/manual/installation/install#installing_frontend







sábado, 2 de setembro de 2017

HOW TO INSTALL ANDROID STUDIO ON UBUNTU AND FIX PROBLEM

add-apt-repository ppa:ubuntu-desktop/ubuntu-make 
apt-get update 
apt-get install ubuntu-make  

If you have a problem like that: 


ERROR: Unhandled exception
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/umake/tools.py", line 158, in wrapper
    function(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/umake/ui/__init__.py", line 56, in display
    cls.currentUI._display(contentType)
  File "/usr/lib/python3/dist-packages/umake/ui/cli/__init__.py", line 61, in _display
    contentType.run_callback(result=rlinput(contentType.content, contentType.default_input))
  File "/usr/lib/python3/dist-packages/umake/interactions/__init__.py", line 141, in run_callback
    self._callback_fn(result)
  File "/usr/lib/python3/dist-packages/umake/frameworks/baseinstaller.py", line 152, in confirm_path
    if os.listdir(path_dir):

PermissionError: [Errno 13] Permission denied: '/root/.local/share/umake/android/android-studio'



execute first :

sudo -s
unset SUDO_UID
unset SUDO_GID


After, for finish the correctly installation execute again

apt-get install ubuntu-make  


for remover you can do that:

umake android --remove