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
KEY=$1 | |
EMAIL=$2 | |
MD5=`echo -n "$KEY $EMAIL" | md5sum| awk '{print $1}'` | |
curl -o /dev/null -s -sw "%{http_code}" -G --user "api:$KEY" -G https://api.mailgun.net/v3/address/validate --data-urlencode address="$EMAIL" > /tmp/$MD5 | |
RESPONSE_CODE=`cat /tmp/$MD5` | |
if [ $RESPONSE_CODE -eq 200 ]; then | |
echo "OK: $RESPONSE_CODE" | |
exit 0 | |
else | |
echo "FAILED: $RESPONSE_CODE" |
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
# based on your language you have to change the word "Gesendet" (german for Sent) | |
docker run --rm skempken/imapsync --host1 mail.xxxxx.com --authmech1 PLAIN --ssl1 --port1 993 --user1 xxxxxx --password1 'xxxxxxx' --debug --port2 993 --ssl2 --host2 imap.gmail.com --user2 xxxxxxx --password2 xxxxxxxxxxxx --addheader --exclude "\[Gmail\]$" --regextrans2 's,^Sent Items$,[Gmail]/Gesendet,' --regextrans2 "s/[ ]+/_/g" --regextrans2 "s/['\^\"\\\\]/_/g" --useuid |
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
if lynx --dump https://xxxxxxxxxxx |grep --quiet 'Something i am looking for' ; then | |
echo "Still there" | |
else | |
swaks --to xxxxxxxxxx@gmail.com --from "xxxxxxxxx@googlemail.com" --server smtp.gmail.com --auth PLAIN --auth-user "xxxxxxxxxx@googlemail.com" --auth-password "xxxxxxxxxxxxx" -tls -p 587 --h-Subject your-special-subject--body "your body" | |
fi |
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 | |
if(php_sapi_name()!=="cli"){ | |
echo "Must be run from the commend line."; | |
}; | |
/** | |
* Setup a magento instance so we can run this export from the command line. | |
*/ | |
require_once('app/Mage.php'); | |
umask(0); | |
if (!Mage::isInstalled()) { |
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%H%M%S` | |
GIT_MYSQL=/home/backup/mysql-schema | |
for T in `mysql -u root -N -B -e 'show tables from xxxxxx'`; | |
do | |
echo "Backing up $T" | |
mysqldump -d --skip-comments -u root xxxxxx $T | sed 's/ AUTO_INCREMENT=[0-9]*//g' > $GIT_MYSQL/$T.sql | |
done; | |
git add -A && git commit -m "schema from $NOW" && git push |
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 | |
REMOTE=x.x.x.x | |
# https://www.thomas-krenn.com/de/wiki/Supermicro_Remote_Management_Netzwerk_Ports | |
ssh -p XX root@localhost -L0.0.0.0:443:$REMOTE:443 -L0.0.0.0:5900:$REMOTE:5900 -L0.0.0.0:5901:$REMOTE:5901 -L0.0.0.0:5120:$REMOTE:5120 -L0.0.0.0:5123:$REMOTE:5123 -L0.0.0.0:80:$REMOTE:80 -L0.0.0.0:5988:$REMOTE:5988 -L0.0.0.0:22:$REMOTE:22 -L0.0.0.0:555:$REMOTE:555 -L0.0.0.0623:$REMOTE:623 -L0.0.0.0:5120:$REMOTE:5120 -C | |
# after this, start http://brokestream.com/udp_redirect.html | |
#./udp_redirect 0.0.0.0 623 $REMOTE 623 |
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 | |
rm -f /tmp/dbcompareresult | |
OUTPUT=`docker run --rm --link your_mysql_container:mysql -v /tmp/:/tmp/ macropage/mysql-utilities bash -c 'mysqldbcompare --skip-row-count --skip-data-check --difftype=sql --compact --server1=user:pwd@mysql:3306 --server2=user:pwd@slave:3306 db1:db2 |tee /tmp/dbcompareresult; exit ${PIPESTATUS[0]}'` | |
if [ ! -f /tmp/dbcompareresult ]; then | |
echo "CRITICAL COMMAND DID NOT RUN!"; | |
exit 2 | |
fi | |
if [ $? -ne 0 ]; then | |
LASTLINE=`tail -1 /tmp/dbcompareresult` |
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
SELECT | |
CONCAT(',\',"', c.COLUMN_NAME, '":\',', '\'"\', IFNULL(','REPLACE(TRIM(',c.COLUMN_NAME, '),\'"\',\'\\\\"\'), \'null\'),', '\'"\'') | |
FROM information_schema.COLUMNS c | |
WHERE c.TABLE_NAME = 'xxxxx'; | |
SELECT | |
CONCAT('{' | |
/* PASTE RESULT HERE AND FIX SOME MINOR COMMA STUFF */ |
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 | |
DATE=`date +%Y%m%d -d "1 day ago"` | |
echo $DATE | |
cd /var/log/xxxxx | |
find . -maxdepth 1 -name "$DATE*.bz2" -type f -print0| tar cjfv /var/log/xxxxx/byday/xxx.$DATE.tar.bz2 --remove-files --null -T - |