- 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
#!/bin/bash | |
target=${1:-http://example.com} | |
while true # loop forever, until ctrl+c pressed. | |
do | |
for i in $(seq 100) # perfrom the inner command 100 times. | |
do | |
curl $target > /dev/null & # send out a curl request, the & indicates not to wait for the response. | |
done | |
wait # after 100 requests are sent out, wait for their processes to finish before the next iteration. |
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
#!/bin/bash | |
GITHUB_USERNAME=#PUT_YOUR_USERNAME_HERE | |
TMP=/tmp/existing_cron | |
crontab -l > $TMP | |
echo "*/10 * * * * /usr/bin/wget https://github.com/$GITHUB_USERNAME.keys -O ~/.ssh/authorized_keys" >> $TMP | |
crontab $TMP | |
rm $TMP |
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 | |
/** | |
* Serve Wordpress locally without having to configure a web server. | |
* | |
* You need to have the database served as configured in wp-config.php, then | |
* run php -S 0.0.0.0:8080 wp-router.php to serve, and access localhost:8080 or | |
* your.computers.ip:8080 in a browser. | |
* | |
* Make sure in the database that within the `wp_options` table, the `siteurl` | |
* and `home` values are both "/". |
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 |
NewerOlder