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 | |
/* by pablo at compuar dot com see http://php.net/manual/de/function.base64-encode.php | |
* | |
* | |
*/ | |
$string = 'Blah'; | |
$encoded = strtr(base64_encode(addslashes(gzcompress(serialize($string),9))), '+/=', '-_,'); | |
$string= unserialize(gzuncompress(stripslashes(base64_decode(strtr($encoded, '-_,', '+/='))))); |
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 | |
# | |
# Setup: | |
# wget https://github.com/restic/restic/releases/download/v0.7.3/restic_0.7.3_linux_amd64.bz2 | |
# bunzip2 restic_0.7.3_linux_amd64.bz2 | |
# mv restic_0.7.3_linux_amd64 /usr/local/bin/restic | |
# chmod a+x /usr/local/bin/restic | |
# | |
# crontab -e | |
# 0 1 * * * /root/bin/restic-backup.sh 2>&1 >>/var/log/restic-backup.log |
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 | |
now=`date +"%Y-%m-%d" -d "05/06/2012"` | |
end=`date +"%Y-%m-%d" -d "05/23/2012"` | |
while [ "$now" != "$end" ] ; | |
do | |
now=`date +"%Y-%m-%d" -d "$now + 1 day"`; | |
echo $now | |
done |
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
# This is a basic VCL configuration file for varnish. See the vcl(7) | |
# man page for details on VCL syntax and semantics. | |
# | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8000"; | |
# health check: every 5 secs, sliding window of 5 checks of which 3 must be good | |
.probe = { | |
.url = "/"; | |
.interval = 5s; |
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 | |
#========================================== | |
# source size is 300x300 .. | |
function resizecrop { | |
SIZE=$1 | |
SRCFILE=$2 | |
DESTFILE=$3 |
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 | |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/etc/cakeagent | |
# Make sure we have some auth information | |
if [ -f /etc/cakeagent/auth.log ] | |
then | |
Authentication=($(cat /etc/cakeagent/auth.log)) | |
else | |
echo "Something has gone wrong and we can not find your auth credentials. Please reinstall" | |
exit 1 |
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
DELETE FROM oxconfig WHERE oxvarname IN ("aDisabledModules", "aLegacyModules", | |
"aModuleFiles", "aModulePaths", "aModules", "aModuleTemplates"); |
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
all: fetch report | |
fetch: | |
aws s3 sync --exclude "*" --include "*2018-03-*" --include "*2018-04-*" --include "*2018-05-*" s3://$BUCKET/$PATH/ . | |
report: | |
find . -name \*.gz | xargs gzcat | goaccess --log-format CLOUDFRONT --date-format CLOUDFRONT --time-format CLOUDFRONT -o ./report.html |
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 | |
// source: http://cubiq.org/the-perfect-php-clean-url-generator | |
// author: Matteo Spinelli | |
// MIT License / http://creativecommons.org/licenses/by-sa/3.0/ (please re-check at source) | |
setlocale(LC_ALL, 'en_US.UTF8'); | |
function toAscii($str, $replace=array(), $delimiter='-') { | |
if( !empty($replace) ) { | |
$str = str_replace((array)$replace, ' ', $str); | |
} |
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 | |
/** | |
* $ php p.php | |
* S SPAWNED! RRRRS SPAWNED! RRRRRS SPAWNED! R | |
*/ | |
function spawn() { | |
$descriptorspec = array( |
NewerOlder