Search found 197 matches

by chris
Mon Mar 06, 2023 8:47 pm
Forum: PHP
Topic: SOLVED: PHP Fatal error: Uncaught mysqli_sql_exception: Duplicate entry
Replies: 2
Views: 8354

Re: PHP Fatal error: Uncaught mysqli_sql_exception: Duplicate entry

You first should check why you have a duplicated key. You can use INSERT IGNORE command rather than the INSERT command. If a record doesn't duplicate an existing record, then MySQL inserts it as usual. If the record is a duplicate, then the IGNORE keyword tells MySQL to discard it silently without g...
by chris
Fri Feb 10, 2023 8:45 pm
Forum: Servers
Topic: install lighttp with php
Replies: 1
Views: 15186

Re: install lighttp with php

You can install php-fpm, best is to install the others also apt-get install php php-cli php-common php-fpm php-mysql To enable PHP support for Lighttpd. you need to modify the php.ini file nano /etc/php/7.4/fpm/php.ini Change cgi.fix_pathinfo value to 1: cgi.fix_pathinfo=1 By default, PHP-FPM listen...
by chris
Fri Feb 10, 2023 3:29 pm
Forum: SQL
Topic: change primary key
Replies: 1
Views: 8321

Re: change primary key

You first have to drop the current primary key,
and after create a new.
Best is to do it in 1 SQL alter statement.

Code: Select all

ALTER TABLE table_name DROP primary key, ADD primary key(k1, k2, k3);
by chris
Sun Oct 16, 2022 7:43 pm
Forum: Shell
Topic: Run commands parallel
Replies: 1
Views: 7422

Re: Run commands parallel

You can send a task to the background,
with &. (and symbol)

Code: Select all

#command to the background
ls -la /home &

#get the process id
P1=$!;

#wait for it to finish
wait $P1;
by chris
Fri Sep 02, 2022 11:11 am
Forum: Servers
Topic: What are some good hosting providers?
Replies: 1
Views: 65430

Re: What are some good hosting providers?

I personaly like versio.nl.
It is a provider based in the Netherlands (Europe).
Good and fast service.


For more info about what types of hosting there are:
https://www.webmaster2020.com/hosting/
by chris
Sat Aug 20, 2022 4:12 pm
Forum: SQL
Topic: Average of day over several years
Replies: 1
Views: 5584

Re: Average of day over several years

Nice project, may I suggest alo add the max and minimum.

The folowing code should be a good start:

Code: Select all

SELECT MONTH(datum),DAY(datum),min(temperature),max(temperature),avg(temperature) FROM temperature GROUP BY MONTH(datum),DAY(datum)
by chris
Sat Aug 06, 2022 11:19 am
Forum: Shell
Topic: delete a block of text in nano
Replies: 1
Views: 3852

Re: delete a block of text in nano

Found it:

CTRL+SHIFT+6 (or ^)
to start the selection
go down with arrows
and CTRL+K to cut/delete block
by chris
Sat Aug 06, 2022 11:14 am
Forum: Shell
Topic: delete a block of text in nano
Replies: 1
Views: 3852

delete a block of text in nano

Does anyone know how to delete a block of multiple lines text in nano ?
by chris
Sun Jul 31, 2022 9:55 am
Forum: Servers
Topic: linux verify dates of SSL certificates
Replies: 2
Views: 13244

Re: linux verify dates of SSL certificates

If you havce access to the file directly:

Code: Select all

less certificate.crt | openssl x509 -noout -dates
by chris
Fri Jul 29, 2022 7:54 am
Forum: Servers
Topic: linux verify dates of SSL certificates
Replies: 2
Views: 13244

Re: linux verify dates of SSL certificates

You can use the following command : echo | openssl s_client -servername SERVERNAME -connect SERVER:PORT 2>/dev/null | openssl x509 -noout -dates An example: echo | openssl s_client -servername www.webmaster2020.com -connect www.webmaster2020.com:443 2>/dev/null | openssl x509 -noout -dates notBefore...