Skip to content

Instantly share code, notes, and snippets.

View fliphess's full-sized avatar

Flip Hess fliphess

View GitHub Profile
# this is an rsync-excludes format list of files to exclude.
@fliphess
fliphess / flush.php
Last active January 25, 2016 13:15
flush redis cache
<?php
header('Pragma: no-cache');
header('Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, proxy-revalidate');
echo "Flushing redis cache\n";
echo shell_exec('/usr/bin/redis-cli -n 0 "flushall"');
?>
@fliphess
fliphess / magupdate.sh
Last active August 29, 2015 14:27
update magento to the latest version
#!/bin/bash
[ -f ./mage ]|| { echo "Mage not found! Exiting!"; exit 1; }
chmod +x mage
./mage mage-setup .
./mage config-set preferred_state stable
./mage sync
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
php shell/indexer.php reindexall
@fliphess
fliphess / wordpress-hacks.md
Last active September 13, 2018 13:44
Wordpress hacks

Tips en Tricks om wordpress sneller en veiliger te maken.

Dit is een list met truuks om wordpress snel(ler) en veilig(er) te maken.

Alle tips zijn welkom :)

Wat iig een fijn aanknopingspunt is, is PageSpeed & YSlow. Zij maken gebruik van de best practises van yahoo en google en hebben een aantal goede tips die nog flink wat snelheid op kunnen leveren. http://gtmetrix.com

Tips

@fliphess
fliphess / eval-scan.sh
Last active September 11, 2018 07:59
Detect malafide files in websites
#!/bin/bash
grep -RE 'error_reporting\(0\)|preg_replace\(|eval\(|base64_decode|file_put_contents|exec\(|passthru|popen|proc_open|pcntl' --include='*.php' . | cut -d: -f 1 | sort -u | while read line
do
(echo $line | cat - $line) | less
done
@fliphess
fliphess / keybase.md
Last active September 9, 2016 11:45
Keybase validation

Keybase proof

I hereby claim:

  • I am fliphess on github.
  • I am fliphess (https://keybase.io/fliphess) on keybase.
  • I have a public key whose fingerprint is F59F E905 3A7B 8706 3FD8 FCEC 71EB EE2F 93D1 61F3

To claim this, I am signing this object:

@fliphess
fliphess / install-wordpress.sh
Last active November 25, 2015 20:51
Install wordpress from the commandline using wordpress cli
#!/bin/bash
PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'
INSTALL_WORDPRESS_EXTENSIONS=(
"better-wp-security"
"disqus-comment-system"
"redis-cache"
"wp-smushit"
"w3-total-cache"
"wp-optimize"
@fliphess
fliphess / human_log.py
Last active September 9, 2016 11:45 — forked from steinim/human_log.py
Ansible human logging callbacks
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)
@fliphess
fliphess / gist:9b1190335d22311037c2
Created November 25, 2015 09:02
Purge varnish on byte using cURL
curl -X PURGE --header 'Host: www.domein.nl' http://<loadbalancer ip>/.* -A "UserAgentString"
@fliphess
fliphess / varnishstat.php
Last active February 1, 2016 12:16
Get varnishtop output on byte dedicated servers
<?php
header('Pragma: no-cache');
header('Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate, proxy-revalidate');
$a = shell_exec('varnishstat -1');
echo "<pre>$a</pre>";
?>