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
# Display current K8S resource usage for a namespace (either first argument or current) | |
# Add to your ~/.profile, copy-paste results for analysis to https://docs.google.com/spreadsheets/d/1v___k9gYo4RI4wWIluJcdqOVHCFEccLQMOCGxvrZGtk/edit?usp=sharing | |
# [email protected] / 2023-07-18 | |
function resource_capacity() { | |
if [ -z "$1" ] | |
then | |
namespace=$(kubectl config view --minify -o jsonpath='{..namespace}') | |
else |
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 | |
# should go into .profile | |
# from zone.eu shared server conf, with changes for MacOS | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias cd..='cd ..' | |
alias cd...='cd ../..' | |
alias cd....='cd ../../..' |
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 | |
# should go into .profile | |
# | |
# single timing: | |
# curltime https://example.com/ | |
# | |
# with unique query argument to bypass cache: | |
# curltime https://example.com/?cachebuster=202304271033 | |
# | |
# loop with increasing counter: |
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 | |
# [email protected] / 2022-11-01 ("Klytus, I'm bored. What plaything can you offer me today?") | |
# Scan images deployed to a K8S cluster for OpenSSL versions | |
# | |
# prerequisites: | |
# - kubectl | |
# - authenticated and authorised to access all namespaces of a cluster | |
# - Trivy installed https://aquasecurity.github.io/trivy/v0.34/getting-started/installation/ | |
# - Trivy has access to your presumably private registries https://aquasecurity.github.io/trivy/v0.34/docs/advanced/private-registries/gcr/ | |
# |
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 | |
/** | |
* A really dumb tool for ad-hoc PHP request logging - mostly useful to find malicious POST / cookie / etc payloads | |
* | |
* prepend with php.ini or .user.ini to cover all requests: | |
* auto_prepend_file = /[full-path-to-location]/dumb_sec.php | |
* | |
* @author : Peeter Marvet ([email protected]) | |
* @version 0.3 | |
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL |
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
# robots.txt for WordPress / v1.01 2020-01-27 / Peeter Marvet | |
# v1.01 - changed Crawl-delay to max allowed by Yandex e.g 2.0 | |
# | |
# Uncomment and specify hostname (sitemap can be on different domain): | |
#Sitemap: https://example.com/sitemap_index.xml | |
# | |
# User-agents are not cumulative, e.g if a bot finds matching group * is ignored. | |
User-agent: * | |
Crawl-delay: 2.0 | |
# All requests with parameters (search, WooCommerce filters etc): |
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
-- created to find tables with missing indexes on a WordPress install | |
SET @db = 'some_database'; | |
SELECT | |
tbl.table_name, | |
idx.indexes | |
FROM | |
information_schema.tables AS tbl | |
LEFT JOIN( | |
SELECT table_name, |
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 | |
/* | |
Plugin Name: Zone Updateall | |
Plugin URI: https://gist.github.com/petskratt/1d3e29fb4e6224e1a73b2422c8363044 | |
Description: Allow automatic WP and plugin updates. No fancy settings, just does the job. | |
Author: Peeter Marvet | |
Version: 0.1 | |
Author URI: https://www.zone.ee/ | |
*/ |
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 | |
/* | |
Plugin Name: Zone Cachebuster | |
Plugin URI: https://gist.github.com/petskratt/3acd7166297ff4451a606115b49ad22c | |
Description: Replace JS and CSS version parameters with hash - for obfuscation or quick cachebusting. | |
Author: Peeter Marvet | |
Version: 0.1 | |
Author URI: https://www.zone.ee/ | |
*/ |
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 debug output, uncomment: | |
#set -x | |
function help { | |
echo "WordPress cleanup -v 0.5 2018-06-26 / [email protected] | |
Usage: |
NewerOlder