Redis Keys Count by Group (namespace)
redis-cli KEYS "*" | awk -F: '{print $1'} | sort | uniq -c
Count WordPress transient
redis-cli KEYS "*" | grep ":transient:" | wc -l
Redis Keys Count by Group (namespace)
redis-cli KEYS "*" | awk -F: '{print $1'} | sort | uniq -c
Count WordPress transient
redis-cli KEYS "*" | grep ":transient:" | wc -l
| #!/bin/bash | |
| # Copyright © 2015 Bjørn Johansen | |
| # This work is free. You can redistribute it and/or modify it under the | |
| # terms of the Do What The Fuck You Want To Public License, Version 2, | |
| # as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
| WP_PATH="/path/to/wp" | |
| # Check if WP-CLI is available | |
| if ! hash wp 2>/dev/null; then |
| ## direct/one-time | |
| while read l; do | |
| [[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l; | |
| done < .ssh/authorized_keys | |
| ## add into .bashrc | |
| function fingerprints() { | |
| local file="$1" | |
| while read l; do | |
| [[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l |
| grep -lr "OLD_KEY" /root/newrelic-npi | xargs sed -i.bak 's/OLD_KEY/NEW_KEY/g' | |
| grep -lr "OLD_KEY" /etc | xargs sed -i.bak 's/OLD_KEY/NEW_KEY/g' | |
| ## check your npi plugins | |
| ./npi stop com.newrelic.plugins.mysql.instance | |
| ./npi start com.newrelic.plugins.mysql.instance | |
| ## check your php version | |
| service php7.0-fpm restart |
| grep -lr "OLD_KEY" /root/newrelic-npi | xargs sed -i.bak 's/OLD_KEY/NEW_KEY/g' | |
| grep -lr "OLD_KEY" /etc | xargs sed -i.bak 's/OLD_KEY/NEW_KEY/g' | |
| ## check your npi plugins | |
| ./npi stop com.newrelic.plugins.mysql.instance | |
| ./npi start com.newrelic.plugins.mysql.instance | |
| ## check your php version | |
| service php7.0-fpm restart |
| # get NEWRELIC_LICENSE_KEY from https://rpm.newrelic.com/accounts/ | |
| # export NEWRELIC_LICENSE_KEY=___CHANGE___THIS___TO___NEWRELIC_LICENSE_KEY____ | |
| [ -z "$NEWRELIC_LICENSE_KEY" ] && { echo "Please export NEWRELIC_LICENSE_KEY"; exit 1; } | |
| #debian repo | |
| echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list | |
| wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get install newrelic-php5 newrelic-sysmond |
| # on host machine | |
| useradd -u 1000 -d /var/jenkins jenkins | |
| chown -R jenkins:jenkins jenkins | |
| # latest stable jenkins | |
| docker run --name jenkins --privileged=true -p 8080:8080 -v /var/jenkins:/var/jenkins_home jenkins | |
| # jenkins 2.x | |
| docker run --name jenkins --privileged=true -p 8080:8080 -v /var/jenkins:/var/jenkins_home jenkins:2.0-rc-1 |
| # NOTE :: replace ___TIDEWAYS___KEY____ with actual tideways app key | |
| echo 'deb http://s3-eu-west-1.amazonaws.com/qafoo-profiler/packages debian main' > /etc/apt/sources.list.d/tideways.list | |
| wget -qO - https://s3-eu-west-1.amazonaws.com/qafoo-profiler/packages/EEB5E8F4.gpg | sudo apt-key add - | |
| sudo apt-get update | |
| sudo apt-get install -y tideways-php tideways-daemon tideways-cli | |
| # php 5.6 | |
| cp /etc/php5/mods-available/tideways.ini /etc/php/5.6/mods-available/tideways.ini | |
| echo "tideways.api_key=___TIDEWAYS___KEY____" >> /etc/php/5.6/mods-available/tideways.ini |
| # I wanted to use xargs but ran into some issues. Thus 2 lines! | |
| for file in /Applications/* ; do brew cask search `basename $file .app`; done > ~/cask-apps.txt | |
| cat ~/cask-apps | grep -A 1 Exact | grep -v Exact | grep -v "\-\-" |
| # first, make sure you have downloaded the Azure XPlat CLI | |
| # http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/#install | |
| sudo npm install azure-cli -g | |
| # login to Azure (will prompt for your username/password or will ask you to open link http://aka.ms/devicelogin in browser) | |
| azure login | |
| # optional - if you have multiple accounts | |
| ## list subscriptions | |
| azure account list |