Skip to content

Instantly share code, notes, and snippets.

@pweinzettel
pweinzettel / get_free_fa_icons.php
Created August 4, 2020 17:00
List all free fontawesome icons
<?php
function proc_fa($page) {
$curl = curl_init($page);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$tmp = curl_exec($curl);
curl_close($curl);
preg_match('/window.__inline_data__ =(.*?)<\/script>/s', $tmp, $match);
$res = json_decode($match[1]);
@pweinzettel
pweinzettel / check_cert.php
Created August 4, 2020 16:51
Simple SSL web cert check from PHP
<?php
$urls = json_decode(file_get_contents('sites.json'),true);
function certdata($url) {
$parseurl = parse_url($url, PHP_URL_HOST);
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
$read = stream_socket_client("ssl://".$parseurl.":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
$cert = stream_context_get_params($read);
return openssl_x509_parse($cert['options']['ssl']['peer_certificate']);