How to use PDO with PHP and MySQL
$db = new PDO('mysql:host=localhost;dbname=mydb;', 'username', 'password');
$q="select my query";
$db->query($q);
$db = new PDO('mysql:host=localhost;dbname=mydb;', 'username', 'password');
$q="select my query";
$db->query($q);
https://crontab.guru/
from CMD:
net statistics server
from task manager:

Days – Hours – Minutes – Seconds
set widget="my little string" set widget set widget=%widget:"=% set widget
Output:
widget="my little string" widget=my little string
nano /etc/zabbix/zabbix_server.conf
change the value for
### Option: StartPingers
# Number of pre-forked instances of ICMP pingers.
#
# Mandatory: no
# Range: 0-1000
# Default:
StartPingers=10
$i=0;
if (($handle = fopen("myfile.csv", "r")) !== FALSE) {
while (($cells = fgetcsv($handle, 1000, ",")) !== FALSE) {
if ($i==0){// header
}else{ //content
}
$i++;
}
fclose($handle);
}
I say “Full” disk encryption but that’s not entirely correct: there is still a small partition /boot that’s unencrypted. That contains your kernel, grub config and initrd and needs to be unencrypted so we can start booting and decrypt the rest of the OS.
So let’s get started:
Installing
Boot up your CD, USB flash drive, ISO file or install media of choice and select Graphical install.
CD Boot
Select your language.
Select a language
Select your location.
Select a location
Set your keyboard layout.
Configure the Keyboard
Pick a name for your computer.
Configure the network
Set your local domain.
Configure the network
I personally leave the root password blank, this disables the root account and instead sets you up with a first user that can run sudo to become root.
set up users and passwords
Enter your full name.
set up users and passwords
Pick your username (the default is usually pretty good).
set up users and passwords
Set your password.
set up users and passwords
Set your timezone.
Configure the clock
The encryption:
This is where the magic happens, actually it’s quite simple, we are going to pick “Guided – use entire disk and set up encrypted LVM” and then just go with the defaults.
Partition disks
Select the volume to install Debian. (This will wipe whatever you have on that disk!!)
Partition disks
Pick “All files in one partition (recommended for new users)”.
Partition disks
Pick ‘Yes’ to write the changes to the disks.
Partition disks
Now the disk will be writen with random data, this is to prevent analysis of the disk. This step can be skipped by pressing cancle but it’s highly reccomend you wait it out. It could take several minutes to a few hours so now is an absolutely smashing time to go and have a cup of tea.
Partition disks
Now set a passphrase for your disk.
Partition disks
Select “Finish partitioning and write changes to disk”
Partition disks
Pick ‘Yes’ to write the changes to the disks.
Partition disks
Continue the installation
Now we continue the installation as per normal.
Pick ‘No’ for any extra CDs.
configure the package manager
Pick your country to find a local mirror .
configure the package manager
And pick your mirror of choice, often (at least in Australia) you will find your local ISP has a mirror and this will likely be fastest for you.
configure the package manager
Enter any proxy information (most times this will be blank)
configure the package manager
You are given the option to opt-in to Debian’s statistics collection.
Configure the popularity contest
Pick your software, I’ve gone with KDE as my desktop of choice but it’s a matter of personal taste.
Debian Software Selection
Install GRUB
Install the grub boot loader on a hard disk
Pick your boot disk.
Install the grub boot loader on a hard disk
and finish the installation.
Finish the installation
Boot your system
Now when you boot up you should presented with a prompt asking for the key to decrypt sda5_crypt (your encrypted volumne)
Enter your passphrase (Note: you won’t see characters as you type)
Finish the installation
Now you can log in and enjoy your new Debian system
This article shows how to configure Windows Time Service on Windows Server 2016 so that it acts as an NTP server for domain client computers.
1. Type the following commands on PowerShell:
w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL
Stop-Service w32time
Start-Service w32time
Now the Windows Server 2016 is an NTP client of pool.ntp.org and its time/clock is synced with the NTP pool servers (The server is at the same time the NTP server for other domain client systems).
If your Windows Server 2016 machine is a VM inside Hyper-V, you have to disable time sync. Go to VM settings-> Management-> Integration Services and uncheck Time Synchronization. Otherwise, Windows Server 2016 time/clock will be synced with the Host time/clock.
2. Go to the client machines and run the following command on PowerShell to force them to sync their time/clock with the domain controller on the Windows Server 2016.
w32tm /resync
You can check the time synchronization status using the following command.
w32tm /query /status
1. apt-get install mysql-server
2. mysql
a. Setup rights for user root or zabbix or similar
b. create DB zabbix with collate utf8_bin
c. create user zabbix with correct rights on zabbix DB
3. apt-get install zabbix-server-mysql zabbix-frontend-php php-mysql
4. nano /etc/mysql/mysql.conf.d/mysqld.cnf
a. setup bind setting to allow or not remote connections to DB
5. /etc/init.d/mysql restart
6. a2enconf zabbix-frontend-php
7. nano /etc/php/7.2/apache2/php.ini
a. setup date.timezone in php.ini (Europe/Rome)
8. systemctl reload apache2
9. cd /usr/share/zabbix-server-mysql/
10. gunzip data.sql.gz
11. gunzip images.sql.gz
12. gunzip schema.sql.gz
13. mysql -uzabbix -p zabbix < schema.sql
14. mysql -uzabbix -p zabbix < images.sql
15. mysql -uzabbix -p zabbix < data.sql
16. open browser to http://
17. mv zabbix.conf.php /etc/zabbix/
19. chown root:root zabbix.conf.php
20. apt-get install zabbix-agent
21. nano /etc/zabbix/zabbix_server.conf
a. verify DBPassword correctly reported into zabbix_server.conf file
22. systemctl enable zabbix-server