- Make a backup:
dconf dump /org/gnome/terminal/ > gnome-terminal-settings.cfg
- Reset settings:
dconf reset -f /org/gnome/terminal/
- Restore from backup:
dconf load /org/gnome/terminal/ < gnome-terminal-settings.cfg
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 App\Payment; | |
use Iterator; | |
use Stripe\Collection; | |
use Stripe\Price as StripePrice; | |
use Stripe\StripeClient; | |
use Stripe\Product as StripeProduct; | |
/** @implements Iterator<Product> */ |
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 | |
$http = new HHttp(); | |
//$http->fetch("https://api.github.com/orgs/phpgt/repos") | |
$http->fetch("https://raw.githubusercontent.com/PhpGt/Fetch/master/broken.json") | |
->then(function(RResponse $response) { | |
echo "Got a response!", PHP_EOL; | |
sleep(1); | |
return $response->json(); | |
})->then(function(object|array $json) { |
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 | |
key="sup3r_s3cr3t_p455w0rd" | |
decrypted=$(openssl enc \ | |
-aes-256-ctr \ | |
-d \ | |
-k "$key" \ | |
-iv "504914019097319c9731fc639abaa6ec" \ | |
-in encrypted.txt) |
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 | |
$host = $_SERVER["SERVER_NAME"]; | |
$cacheDir = $_SERVER["DOCUMENT_ROOT"]; | |
$uriPath = $_SERVER["REQUEST_URI"]; | |
$uriPath = strtok($uriPath, "?"); | |
$uriFull = "https://" . $host . $uriPath; | |
$cacheFilepath = $cacheDir . "/" . ltrim($uriPath, "/"); | |
if(substr($cacheFilepath, -1) === "/") { | |
$cacheFilepath .= "index.html"; |
This fail2ban configuration is stored here for reference by myself in the future, but anyone is free to take a look at my custom rules.
The rules are highly specific to weird/dodgy traffic I get on my servers. Currently, the biggest "threat" is from a service called "Site24x7", who are constantly barraging my servers with broken requests ("G" requests, not "GET" requests). Sorry, I've got to block you!
Amongst others, there are a lot of attempts at using Wordpress features, or other old fashioned CMSes. As soon as one of these requests come in, block 'em!
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
select | |
(@param1 := ?), | |
value, | |
timestamp, | |
Field.name, | |
Site.id | |
from | |
Field_Value |
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 | |
if(count($argv) <= 1) { | |
echo "Usage: getall.php OrganisationName [PathToParentDir]", PHP_EOL; | |
exit(1); | |
} | |
$org = $argv[1]; | |
$path = $argv[2] ?? getcwd(); | |
$path = realpath($path); |
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 | |
/** | |
* This example counts the number of vowels and the number of consonants | |
* in example.txt, showing how concurrent slow file reads can use Promises | |
* to defer work, with a future callback when the work is complete. | |
* | |
* A PeriodicLoop is used with a purposefully long period with the file | |
* reading code being done one byte at a time, to simulate a slow connection. | |
* | |
* Note: This is an example wrapped in a class, showing an example of how a |
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
server { | |
server_name example.com www.example.com; | |
listen 80; | |
location / { | |
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; | |
include fastcgi_params; | |
fastcgi_param SERVER_NAME $host; | |
fastcgi_param SCRIPT_FILENAME /var/www/path/to/router.php; | |
} |
NewerOlder