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
strace -s 4096 -F -f `ps -ef | grep php-cgi | awk '{print "-p "\$2}'` &> /tmp/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
# IP | |
cat access.log | awk '{print $1}' | sort | uniq -c | sort -n | tail -fn 100 | |
# string in request | |
zgrep 'string' *.zip | tee /tmp/suspicious.log | |
grep 'string' /tmp/suspicious.log | awk '{ print $7 }' | sort | uniq -c | sort -n | |
# http count zwischen 0:00 uhr und 0:10 | |
zcat access.log.1.gz |grep 21/Mar/2017:00:0 > /tmp/000 | |
awk '{print $1}' < /tmp/000 |sort|uniq -c|sort -n|tail |
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 | |
MY_DIR=`dirname $0` | |
DB='db' | |
DB_USER='user' | |
DB_HOST='127.0.0.1' | |
DB_PORT='3308' | |
DB_PASS='pass' | |
LOGPATH='/www/custlogs.cloud.net' | |
DATE=$(date -d "-1 day" +"%Y%m%d") # select logs for yesterday | |
LIST=$(ls $LOGPATH/domain.de*$DATE*.log.zip) |
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
# curl debug | |
curl -v https://www.guitarspecs.info | |
# copenssl debug | |
openssl s_client -CApath /etc/ssl/certs -connect www.guitarspecs.info:443 -debug | |
# gnutls debug | |
gnutls-cli -V -d 9999 www.guitarspecs.de 443 |
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 | |
# @author gitfrage | |
# @license MIT | |
# mico php client for elasticsearch | |
# minimal API similar to the official client https://github.com/elastic/elasticsearch-php | |
function init($host, $port, $user = '', $pass = '') | |
{ | |
$ch = curl_init(); |
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/sh | |
DBNAME="mydatabase" | |
TABLES="table_x table_y" | |
FILENAME=/tmp/tmp.sql | |
SOURCE="[email protected]" | |
DEST="[email protected] [email protected]" | |
ssh $SOURCE "sudo mysqldump --single-transaction --hex-blob --order-by-primary --skip-triggers -u user --password=password $DBNAME $TABLES > $FILENAME" | |
scp $SOURCE:$FILENAME $FILENAME |
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
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done |