One night at the station, the air conditioners turned off and the temperature started to rise, naturally, I received email notifications on the phone, but since it was night, I only saw them in the morning, so it was necessary for such an emergency to quickly make the possibility of phone call notifications.
Continue reading “Zabbix notifications by phone via Asterisk”Category Archives: Linux
Shredding data with Shred
Shred – allows you to overwrite the specified file with random data in order to ensure, if necessary, the more difficult process of recovery or the impossibility of data recovery.
On some file systems, data deletion is not guaranteed and the use of shred may not be effective.
The list of possible arguments:
Help program:
--help man shred
Using wipe in Linux
wipe – utility for secure full erasing of information.
Install command in Linux Ubuntu/Debian:
sudo apt-get install wipe
I will describe some startup keys:
-f Disable confirmation requests.
-r Recursively Removes all subdirectories, symbolic links are not touched.
-c If the rights of the directory are read-only, then they will be changed to write.
-i Detailed information mode.
-s Quiet mode, most messages are not displayed.
-q Fast mode, directories are overwritten with random data 4 times.
-Q The number of rewrite cycles. Standard 4.
-a Stop execution on error.
-R Install a random device.
-l
-D Follow symbolic links, they don’t get touched by default.
-v Displays the version of the program.
-h Display help.
Install phpMyAdmin
phpMyAdmin is a web application written in PHP that allows you to administer MySQL databases through a browser.
The easiest way to install phpMyAdmin is to download the archive with the latest version from the official website www.phpmyadmin.net and unpack it into the desired www directory, then you can open http://HOST/phpmyadmin/setup/ in the browser and follow the instructions. After that, move the config.inc.php file to the phpmyadmin root directory and close access to /setup/ or delete it altogether.
Continue reading “Install phpMyAdmin”
Installing and using Netcat
Netchat is a utility that allows you to establish a TCP/UDP connection and perform data transfer.
Continue reading “Installing and using Netcat”Set up WatchDog by ABillS
In the ABillS billing system, you can configure the status check of any running programs, and configure automatic launch if any of them are not running.
For example, for tracking FreeRadius, you need to run the command:
/usr/abills/libexec/billd check_programs PROGRAMS="radiusd:/etc/init.d/radiusd start"
Where “radiusd” is the name of the program in the processes, and “/etc/init.d/radiusd start” the command to start it.
Install and configure Sphinx in Ubuntu
Sphinx – search engine with integration of API and MySQL databases, PostgreSQL.
Installation command:
sudo apt-get install sphinxsearch
After installation, tcp ports 9312 and 9306 are used.
Install the MySQL database server:
sudo apt-get install mysql-server mysql-client
Create a test database:
mysql -u root -p CREATE DATABASE test; SOURCE /etc/sphinxsearch/example.sql; quit
Make a copy of the sample configuration file:
sudo cp /etc/sphinxsearch/sphinx.conf.sample /etc/sphinxsearch/sphinx.conf
Fill in the required parameters including data for connecting to the database.
An example of opening a configuration file in the nano editor (Ctrl+X to exit and y/n to save or discard changes):
sudo nano /etc/sphinxsearch/sphinx.conf
Activate sphinxsearch by specifying START=yes in the following file:
sudo nano /etc/default/sphinxsearch
Run sphinxsearch:
sudo service sphinxsearch start
Adding data to the index:
sudo indexer --all
An example of adding to cron:
sudo crontab -e @hourly /usr/bin/indexer --rotate --config /etc/sphinxsearch/sphinx.conf --all
Command line search example:
search TEXT
Asterisk compile error solution “‘pjsip_tcp_transport_cfg’ has no member named ‘sockopt_params’”
Once I compiled Asterisk version 13.13.1 and when running make I noticed the following error:
‘pjsip_tcp_transport_cfg’ has no member named ‘sockopt_params’
pjproject-2.2.1 has already been compiled.
Solved the problem by compiling a newer version of pjproject-2.4.5
cd /usr/src wget http://www.pjsip.org/release/2.4.5/pjproject-2.4.5.tar.bz2 tar -xjvf pjproject-2.4.5.tar.bz2 cd pjproject-2.4.5 CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr make dep make make install
After that, the error disappeared.
Hidden files and directories in Ubuntu
Method 1
Put a dot at the beginning of the file or directory name.
Method 2
Create a .hidden file, place in a directory in which you need to hide something and write in it a column of the names of files or folders that should be hidden. The case of letters has a meaning, that is, if the name of an element is from a capital letter, then write it in the .hidden file in the same way.
To see the hidden items through the Nautilus file manager, you must press the key combination Ctrl+H or in the “View” menu click “Show hidden files”.
Ufw setup in Ubuntu
ufw stands for Uncomplicated Firewall.
If ufw is not installed in the system, then install it with the command:
sudo aptitude install ufw
The command activates ufw in the system, it will also be included every time the system starts:
sudo ufw enable
If ufw does not start after restarting the system, then edit ENABLED=no to ENABLED=yes in the file:
sudo nano /etc/ufw/ufw.conf
To disable is used:
sudo ufw disable
Deny all incoming connections:
sudo ufw default deny
To allow access for a subnet or address:
sudo ufw allow from 10.0.0.0/24
To re-enable all incoming connections:
sudo ufw default allow
Permit SSH connection from outside:
sudo ufw allow ssh
An example of allowing access to a specific port:
sudo ufw allow 80/tcp
View status:
sudo ufw status sudo ufw status verbose
Disable logging:
sudo ufw logging off
View profiles for applications:
sudo ufw app list
The configuration files are in /etc/default/ufw and /etc/ufw/applications.d
View official documentation:
man ufw
See also my article – Configure IPTables