This file contains 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 | |
$domain = 'mydomain.tld'; | |
if (get_ssl_certificate_expiry($domain) < 30) { | |
throw new \Exception('Certificate expires in less than 30 days!'); | |
} | |
function get_ssl_certificate_expiry(string $domain): ?int | |
{ |
This file contains 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
#!/bin/bash | |
which mutool &> /dev/null || (echo "mutool is not installed" && exit 1) | |
which convert &> /dev/null || (echo "imagemagick is not installed" && exit 1) | |
which zip &> /dev/null || (echo "zip is not installed" && exit 1) | |
if [ "$1" = "" ] | |
then | |
echo "Usage: $0 File.pdf" | |
exit |
This file contains 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
#!/usr/bin/php | |
<?php | |
// Note: this code does not contain any DRM removal, DRM removal is made by https://notabug.org/NewsGuyTor/DeDRM_tools-LCP | |
// | |
// Install steps: | |
// Debian/Ubuntu/Mint: apt install php-cli python3 python3-cryptodome python3-lxml zip unzip | |
// | |
// How to use? | |
// Just run: php lcp_download.php FILE.LCPL PASSWORD | |
// A new FILE_decrypted.epub will be created in the same directory |
This file contains 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 | |
/** | |
* Return number of days before certificate expiry from a HTTPS URL | |
* Usage: get_ssl_certificate_expiry('https://www.framasoft.net/') | |
* => int(45) | |
* @author bohwaz | |
*/ | |
function get_ssl_certificate_expiry(string $url): ?int | |
{ |
This file contains 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 | |
/** | |
* Make a DNS a request to a custom nameserver, this is similar to dns_get_record, but allows you to query any nameserver | |
* Usage: dns_get_record_from('ns.server.tld', 'A', 'mydomain.tld'); | |
* => ['42.42.42.42'] | |
* @author bohwaz | |
*/ | |
function dns_get_record_from(string $server, string $type, string $record): array | |
{ |
This file contains 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
#!/usr/bin/env php | |
<?php | |
/* | |
This file is part of KD2FW -- <http://dev.kd2.org/> | |
Copyright (c) 2001-2019 BohwaZ <http://bohwaz.net/> | |
All rights reserved. |
This file contains 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 | |
// Mode d'emploi : créer un répertoire vierge et lancer "php cavites.php" | |
const JSON_URL = 'https://www.georisques.gouv.fr/webappReport/ws/telechargement/cavites?anneemin=2003'; | |
const PROJECTIONS = [ | |
1 => 'LambertI', | |
2 => 'LambertII', | |
3 => 'LambertIII', |
This file contains 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
#!/usr/bin/env php | |
<?php | |
/* | |
This file is part of KD2FW -- <http://dev.kd2.org/> | |
Copyright (c) 2001-2019 BohwaZ <http://bohwaz.net/> | |
All rights reserved. |
This file contains 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
Index: src/include/lib/Garradin/Membres/Session.php | |
================================================================== | |
--- src/include/lib/Garradin/Membres/Session.php | |
+++ src/include/lib/Garradin/Membres/Session.php | |
@@ -157,10 +157,21 @@ | |
protected function deleteAllRememberMeSelectors($user_id) | |
{ | |
return $this->db->delete('membres_sessions', $this->db->where('id_membre', $user_id)); | |
} |
This file contains 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 | |
namespace PHP81_BC; | |
/** | |
* Locale-formatted strftime using \IntlDateFormatter (PHP 8.1 compatible) | |
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP. | |
* Note that output can be slightly different between libc sprintf and this function as it is using ICU. | |
* | |
* Usage: | |
* use function \PHP81_BC\strftime; |
NewerOlder