Archiv für den Monat: August 2015

Postgres: Status der Queries abfragen

Als Root folgende Zeile ausführen:

su postgres -c "psql -c \"select pid,substring(query,0,120),now() - query_start as elapsed from pg_stat_activity where query!='' and query!='DISCARD ALL' ORDER BY elapsed ASC;\""

oder:

psql -U postgres -c "SELECT pid,substring(query,0,120),now() - query_start AS elapsed FROM pg_stat_activity WHERE query!='' AND query!='DISCARD ALL' ORDER BY elapsed ASC;"

Probleme kann es bei der Peer Authentication von Postgres geben (Debian ist anders konfiguriert als Ubuntu).
Weiterlesen

Batch-Screenshots mit Firefox

#!/bin/bash
# Makes screenshots from web directories
# List of URLs is contained in urls.txt (one url per line)
# Firefox needs the PRO version of the Pearl Crescent Page Server - Plugin
# The rename command at the end removes the sorting options in the filename
ACTDIR=`pwd`
SAVEDIR="/home/myuser/page-saver"
URLFILE="urls.txt"
for url in `cat $URLFILE`; do
    echo "$url"
    # clean filename (no https://, replace / with ., cut the querystring)
    name=`echo $url | cut -d "?" -f1 | sed "s~https://~~g" | sed "s~/~.~g"`
    echo $name
    wget --no-check-certificate --user-agent="Mozilla/5.0 compatible" "$url" -O "${SAVEDIR}/${name}html"
    # tmp folders break page saver - because of cropping - so do not picture the tmp folders
    part=`echo $name | cut -d "." -f4`
    echo $part
    if [[ "$part" != "tmp" ]]
    then
        firefox -saveimage "$url" -saveoptions format=png -saveas "$SAVEDIR/%u_%Y-%m-%d.png"
        sleep 15
    fi
done
cd "$SAVEDIR"
rename 's/-C=M;O=D_/_/' *.png
cd "$ACTDIR"

Voraussetzungen:

  • Firefox
  • Pearl Crescent Page Saver installiert (Firefox-Addon)
  • Datei „urls.txt“ im Verzeichnis des Scriptes (jeweils eine komplette URL pro Zeile)

Download-Urls:

https://addons.mozilla.org/de/firefox/addon/pagesaver/

http://pearlcrescent.com/products/pagesaver/

 

Link: htaccess tester und HTML Formatter

.htaccess Tester
http://htaccess.madewithlove.be/

Formatter (hier HTML)
http://www.freeformatter.com/html-formatter.html

  • Formatters, Validator, Encoder, Code Minifier, Converter, String Escaper

Base64-Image-Encoding für Inline Images
http://www.base64-image.de/step-1.php

  • Gif, Jpeg, PNG als Inline-String erstellen

Timestamp-Konvertierer
http://www.gaijin.at/olsutc.php

  • E-Mail Header Analyzer, Geo IP Locator, Nameserver Lookup, TLD Info, Webserver Spy, Whois
  • Browser Spy, CHMOD – Benutzerrechte, Hash Calculator, .htpasswd Crypt, MAC Address Block Lookup, Mail Address Converter, Passwort Generator, Proxy-Test
  • HTML-Encoder, HTML to JavaScript Converter, JavaScript Encryptor, Mail-Link Generator, PHP Obfuscator, PopUp-Fenster Generator, und mehr…

Online Syntax-Highlighting
http://tohtml.com/php/

ScreenCloud (Screenshot als Link verschicken)
https://screencloud.net/