Gennaio 2020

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>

Useful Software

Flashback Recorder: https://www.flashbackrecorder.com/express/
Record audio and video from desktop or meetings
Velocity Console: https://www.wavelink.com/Download-Velocity_enterprise-app-modernization-Software/
Configure Ivanti Terminal Emulation for android devices
Sysinternals Suite: https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite
Suite of many useful tools for windows os management
Rufus: https://rufus.ie/it_IT.html
Tool for freating bootable USB drives from .ISO files
Heidi SQL: https://www.heidisql.com/
Tool to manage MySQL, MariaDB, Postgres, SQL Server databases
WinSCP: https://winscp.net/eng/download.php
Connect and manage files through SFTP connctions
QR Code Studio: https://www.tec-it.com/it/download/free-software/qrcode-studio/Download.aspx
Generate QR Codes from text
FreeFileSync: https://freefilesync.org/
Copy, sync and backup files

Send Mail with PHPMailer as debian 10 meta-package

install on the debian server the following package:

apt-get install libphp-phpmailer

and use it as in the example below:

require("/usr/share/php/libphp-phpmailer/autoload.php");
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->IsSMTP(); 
$mail->SMTPAuth = false; 
$mail->SMTPSecure = false; 
$mail->SMTPAutoTLS = false; 
$mail->Host = ""; 
$mail->Port = 25; 
$mail->IsHTML(true); 
$mail->SetFrom("from@mydomain.tld"); 
$mail->Subject = "my subject"; 
$mail->Body = "my body"; $mail->AddAddress("to@anotherdomain.tld"); 
if(!$mail->Send()) { 
     echo "Mailer Error: " . $mail->ErrorInfo;
} else {
     echo "Message has been sent";
}