Tag Archives: terminal

HOW TO MySQL DUMP from terminal

You can create mysqldump like this:

mysqldump --defaults-extra-file=/path/to/config.cnf
Code language: JavaScript (javascript)

create config.cnf:

[client] user = whatever password = whatever host = whatever

Now lets backup a database

mysqldump --defaults-extra-file=/path/to/config.cnf database > /root/export.sql
Code language: JavaScript (javascript)

Hddtemp crontab every hour in to file

hddtemp is a small utility (with daemon) that gives the hard-drive temperature via S.M.A.R.T. (for drives supporting this feature).
In this article we are going to create a txt file and in it we are going to store the hdd temperature for every hour.

apt-get install hddtemp

crontab -e
* * * * echo `date`,`/usr/sbin/hddtemp /dev/sda` >> /root/hddtemp.txt
pico /root/hddtemp.txt

tail -f /root/hddtmep.txt

Install GoAccess Apache Log Analyzer Tool on Ubuntu 17.10

What is it?
GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly.
GoAccess was designed to be a fast, terminal-based log analyzer. Its core idea is to quickly analyze and view web server statistics in real time without needing to use your browser (great if you want to do a quick analysis of your access log via SSH, or if you simply love working in the terminal).
While the terminal output is the default output, it has the capability to generate a complete, self-contained real-time HTML report (great for analytics, monitoring and data visualization), as well as a JSON, and CSV report.
Install Required Dependencies
sudo apt-get -y install libncursesw5-dev gcc make libgeoip-dev libtokyocabinet-dev build-essential -y

Install GoAccess
wget http://tar.goaccess.io/goaccess-1.2.tar.gz
tar -xzvf goaccess-1.2.tar.gz
cd goaccess-1.2
sudo ./configure –enable-utf8 –enable-geoip=legacy
sudo make
sudo make install

Use GoAccess
sudo goaccess /var/log/apache2/access.log –log-format=COMBINED
sudo goaccess /var/log/apache2/access.log –log-format=COMBINED -a -o /var/www/html/report.html