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 bash | |
## For speedy use: | |
## mysql-restore-tables *.schema.* | |
## parallel -j 8 mysql-restore-table *.data.* | |
# MySQL server credentials | |
DB_USER="your_username" | |
DB_PASS="your_password" | |
DB_HOST="localhost" |
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 Sfinktah\Locks; | |
class SingleInstanceLock { | |
private string $lockFile; | |
private int $pid; | |
public function __construct($scriptName = null) { | |
if (!$scriptName) { |
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
unset EXPLODED | |
declare -a EXPLODED | |
function explode | |
{ | |
local c=$# | |
(( c < 2 )) && | |
{ | |
echo function "$0" is missing parameters | |
echo "$0 <delimiter> <string> <limit>" | |
echo "result is in EXPLODED" |
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 bash | |
function wan_ip_connection() { | |
local host=$1 | |
result=$( curl -s "http://$host/upnp/control?WANIPConnection" \ | |
-H 'SOAPAction: "urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress"' \ | |
--data-binary '<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetExternalI | |
PAddress xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"></u:GetExternalIPAddress></s:Body></s:Envelope>' | |
) | |
REGEX='ExternalIPAddress>([0-9.]+)<' |
OlderNewer