This file contains hidden or 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
// there's a bit of ES6 magic at play here - actually, is it even magic at this point? | |
// anyway... | |
// instead of calling evaluate for each variable, like this: | |
const a = page.evaluate(() => document.querySelector('#selectorA').textContent); | |
const b = page.evaluate(() => document.querySelector('#selectorB').textContent); | |
const c = page.evaluate(() => document.querySelector('#selectorC').textContent); | |
// you could evaluate once and return an array of values and deconstruct them into the | |
// variable names you want. like this: |
This file contains hidden or 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 | |
HOST=$1 | |
PORT=$2 | |
PREFIX=$3 | |
if [ -z "$HOST" ] || [ -z "$PORT" ] || [ -z "$PREFIX" ] | |
then | |
echo "usage: mcdel host port prefix" | |
else | |
echo 'stats items' | nc $HOST $PORT | cut -d':' -f2 | uniq | grep -v END | xargs -n1 -I % sh -c "echo \"stats cachedump % 0\" | nc $HOST $PORT" | grep "^ITEM $PREFIX" | sed -E 's/ITEM\ (.*)\ \[.*\]/\1/' | xargs -I % -n1 sh -c "echo 'delete %' | nc $HOST $PORT" | wc -l | xargs -n1 -I % echo "% item(s) deleted" | |
fi |
This file contains hidden or 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 | |
HOST=$1 | |
if [ "$HOST" = "" ] | |
then | |
echo "usage: mcf host [port [prefix]]" | |
else | |
PORT=$2 | |
PORT=${PORT:=11211} | |
PREFIX=$3 |
This file contains hidden or 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
# Download | |
wget http://hivelocity.dl.sourceforge.net/project/pentaho/Data%20Integration/4.4.0-stable/pdi-ce-4.4.0-stable.tar.gz | |
wget http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.26.tar.gz | |
wget http://download.microsoft.com/download/0/2/A/02AAE597-3865-456C-AE7F-613F99F850A8/sqljdbc_4.0.2206.100_enu.tar.gz | |
# Extract | |
tar -xvzf pdi-ce-4.4.0-stable.tar.gz | |
tar -xvzf mysql-connector-java-5.1.26.tar.gz | |
tar -xvzf sqljdbc_4.0.2206.100_enu.tar.gz |