Linux

How to install Zabbix 6.0 on Debian 12

1.apt-get install mariadb-server
2.Setup rights for user root or zabbix or similar
3.mysql
4.create DB zabbix with collate utf8_bin
5.create user zabbix with correct rights on zabbix DB
6.apt-get install zabbix-server-mysql zabbix-frontend-php php-mysql
7./etc/init.d/mysql restart
8.a2enconf zabbix-frontend-php
9.nano /etc/php/7.3/apache2/php.ini
10.setup date.timezone in php.ini (Europe/Rome)
11.systemctl reload apache2
12.systemctl restart apache2
13.nano /etc/mysql/mariadb.conf.d/50-server.cnf
14.innodb_log_file_size = 500M
15.innodb_log_buffer_size = 800M
16.innodb_strict_mode = 0
17.cd /usr/share/zabbix-server-mysql/
18.gunzip *.gz
19.mysql -uzabbix -p zabbix < schema.sql
20.mysql -uzabbix -p zabbix < images.sql
21.mysql -uzabbix -p zabbix < double.sql
22.mysql -uzabbix -p zabbix < data.sql
23.systemctl reload apache2
24.systemctl restart apache2 25.http://zabbix
26.apt-get install zabbix-agent
27.nano /etc/zabbix/zabbix_server.conf (DBPassword)
28.systemctl enable zabbix-server
29.reboot

    How to connect to Sql Server 2017 from php on debian 10

    apt-get update

    apt-get install unixodbc unixodbc-dev php-odbc php-cli

    wget https://packages.microsoft.com/debian/10/prod/pool/main/m/msodbcsql17/msodbcsql17_17.4.1.1-1_amd64.deb

    https://docs.microsoft.com/it-it/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver15

    odbcinst -i -d -f /opt/microsoft/msodbcsql17/etc/odbcinst.ini

    nano /etc/odbc.ini

    [MySQLServerDB]
    Description = Database SqlServerDB
    Driver = ODBC Driver 17 for SQL Server
    Server = server[,port]

    How to use PHPSpreadSheet with composer on Debian 10

    from root:
    apt-get install composer php-cli

    from user:
    composer require phpoffice/phpspreadsheet

    Into myfile.php (example):

    require_once('vendor/autoload.php');
    use PhpOffice\PhpSpreadsheet\Spreadsheet;
    use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
    // Creates New Spreadsheet
    $spreadsheet = new Spreadsheet();
    // Retrieve the current active worksheet
    $sheet = $spreadsheet->getActiveSheet();
    // Set the value of cell A1
    $sheet->setCellValue('A1', 'Paolo');
    // Sets the value of cell B1
    $sheet->setCellValue('B1', 'Pizzolongo');
    // Write an .xlsx file
    $writer = new Xlsx($spreadsheet);
    // Save .xlsx file to the current directory
    $writer->save('paolo.xlsx');

    How to install and use youtube-dl

    Available also with apt-get on debian, this repository package is usually not updated to the latest version. Consider to donwload it manually and use standalone.

    wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/bin/youtube-dl

    chmod a+rx /usr/bin/youtube-dl

    for updates:youtube-dl -U

    youtube-dl <video_url>

    To specify a format: youtube-dl -F <video_url>

    To download with a specific format youtube-dl -f <chosen_format><video_url>

    For subtitles:

    youtube-dl --list-subs <video_url>

    youtube-dl --all-subs --skip-download <video_url>

    For Playlists: youtube-dl -cit <playlist_url>

    Only Audio: youtube-dl -x --audio-format mp3 <video_url>