sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt --depth=1
sudo openssl rand -out /etc/nginx/ssl/ticket.key 48
sudo openssl dhparam -out /etc/nginx/ssl/dhparam4.pem 4096
sudo /opt/letsencrypt/letsencrypt-auto certonly --rsa-key-size 4096 --webroot --webroot-path /var/www/domaine.ltd -d domaine.ltd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post" enctype="multipart/form-data" onsubmit="return checkSize(2097152)"> | |
<input type="file" id="upload"> | |
<input type="submit"> | |
</form> | |
<script type="text/javascript"> | |
function checkSize(max_img_size) { | |
var input = document.getElementById("upload"); | |
if(input.files && input.files.length == 1) { | |
if (input.files[0].size > max_img_size) { | |
alert("The file must be less than " + (max_img_size/1024/1024) + "MB"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function is_dir_empty($dir) | |
{ | |
if (!is_readable($dir)) { | |
return null; | |
} | |
$handle = opendir($dir); | |
while (false !== ($entry = readdir($handle))) { | |
if ($entry != "." && $entry != "..") { | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function deleteDir($dirPath) { | |
if (!is_dir($dirPath)) { | |
throw new InvalidArgumentException("$dirPath must be a directory"); | |
} | |
if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') { | |
$dirPath .= '/'; | |
} | |
$files = glob($dirPath . '*', GLOB_MARK); | |
foreach ($files as $file) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getDays($month = null, $year = null) { | |
$list = array(); | |
if ($month == null) { | |
$month = date('m'); | |
} | |
if ($year == null) { | |
$year = date('Y'); | |
} |
add-apt-repository -y -u ppa:ondrej/php
apt-get update
apt-get install php7.4-bcmath php7.4-bz2 php7.4-cli php7.4-common php7.4-curl php7.4-dba php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-intl php7.4-ldap php7.4-mbstring php7.4-mysql php7.4-odbc php7.4-pgsql php7.4-snmp php7.4-soap php7.4-sqlite3 php7.4-tidy php7.4-xml php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-cgi php7.4-dev php7.4-phpdbg php7.4-enchant php7.4-interbase php7.4-pspell php7.4-readline php7.4-sybase php7.4-opcache php7.4-json php-xdebug libsodium-dev -y