# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
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 | |
/** | |
* 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, string $protocol = 'udp'): array | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-bundle@3.0.3001/dist/dcv.bundle.min.js"></script> | |
<input id="input-file" type="file" multiple accept=".jpg,.jpeg,.icon,.gif,.svg,.webp,.png,.bmp" /><br /> | |
Results:<br /> | |
<div id="results"></div> | |
<div id="parsedrResults" style="width: 100%; min-height: 10vh; font-size: 3vh; overflow: auto"></div> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Ionic App</title> | |
<base href="/" /> | |
<meta | |
name="viewport" |
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 | |
$opts = getopt("", ["file:"]); | |
if(!isset($opts["file"])) { | |
echo "Please specify a path with --path" . PHP_EOL; | |
exit(0); | |
} | |
$filename = rtrim($opts["file"], ".phar"); |
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 convertSecToTime($sec){ | |
$date1 = new DateTime("@0"); //starting seconds | |
$date2 = new DateTime("@$sec"); // ending seconds | |
$interval = date_diff($date1, $date2); //the time difference | |
return $interval->format('%y Years, %m months, %d days, %h hours, %i minutes and %s seconds'); // convert into Years, Months, Days, Hours, Minutes and Seconds | |
} | |
echo convertSecToTime(246395678); | |
//OUTPUT: 7 Years, 9 months, 21 days, 19 hours, 14 minutes and 38 seconds | |
?> |
- Update CentOS with the following command
yum check-update
yum update
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 | |
class AesCipher { | |
private const OPENSSL_CIPHER_NAME = "aes-128-cbc"; | |
private const CIPHER_KEY_LEN = 16; //128 bits | |
private static function fixKey($key) { | |
if (strlen($key) < AesCipher::CIPHER_KEY_LEN) { |
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 | |
$balanceA=array( | |
"USD" => 10000, | |
"GBP" => 20000 | |
); | |
$balanceB=array( | |
"USD" => 10000, | |
"GBP" => 20000, | |
"JPY" => 100 |
NewerOlder